-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
Copy pathTableLoader.tsx
59 lines (54 loc) · 1.36 KB
/
TableLoader.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { styled } from 'styled-components'
import { Flex, Skeleton, Td, useMatchBreakpoints } from '@pancakeswap/uikit'
const GridItem = styled(Flex)`
align-items: center;
`
const LoadingRow: React.FC<React.PropsWithChildren> = () => {
const { isXs, isSm } = useMatchBreakpoints()
return (
<tr>
<Td>
<GridItem>
<Skeleton height={[162, null, 64]} width={[80, null, 200]} />
</GridItem>
</Td>
<Td>
<GridItem justifyContent="flex-end">
<Skeleton height={[66, null, 24]} width={64} />
</GridItem>
</Td>
{isXs || isSm ? null : (
<>
<Td>
<GridItem justifyContent="flex-end">
<Skeleton height={42} width={64} />
</GridItem>
</Td>
<Td>
<GridItem justifyContent="flex-end">
<Skeleton height={48} width={124} />
</GridItem>
</Td>
</>
)}
<Td>
<GridItem justifyContent="center">
<Skeleton height={[36, null, 24]} width={[80, null, 120]} />
</GridItem>
</Td>
</tr>
)
}
const TableLoader: React.FC<React.PropsWithChildren> = () => (
<>
<LoadingRow />
<LoadingRow />
<LoadingRow />
<LoadingRow />
<LoadingRow />
<LoadingRow />
<LoadingRow />
<LoadingRow />
</>
)
export default TableLoader