1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: conditionally show pagination bar

This commit is contained in:
Fredrik Oseberg 2023-11-13 14:47:51 +01:00
parent 834ae1d8a4
commit 0f7360c1e8
No known key found for this signature in database
GPG Key ID: 816A423246CADD4E
2 changed files with 21 additions and 6 deletions

View File

@ -109,7 +109,7 @@ export const PageContent: FC<IPageContentProps> = ({
);
if (disableLoading) {
return content;
return <div>{content}</div>;
}
return (

View File

@ -501,14 +501,23 @@ export const PaginatedProjectFeatureToggles = ({
isFavoritesPinned,
]);
const showPaginationBar = Boolean(total && total > 25);
const style = showPaginationBar
? { borderBottomLeftRadius: 0, borderBottomRightRadius: 0 }
: {};
return (
<>
<PageContent
disableLoading
className={styles.container}
sx={{ borderBottomLeftRadius: 0, borderBottomRightRadius: 0 }}
sx={style}
header={
<div ref={headerLoadingRef}>
<div
ref={headerLoadingRef}
aria-busy={initialLoad}
aria-live='polite'
>
<PageHeader
titleElement={
showTitle
@ -615,7 +624,11 @@ export const PaginatedProjectFeatureToggles = ({
</div>
}
>
<div ref={bodyLoadingRef}>
<div
ref={bodyLoadingRef}
aria-busy={loading}
aria-live='polite'
>
<SearchHighlightProvider value={getSearchText(searchValue)}>
<VirtualizedTable
rows={rows}
@ -692,8 +705,10 @@ export const PaginatedProjectFeatureToggles = ({
{featureToggleModals}
</div>
</PageContent>
{paginationBar}
<ConditionallyRender
condition={showPaginationBar}
show={paginationBar}
/>
<BatchSelectionActionsBar
count={Object.keys(selectedRowIds).length}
>