From 6748d5ff7e3c206767dfa7571531d2758cbaea2c Mon Sep 17 00:00:00 2001 From: Jennifer Kirsch Date: Wed, 4 Dec 2024 15:22:15 +0100 Subject: [PATCH] Add second pagination --- src/js/components/Pagination.tsx | 5 +++-- src/js/components/PointBar.tsx | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/js/components/Pagination.tsx b/src/js/components/Pagination.tsx index cb1f87b..a2834fa 100644 --- a/src/js/components/Pagination.tsx +++ b/src/js/components/Pagination.tsx @@ -11,6 +11,7 @@ type PaginationProps = { setEntriesPerPage: React.Dispatch> | ((page: number) => void), entryCount: number, localStrings: LocalStrings, + c: number, } const Pagination = React.memo((props: PaginationProps) => { @@ -36,7 +37,7 @@ const Pagination = React.memo((props: PaginationProps) => {
- + {localStrings.showing} {entriesPerPage * (page - 1) + 1}-{mostEntries > entryCount ? entryCount : mostEntries} {localStrings.of} {entryCount}.
; diff --git a/src/js/components/PointBar.tsx b/src/js/components/PointBar.tsx index 5286e3c..d9c96f9 100644 --- a/src/js/components/PointBar.tsx +++ b/src/js/components/PointBar.tsx @@ -53,6 +53,13 @@ const PointBar = (props: PointBarProps) => { }, [page, displayPoints, entriesPerPage]); return <> + {paginatedPoints.map((point, index) => )} @@ -62,7 +69,8 @@ const PointBar = (props: PointBarProps) => { entriesPerPage={props.entriesPerPage ?? entriesPerPage} setEntriesPerPage={props.setEntriesPerPage ?? setEntriesPerPage} entryCount={props.totalCount ?? displayPoints.length} - localStrings={localStrings}/> + localStrings={localStrings} + c={2}/> ; };