mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-19 17:52:45 +02:00
fix: pagination limit and placeholder (#10533)
This commit is contained in:
parent
ac11af8c05
commit
f375ae4694
@ -1,4 +1,5 @@
|
|||||||
import type React from 'react';
|
import type React from 'react';
|
||||||
|
import { useEffect } from 'react';
|
||||||
import { Box, Typography, Button, styled } from '@mui/material';
|
import { Box, Typography, Button, styled } from '@mui/material';
|
||||||
import { ConditionallyRender } from '../../ConditionallyRender/ConditionallyRender.tsx';
|
import { ConditionallyRender } from '../../ConditionallyRender/ConditionallyRender.tsx';
|
||||||
import { ReactComponent as ArrowRight } from 'assets/icons/arrowRight.svg';
|
import { ReactComponent as ArrowRight } from 'assets/icons/arrowRight.svg';
|
||||||
@ -60,6 +61,12 @@ export const PaginationBar: React.FC<PaginationBarProps> = ({
|
|||||||
fetchNextPage,
|
fetchNextPage,
|
||||||
setPageLimit,
|
setPageLimit,
|
||||||
}) => {
|
}) => {
|
||||||
|
useEffect(() => {
|
||||||
|
if (![25, 50, 75, 100].includes(pageSize)) {
|
||||||
|
setPageLimit(25);
|
||||||
|
}
|
||||||
|
}, [pageSize]);
|
||||||
|
|
||||||
const itemRange =
|
const itemRange =
|
||||||
totalItems !== undefined && pageSize && totalItems > 1
|
totalItems !== undefined && pageSize && totalItems > 1
|
||||||
? `${pageIndex * pageSize + 1}-${Math.min(
|
? `${pageIndex * pageSize + 1}-${Math.min(
|
||||||
|
@ -151,7 +151,7 @@ export const ProjectFeatureToggles = ({
|
|||||||
setShowFeatureDeleteDialogue,
|
setShowFeatureDeleteDialogue,
|
||||||
} = useRowActions(refetch, projectId, trackArchiveAction);
|
} = useRowActions(refetch, projectId, trackArchiveAction);
|
||||||
|
|
||||||
const isPlaceholder = Boolean(initialLoad || (loading && total));
|
const isPlaceholder = Boolean(initialLoad || loading);
|
||||||
|
|
||||||
const [onboardingFlow, setOnboardingFlow] = useLocalStorageState<
|
const [onboardingFlow, setOnboardingFlow] = useLocalStorageState<
|
||||||
'visible' | 'closed'
|
'visible' | 'closed'
|
||||||
|
Loading…
Reference in New Issue
Block a user