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) {
|
||||
return content;
|
||||
return <div>{content}</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -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}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user