From 7da7a500c17a13f5acdbd608b4ff57436bb1b6bc Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Tue, 31 Oct 2023 09:51:21 +0545 Subject: [PATCH] Do not show pagination when no data present in ProjectCardPaginator --- frontend/src/components/projects/projectCardPaginator.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/projects/projectCardPaginator.js b/frontend/src/components/projects/projectCardPaginator.js index e3da5d7a0a..c5be0fd17a 100644 --- a/frontend/src/components/projects/projectCardPaginator.js +++ b/frontend/src/components/projects/projectCardPaginator.js @@ -15,7 +15,8 @@ export const ProjectCardPaginator = ({ status, pagination, fullProjectsQuery, se ); }; - if (!apiIsFetched) { + // do not show pagination when the data is being fetched or it has zero results + if (!apiIsFetched || !pagination?.total) { return null; } const activePage = (apiIsFetched && pagination?.page) || 1;