|
1 | 1 | import { useTranslation } from "next-i18next"
|
| 2 | + |
| 3 | +import { ButtonLink } from "./ui/buttons/Button" |
| 4 | +import { Flex } from "./ui/flex" |
2 | 5 | import {
|
3 |
| - Flex, |
4 |
| - Image, |
5 | 6 | Table,
|
6 |
| - Tbody, |
7 |
| - Td, |
8 |
| - Text, |
9 |
| - Th, |
10 |
| - Thead, |
11 |
| - Tr, |
12 |
| -} from "@chakra-ui/react" |
13 |
| - |
14 |
| -import { ButtonLink } from "./Buttons" |
| 7 | + TableBody, |
| 8 | + TableCell, |
| 9 | + TableHead, |
| 10 | + TableHeader, |
| 11 | + TableRow, |
| 12 | +} from "./ui/Table" |
15 | 13 |
|
16 | 14 | import { useRtlFlip } from "@/hooks/useRtlFlip"
|
17 | 15 |
|
@@ -45,68 +43,51 @@ const StablecoinsTable = ({
|
45 | 43 | }
|
46 | 44 |
|
47 | 45 | return (
|
48 |
| - <Table variant="unstyled" my={8} bg="background.base" mb={8} minW="720px"> |
49 |
| - <Thead bg="background.highlight" color="body.medium"> |
50 |
| - <Tr> |
| 46 | + <Table className="my-8 min-w-[720px] bg-background"> |
| 47 | + <TableHeader> |
| 48 | + <TableRow> |
51 | 49 | {columns.map((column, idx) => (
|
52 |
| - <Th |
53 |
| - key={idx} |
54 |
| - fontWeight="bold" |
55 |
| - fontSize="md" |
56 |
| - verticalAlign="inherit" |
57 |
| - letterSpacing="normal" |
58 |
| - > |
59 |
| - {column} |
60 |
| - </Th> |
| 50 | + <TableHead key={idx}>{column}</TableHead> |
61 | 51 | ))}
|
62 | 52 |
|
63 | 53 | {content && content[0]?.url && (
|
64 |
| - <Th p={5} fontSize="md" fontWeight="normal" textAlign="end"> |
65 |
| - <Text as="span" display="inline-block" transform={flipForRtl}> |
| 54 | + <TableHead className="text-right font-normal"> |
| 55 | + <span className="inline-block" style={{ transform: flipForRtl }}> |
66 | 56 | ↗
|
67 |
| - </Text> |
68 |
| - </Th> |
| 57 | + </span> |
| 58 | + </TableHead> |
69 | 59 | )}
|
70 |
| - </Tr> |
71 |
| - </Thead> |
72 |
| - <Tbody> |
| 60 | + </TableRow> |
| 61 | + </TableHeader> |
| 62 | + <TableBody> |
73 | 63 | {hasError && (
|
74 |
| - <Tr p={4}> |
75 |
| - <Td colSpan={4}>{t("page-stablecoins-table-error")}</Td> |
76 |
| - </Tr> |
| 64 | + <TableRow className="p-4"> |
| 65 | + <TableCell colSpan={4}> |
| 66 | + {t("page-stablecoins-table-error")} |
| 67 | + </TableCell> |
| 68 | + </TableRow> |
77 | 69 | )}
|
78 | 70 |
|
79 | 71 | {content.map(({ name, marketCap, image, type, url }, idx) => (
|
80 |
| - <Tr |
81 |
| - key={idx} |
82 |
| - color="text" |
83 |
| - _hover={{ |
84 |
| - textDecoration: "none", |
85 |
| - bg: "background.highlight", |
86 |
| - }} |
87 |
| - _focus={{ |
88 |
| - bg: "background.base", |
89 |
| - color: "body.base", |
90 |
| - }} |
91 |
| - > |
92 |
| - <Td verticalAlign="middle"> |
| 72 | + <TableRow key={idx}> |
| 73 | + <TableCell> |
93 | 74 | <Flex>
|
94 |
| - {image && <Image src={image} alt="" me={4} boxSize={6} />} |
| 75 | + {image && <img src={image} alt="" className="me-4 h-6 w-6" />} |
95 | 76 | <>{name}</>
|
96 | 77 | </Flex>
|
97 |
| - </Td> |
98 |
| - <Td verticalAlign="middle">{marketCap}</Td> |
99 |
| - <Td verticalAlign="middle">{stablecoinsType[type]}</Td> |
| 78 | + </TableCell> |
| 79 | + <TableCell>{marketCap}</TableCell> |
| 80 | + <TableCell>{stablecoinsType[type]}</TableCell> |
100 | 81 | {url && (
|
101 |
| - <Td textAlign="end"> |
| 82 | + <TableCell className="text-right"> |
102 | 83 | <ButtonLink href={url} size="sm">
|
103 | 84 | {t("page-stablecoins-go-to")} {name}
|
104 | 85 | </ButtonLink>
|
105 |
| - </Td> |
| 86 | + </TableCell> |
106 | 87 | )}
|
107 |
| - </Tr> |
| 88 | + </TableRow> |
108 | 89 | ))}
|
109 |
| - </Tbody> |
| 90 | + </TableBody> |
110 | 91 | </Table>
|
111 | 92 | )
|
112 | 93 | }
|
|
0 commit comments