From 82011af6ed5fe3c979adcd24eb61baac77b519f9 Mon Sep 17 00:00:00 2001 From: Nicolas Inchauspe Date: Tue, 25 Jul 2023 12:39:48 +0200 Subject: [PATCH] Fix and improvement on the pagination for tracked table in the new UI PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9890 GitOrigin-RevId: ff1bb64321721718378de6447be9c9cc98e34c32 --- .../components/PageSizeDropdown.tsx | 19 ++- .../hooks/usePaginatedSearchableList.test.ts | 152 ++++++++++++++++++ .../hooks/usePaginatedSearchableList.tsx | 20 ++- 3 files changed, 185 insertions(+), 6 deletions(-) create mode 100644 frontend/libs/console/legacy-ce/src/lib/features/Data/TrackResources/hooks/usePaginatedSearchableList.test.ts diff --git a/frontend/libs/console/legacy-ce/src/lib/features/Data/TrackResources/components/PageSizeDropdown.tsx b/frontend/libs/console/legacy-ce/src/lib/features/Data/TrackResources/components/PageSizeDropdown.tsx index efcff73423d..5fb01cd0da4 100644 --- a/frontend/libs/console/legacy-ce/src/lib/features/Data/TrackResources/components/PageSizeDropdown.tsx +++ b/frontend/libs/console/legacy-ce/src/lib/features/Data/TrackResources/components/PageSizeDropdown.tsx @@ -1,7 +1,12 @@ import React from 'react'; import { Button } from '../../../../new-components/Button'; import { DEFAULT_PAGE_SIZES } from '../constants'; -import { FaAngleLeft, FaAngleRight } from 'react-icons/fa'; +import { + FaAngleDoubleLeft, + FaAngleDoubleRight, + FaAngleLeft, + FaAngleRight, +} from 'react-icons/fa'; import { PaginatedSearchableListProps } from '../hooks/usePaginatedSearchableList'; export const PageSizeDropdown = ({ @@ -9,6 +14,8 @@ export const PageSizeDropdown = ({ pageSize, decrementPage, incrementPage, + goToFirstPage, + goToLastPage, setPageSize, dataSize, totalPages, @@ -17,6 +24,11 @@ export const PageSizeDropdown = ({ Page {pageNumber} of {totalPages} +