File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
packages/ra-ui-materialui/src/list Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,11 @@ export const SimpleListLoading = (inProps: SimpleListLoadingProps) => {
2929 hasSecondaryText,
3030 hasTertiaryText,
3131 nbFakeLines = 5 ,
32+ timeout = 1000 ,
3233 ...rest
3334 } = props ;
3435
35- const oneSecondHasPassed = useTimeout ( 1000 ) ;
36+ const oneSecondHasPassed = useTimeout ( timeout ) ;
3637
3738 return oneSecondHasPassed ? (
3839 < StyledList className = { className } { ...rest } >
@@ -109,6 +110,7 @@ export interface SimpleListLoadingProps extends ListProps {
109110 hasSecondaryText ?: boolean ;
110111 hasTertiaryText ?: boolean ;
111112 nbFakeLines ?: number ;
113+ timeout ?: number ;
112114}
113115
114116declare module '@mui/material/styles' {
Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ const DatagridLoading = ({
2626 nbChildren,
2727 nbFakeLines = 5 ,
2828 size,
29+ timeout = 1000 ,
2930} : DatagridLoadingProps ) => {
30- const oneSecondHasPassed = useTimeout ( 1000 ) ;
31+ const oneSecondHasPassed = useTimeout ( timeout ) ;
3132 if ( ! oneSecondHasPassed ) return null ;
3233 return (
3334 < div className = { DatagridClasses . root } >
@@ -128,6 +129,7 @@ export interface DatagridLoadingProps {
128129 nbChildren : number ;
129130 nbFakeLines ?: number ;
130131 size ?: 'small' | 'medium' ;
132+ timeout ?: number ;
131133}
132134
133135export default memo ( DatagridLoading ) ;
Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ export const DataTableLoading = memo(function DataTableLoading({
2626 nbChildren,
2727 nbFakeLines = 5 ,
2828 size,
29+ timeout = 1000 ,
2930} : DataTableLoadingProps ) {
30- const oneSecondHasPassed = useTimeout ( 1000 ) ;
31+ const oneSecondHasPassed = useTimeout ( timeout ) ;
3132 if ( ! oneSecondHasPassed ) return null ;
3233 return (
3334 < div className = { DataTableClasses . root } >
@@ -128,4 +129,5 @@ export interface DataTableLoadingProps<RecordType extends RaRecord = any> {
128129 nbChildren : number ;
129130 nbFakeLines ?: number ;
130131 size ?: 'small' | 'medium' ;
132+ timeout ?: number ;
131133}
You can’t perform that action at this time.
0 commit comments