perf: scroll page code

This commit is contained in:
archer
2025-01-13 13:40:42 +08:00
parent ec0cef09a2
commit 62bcff2ff0
14 changed files with 302 additions and 250 deletions

View File

@@ -269,8 +269,10 @@ export function useScrollPagination<
({
children,
ScrollContainerRef,
isLoading,
...props
}: {
isLoading?: boolean;
children: ReactNode;
ScrollContainerRef?: RefObject<HTMLDivElement>;
} & BoxProps) => {
@@ -302,7 +304,7 @@ export function useScrollPagination<
);
return (
<Box {...props} ref={ref} overflow={'overlay'}>
<MyBox {...props} ref={ref} overflow={'overlay'} isLoading={isLoading}>
{scrollLoadType === 'top' && total > 0 && isLoading && (
<Box mt={2} fontSize={'xs'} color={'blackAlpha.500'} textAlign={'center'}>
{t('common:common.is_requesting')}
@@ -325,7 +327,7 @@ export function useScrollPagination<
</Box>
)}
{isEmpty && EmptyTip}
</Box>
</MyBox>
);
}
);