Skip to content

Commit 2a03f18

Browse files
authoredOct 23, 2020
Merge pull request #5434 from marmelab/fix-spinner-flickering
Fix Appbar custom content flickers when loading
2 parents 8fdff88 + a87bb03 commit 2a03f18

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎packages/ra-ui-materialui/src/layout/LoadingIndicator.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import classNames from 'classnames';
44
import { useSelector } from 'react-redux';
5-
import { makeStyles } from '@material-ui/core/styles';
5+
import { makeStyles, useTheme } from '@material-ui/core/styles';
66
import CircularProgress from '@material-ui/core/CircularProgress';
77
import { useRefreshWhenVisible } from 'ra-core';
88

99
import RefreshIconButton from '../button/RefreshIconButton';
1010

1111
const useStyles = makeStyles(
12-
{
12+
theme => ({
1313
loader: {
14-
margin: 14,
14+
margin: theme.spacing(2),
1515
},
1616
loadedIcon: {},
17-
},
17+
}),
1818
{ name: 'RaLoadingIndicator' }
1919
);
2020

@@ -23,12 +23,13 @@ const LoadingIndicator = props => {
2323
useRefreshWhenVisible();
2424
const loading = useSelector(state => state.admin.loading > 0);
2525
const classes = useStyles(props);
26+
const theme = useTheme();
2627
return loading ? (
2728
<CircularProgress
2829
className={classNames('app-loader', classes.loader, className)}
2930
color="inherit"
30-
size={18}
31-
thickness={5}
31+
size={theme.spacing(2)}
32+
thickness={6}
3233
{...rest}
3334
/>
3435
) : (

0 commit comments

Comments
 (0)
Please sign in to comment.