From 26703bfb7488104a3eeae0634881093b5675677a Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 20 Oct 2023 21:16:07 +0100 Subject: [PATCH] make pagination better --- src/components/Pagination.tsx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/components/Pagination.tsx b/src/components/Pagination.tsx index c0e95a5..0aca029 100644 --- a/src/components/Pagination.tsx +++ b/src/components/Pagination.tsx @@ -36,6 +36,21 @@ export default function Pagination(props: PaginationProps) { )} + + {currentPage !== 1 && currentPage - 2 > 1 && ( + <> +
  • + +
  • +

    ...

    + + )} + {pageNumbers.map((pageNumber) => (
  • ))} + + {currentPage !== totalPages && currentPage + 2 < totalPages && ( + <> +

    ...

    + +
  • + +
  • + + )} + {currentPage < totalPages && (