From aabcec462c748fa2bb9219a84e6b85fb53abd9bf Mon Sep 17 00:00:00 2001 From: Nisarg Chokshi <101206240+Nisarg-Chokshi@users.noreply.github.com> Date: Tue, 1 Aug 2023 23:08:52 +0530 Subject: [PATCH] Proposal/pagination (#2559) * Update dataset pagination rendering to remove pagination in case of no content Signed-off-by: Nisarg-Chokshi * Update event pagination rendering to remove pagination in case of no content Signed-off-by: Nisarg-Chokshi * Resolved comment on the PR Signed-off-by: Nisarg-Chokshi --------- Signed-off-by: Nisarg-Chokshi --- web/src/routes/datasets/Datasets.tsx | 44 +++++++------- web/src/routes/events/Events.tsx | 86 ++++++++++++++-------------- 2 files changed, 66 insertions(+), 64 deletions(-) diff --git a/web/src/routes/datasets/Datasets.tsx b/web/src/routes/datasets/Datasets.tsx index 1eb0200822..53d6a64830 100644 --- a/web/src/routes/datasets/Datasets.tsx +++ b/web/src/routes/datasets/Datasets.tsx @@ -136,7 +136,7 @@ class Datasets extends React.Component { {i18next.t('datasets_route.empty_body')} - + ) : ( <> @@ -227,29 +227,29 @@ class Datasets extends React.Component { })} + + + this.handleClickPage('prev')} + > + + + + + this.handleClickPage('next')} + > + + + + )} - - - this.handleClickPage('prev')} - > - - - - - this.handleClickPage('next')} - > - - - - diff --git a/web/src/routes/events/Events.tsx b/web/src/routes/events/Events.tsx index b786da2fa2..1677962825 100644 --- a/web/src/routes/events/Events.tsx +++ b/web/src/routes/events/Events.tsx @@ -186,27 +186,29 @@ class Events extends React.Component { {i18next.t('events_route.title')} Page: {this.pageNavigation()} - - - this.handleClickPage('prev')} - > - - - - - this.handleClickPage('next')} - > - - - - + {events.length === 0 && ( + + + this.handleClickPage('prev')} + > + + + + + this.handleClickPage('next')} + > + + + + + )} { })} + + + this.handleClickPage('prev')} + > + + + + + this.handleClickPage('next')} + > + + + + )} - - - this.handleClickPage('prev')} - > - - - - - this.handleClickPage('next')} - > - - - -