mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01: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 { useEffect } from 'react';
 | 
			
		||||
import { Box, Typography, Button, styled } from '@mui/material';
 | 
			
		||||
import { ConditionallyRender } from '../../ConditionallyRender/ConditionallyRender.tsx';
 | 
			
		||||
import { ReactComponent as ArrowRight } from 'assets/icons/arrowRight.svg';
 | 
			
		||||
@ -60,6 +61,12 @@ export const PaginationBar: React.FC<PaginationBarProps> = ({
 | 
			
		||||
    fetchNextPage,
 | 
			
		||||
    setPageLimit,
 | 
			
		||||
}) => {
 | 
			
		||||
    useEffect(() => {
 | 
			
		||||
        if (![25, 50, 75, 100].includes(pageSize)) {
 | 
			
		||||
            setPageLimit(25);
 | 
			
		||||
        }
 | 
			
		||||
    }, [pageSize]);
 | 
			
		||||
 | 
			
		||||
    const itemRange =
 | 
			
		||||
        totalItems !== undefined && pageSize && totalItems > 1
 | 
			
		||||
            ? `${pageIndex * pageSize + 1}-${Math.min(
 | 
			
		||||
 | 
			
		||||
@ -151,7 +151,7 @@ export const ProjectFeatureToggles = ({
 | 
			
		||||
        setShowFeatureDeleteDialogue,
 | 
			
		||||
    } = useRowActions(refetch, projectId, trackArchiveAction);
 | 
			
		||||
 | 
			
		||||
    const isPlaceholder = Boolean(initialLoad || (loading && total));
 | 
			
		||||
    const isPlaceholder = Boolean(initialLoad || loading);
 | 
			
		||||
 | 
			
		||||
    const [onboardingFlow, setOnboardingFlow] = useLocalStorageState<
 | 
			
		||||
        'visible' | 'closed'
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user