From b26fde454dcebdd458fc0f5f21f08f30a04b50fe Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Fri, 17 Apr 2026 12:26:11 -0400 Subject: [PATCH] Redesign pagination bar with button group page size selector - Records per page as a button group (12/24/48/96) with active highlight - First/prev/next/last navigation buttons - Current page number as blue badge - Showing X-Y of Z range display - Resets to page 1 when changing page size --- src/components/SharedTable.js | 54 ++++++++++-------- src/site.css | 101 ++++++++++++++++++++++++++++------ 2 files changed, 113 insertions(+), 42 deletions(-) diff --git a/src/components/SharedTable.js b/src/components/SharedTable.js index 381e44fb..19954411 100644 --- a/src/components/SharedTable.js +++ b/src/components/SharedTable.js @@ -119,33 +119,39 @@ const SharedTable = ({ -
-
- +
+
+ Show +
+ {[12, 24, 48, 96].map((size) => ( + + ))} +
+ per page
-
- - Showing {Math.min(page * pageSize, totalCount)} of {totalCount} +
+ + {Math.min((page - 1) * pageSize + 1, totalCount)}–{Math.min(page * pageSize, totalCount)} of {totalCount} -
- - Page {page} of {totalPages} - + {page} + +
diff --git a/src/site.css b/src/site.css index 26493063..9209da05 100644 --- a/src/site.css +++ b/src/site.css @@ -251,45 +251,110 @@ body { } /* Pagination */ -.paginationContainer { +.paginationBar { display: flex; justify-content: space-between; align-items: center; - padding: 15px; + padding: 12px 16px; border-top: 1px solid #eee; font-size: 13px; + background: #fafafa; } -.paginationLeft, .paginationRight { +.paginationPerPage { display: flex; align-items: center; - gap: 15px; -} - -.pagination { - display: flex; gap: 8px; - align-items: center; } -.pagination button { - padding: 6px 12px; - border: 1px solid #ddd; - background: white; - border-radius: 3px; - cursor: pointer; +.paginationLabel { + color: #999; font-size: 12px; } -.pagination button:hover:not(:disabled) { +.paginationSizeGroup { + display: flex; + border: 1px solid #ddd; + border-radius: 4px; + overflow: hidden; +} + +.paginationSizeBtn { + padding: 4px 12px; + border: none; + border-right: 1px solid #ddd; + background: #fff; + font-size: 12px; + cursor: pointer; + color: #666; +} + +.paginationSizeBtn:last-child { + border-right: none; +} + +.paginationSizeBtn:hover { background: #f0f0f0; } -.pagination button:disabled { - opacity: 0.5; +.paginationSizeBtn.active { + background: #007bff; + color: #fff; +} + +.paginationNav { + display: flex; + align-items: center; + gap: 12px; +} + +.paginationInfo { + color: #999; + font-size: 12px; +} + +.paginationButtons { + display: flex; + align-items: center; + gap: 2px; +} + +.paginationBtn { + width: 30px; + height: 30px; + display: flex; + align-items: center; + justify-content: center; + border: 1px solid #ddd; + background: #fff; + border-radius: 4px; + cursor: pointer; + font-size: 14px; + color: #333; +} + +.paginationBtn:hover:not(:disabled) { + background: #f0f0f0; +} + +.paginationBtn:disabled { + opacity: 0.3; cursor: not-allowed; } +.paginationPage { + width: 30px; + height: 30px; + display: flex; + align-items: center; + justify-content: center; + background: #007bff; + color: #fff; + border-radius: 4px; + font-size: 12px; + font-weight: 600; +} + /* Form Styles */ .formWrapper { padding: 20px;