From d310bf3df8cf7c89989d211c78c8d244d18be8f8 Mon Sep 17 00:00:00 2001 From: QSchlegel Date: Sat, 13 Jun 2026 12:57:55 +0200 Subject: [PATCH] fix(ux): themed, non-overflowing, mobile-friendly pagination control The transactions pagination bar overflowed its card on the right and used hardcoded dark colors + a raw ); same options + reset-to-page-1 behavior. - nav: compact icon-only prev/next (h-9 w-9), muted tabular-nums page indicator; rely on Button's native disabled styling. PaginationProps is unchanged, so both call sites (transactions + DRep list) behave identically. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../common/overall-layout/pagination.tsx | 93 ++++++++++++------- 1 file changed, 57 insertions(+), 36 deletions(-) diff --git a/src/components/common/overall-layout/pagination.tsx b/src/components/common/overall-layout/pagination.tsx index 1473aa7e..1a542d94 100644 --- a/src/components/common/overall-layout/pagination.tsx +++ b/src/components/common/overall-layout/pagination.tsx @@ -1,5 +1,12 @@ import React from "react"; import { Button } from "@/components/ui/button"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; import { ChevronLeft, ChevronRight, ArrowUp, ArrowDown } from "lucide-react"; interface PaginationProps { @@ -22,73 +29,87 @@ const Pagination: React.FC = ({ setPageSize, order, setOrder, + // defaultPageSize is intentionally accepted (call-site compat) but unused. defaultPageSize = 25, maxPageSize = 100, stepSize = 25, onLastPage, }) => { + const pageSizeOptions = Array.from( + { length: maxPageSize / stepSize }, + (_, i) => (i + 1) * stepSize, + ).filter((size) => size <= maxPageSize); + return ( -
- {/* Sorting Toggle */} +
+ {/* Sort order */} - {/* Page Size Selector */} - { + setPageSize(Number(value)); setCurrentPage(1); // Reset to first page when page size changes }} > - {Array.from( - { length: maxPageSize / stepSize }, - (_, i) => (i + 1) * stepSize, - ) - .filter((size) => size <= maxPageSize) - .map((size) => ( - + + + + + {pageSizeOptions.map((size) => ( + + {size} / page + ))} - + + - {/* Pagination Controls */} -
+ {/* Navigation */} +
- Page {currentPage} + + Page {currentPage} +
); }; -export default Pagination; \ No newline at end of file +export default Pagination;