From 0f7360c1e823e4e3168149cff63cb9ede94c2e7c Mon Sep 17 00:00:00 2001 From: Fredrik Oseberg Date: Mon, 13 Nov 2023 14:47:51 +0100 Subject: [PATCH] fix: conditionally show pagination bar --- .../common/PageContent/PageContent.tsx | 2 +- .../PaginatedProjectFeatureToggles.tsx | 25 +++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/frontend/src/component/common/PageContent/PageContent.tsx b/frontend/src/component/common/PageContent/PageContent.tsx index 4755bff0ce4d..7eb394b95384 100644 --- a/frontend/src/component/common/PageContent/PageContent.tsx +++ b/frontend/src/component/common/PageContent/PageContent.tsx @@ -109,7 +109,7 @@ export const PageContent: FC = ({ ); if (disableLoading) { - return content; + return
{content}
; } return ( diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/PaginatedProjectFeatureToggles.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/PaginatedProjectFeatureToggles.tsx index d49c0cf905de..af2c37ad4c41 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/PaginatedProjectFeatureToggles.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/PaginatedProjectFeatureToggles.tsx @@ -501,14 +501,23 @@ export const PaginatedProjectFeatureToggles = ({ isFavoritesPinned, ]); + const showPaginationBar = Boolean(total && total > 25); + const style = showPaginationBar + ? { borderBottomLeftRadius: 0, borderBottomRightRadius: 0 } + : {}; + return ( <> +
} > -
+
- - {paginationBar} +