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:
parent
834ae1d8a4
commit
0f7360c1e8
@ -109,7 +109,7 @@ export const PageContent: FC<IPageContentProps> = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (disableLoading) {
|
if (disableLoading) {
|
||||||
return content;
|
return <div>{content}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -501,14 +501,23 @@ export const PaginatedProjectFeatureToggles = ({
|
|||||||
isFavoritesPinned,
|
isFavoritesPinned,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const showPaginationBar = Boolean(total && total > 25);
|
||||||
|
const style = showPaginationBar
|
||||||
|
? { borderBottomLeftRadius: 0, borderBottomRightRadius: 0 }
|
||||||
|
: {};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PageContent
|
<PageContent
|
||||||
disableLoading
|
disableLoading
|
||||||
className={styles.container}
|
className={styles.container}
|
||||||
sx={{ borderBottomLeftRadius: 0, borderBottomRightRadius: 0 }}
|
sx={style}
|
||||||
header={
|
header={
|
||||||
<div ref={headerLoadingRef}>
|
<div
|
||||||
|
ref={headerLoadingRef}
|
||||||
|
aria-busy={initialLoad}
|
||||||
|
aria-live='polite'
|
||||||
|
>
|
||||||
<PageHeader
|
<PageHeader
|
||||||
titleElement={
|
titleElement={
|
||||||
showTitle
|
showTitle
|
||||||
@ -615,7 +624,11 @@ export const PaginatedProjectFeatureToggles = ({
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div ref={bodyLoadingRef}>
|
<div
|
||||||
|
ref={bodyLoadingRef}
|
||||||
|
aria-busy={loading}
|
||||||
|
aria-live='polite'
|
||||||
|
>
|
||||||
<SearchHighlightProvider value={getSearchText(searchValue)}>
|
<SearchHighlightProvider value={getSearchText(searchValue)}>
|
||||||
<VirtualizedTable
|
<VirtualizedTable
|
||||||
rows={rows}
|
rows={rows}
|
||||||
@ -692,8 +705,10 @@ export const PaginatedProjectFeatureToggles = ({
|
|||||||
{featureToggleModals}
|
{featureToggleModals}
|
||||||
</div>
|
</div>
|
||||||
</PageContent>
|
</PageContent>
|
||||||
|
<ConditionallyRender
|
||||||
{paginationBar}
|
condition={showPaginationBar}
|
||||||
|
show={paginationBar}
|
||||||
|
/>
|
||||||
<BatchSelectionActionsBar
|
<BatchSelectionActionsBar
|
||||||
count={Object.keys(selectedRowIds).length}
|
count={Object.keys(selectedRowIds).length}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user