diff --git a/components/MyPages/Blocks/Points/EarnAndBurn/JourneyTable/Client.tsx b/components/MyPages/Blocks/Points/EarnAndBurn/JourneyTable/Client.tsx index ab286c9db..f0cc9b2ef 100644 --- a/components/MyPages/Blocks/Points/EarnAndBurn/JourneyTable/Client.tsx +++ b/components/MyPages/Blocks/Points/EarnAndBurn/JourneyTable/Client.tsx @@ -5,85 +5,14 @@ import { useState } from "react" import { trpc } from "@/lib/trpc/client" -import { ChevronRightIcon } from "@/components/Icons" import LoadingSpinner from "@/components/LoadingSpinner" import DesktopTable from "./Desktop" import MobileTable from "./Mobile" - -import styles from "../earnAndBurn.module.css" +import Pagination from "./Pagination" import { Transactions } from "@/types/components/myPages/myPage/earnAndBurn" -function PaginationButton({ - children, - isActive, - handleClick, - disabled, -}: React.PropsWithChildren<{ - disabled: boolean - isActive?: boolean - handleClick: () => void -}>) { - return ( - - ) -} - -function Pagination({ - pageCount, - isFetching, - handlePageChange, - currentPage, -}: { - pageCount: number - isFetching: boolean - handlePageChange: (page: number) => void - currentPage: number -}) { - const isOnFirstPage = currentPage === 1 - const isOnLastPage = currentPage === pageCount - return ( -
- { - handlePageChange(currentPage - 1) - }} - > - - - {[...Array(pageCount)].map((_, idx) => ( - { - handlePageChange(idx + 1) - }} - > - {idx + 1} - - ))} - { - handlePageChange(currentPage + 1) - }} - > - - -
- ) -} - export default function TransactionTable({ initialJourneyTransactions, }: { diff --git a/components/MyPages/Blocks/Points/EarnAndBurn/JourneyTable/Pagination/index.tsx b/components/MyPages/Blocks/Points/EarnAndBurn/JourneyTable/Pagination/index.tsx new file mode 100644 index 000000000..b2ce233bb --- /dev/null +++ b/components/MyPages/Blocks/Points/EarnAndBurn/JourneyTable/Pagination/index.tsx @@ -0,0 +1,72 @@ +import { ChevronRightIcon } from "@/components/Icons" + +import styles from "./pagination.module.css" + +function PaginationButton({ + children, + isActive, + handleClick, + disabled, +}: React.PropsWithChildren<{ + disabled: boolean + isActive?: boolean + handleClick: () => void +}>) { + return ( + + ) +} + +export default function Pagination({ + pageCount, + isFetching, + handlePageChange, + currentPage, +}: { + pageCount: number + isFetching: boolean + handlePageChange: (page: number) => void + currentPage: number +}) { + const isOnFirstPage = currentPage === 1 + const isOnLastPage = currentPage === pageCount + return ( +
+ { + handlePageChange(currentPage - 1) + }} + > + + + {[...Array(pageCount)].map((_, idx) => ( + { + handlePageChange(idx + 1) + }} + > + {idx + 1} + + ))} + { + handlePageChange(currentPage + 1) + }} + > + + +
+ ) +} diff --git a/components/MyPages/Blocks/Points/EarnAndBurn/earnAndBurn.module.css b/components/MyPages/Blocks/Points/EarnAndBurn/JourneyTable/Pagination/pagination.module.css similarity index 92% rename from components/MyPages/Blocks/Points/EarnAndBurn/earnAndBurn.module.css rename to components/MyPages/Blocks/Points/EarnAndBurn/JourneyTable/Pagination/pagination.module.css index 6dc2aa8e8..493e06854 100644 --- a/components/MyPages/Blocks/Points/EarnAndBurn/earnAndBurn.module.css +++ b/components/MyPages/Blocks/Points/EarnAndBurn/JourneyTable/Pagination/pagination.module.css @@ -1,8 +1,3 @@ -.container { - display: grid; - gap: var(--Spacing-x3); -} - .pagination { display: flex; justify-content: center;