|
1 | | -import { Box, Button, Flex, Text } from "@livepeer/design-system"; |
2 | | -import { ArrowLeftIcon, ArrowRightIcon } from "@radix-ui/react-icons"; |
| 1 | +import Pagination from "@components/Table/Pagination"; |
| 2 | +import { Box, Text } from "@livepeer/design-system"; |
3 | 3 | import React from "react"; |
4 | 4 |
|
5 | 5 | import { VoteTableProps } from "./DesktopVoteTable"; |
@@ -44,44 +44,16 @@ export const MobileVoteCards: React.FC<VoteTableProps> = (props) => { |
44 | 44 |
|
45 | 45 | {/* Pagination */} |
46 | 46 | {totalPages > 1 && ( |
47 | | - <Flex |
48 | | - css={{ |
49 | | - marginTop: "$4", |
50 | | - justifyContent: "center", |
51 | | - alignItems: "center", |
52 | | - gap: "$4", |
53 | | - }} |
54 | | - > |
55 | | - <Button |
56 | | - size="1" |
57 | | - disabled={currentPage === 1} |
58 | | - onClick={() => onPageChange?.(currentPage - 1)} |
59 | | - css={{ |
60 | | - display: "flex", |
61 | | - alignItems: "center", |
62 | | - gap: "$1", |
63 | | - color: currentPage === 1 ? "$neutral8" : "$white", |
64 | | - }} |
65 | | - > |
66 | | - <ArrowLeftIcon /> Previous |
67 | | - </Button> |
68 | | - <Text css={{ fontSize: "$1", color: "$neutral11" }}> |
69 | | - Page {currentPage} of {totalPages} |
70 | | - </Text> |
71 | | - <Button |
72 | | - size="1" |
73 | | - disabled={currentPage === totalPages} |
74 | | - onClick={() => onPageChange?.(currentPage + 1)} |
75 | | - css={{ |
76 | | - display: "flex", |
77 | | - alignItems: "center", |
78 | | - gap: "$1", |
79 | | - color: currentPage === totalPages ? "$neutral8" : "$white", |
80 | | - }} |
81 | | - > |
82 | | - Next <ArrowRightIcon /> |
83 | | - </Button> |
84 | | - </Flex> |
| 47 | + <Pagination |
| 48 | + currentPage={currentPage} |
| 49 | + totalPages={totalPages} |
| 50 | + canPrevious={currentPage > 1} |
| 51 | + canNext={currentPage < totalPages} |
| 52 | + onPrevious={() => onPageChange?.(currentPage - 1)} |
| 53 | + onNext={() => onPageChange?.(currentPage + 1)} |
| 54 | + textSize="1" |
| 55 | + css={{ marginTop: "$4", paddingTop: 0, paddingBottom: 0 }} |
| 56 | + /> |
85 | 57 | )} |
86 | 58 | </Box> |
87 | 59 | ); |
|
0 commit comments