Skip to content

Commit cc1d945

Browse files
authored
migrate LoadingPlaceholder to Mui 5 (#96)
1 parent 70febec commit cc1d945

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/components/util/LoadingPlaceholder.tsx

+8-12
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@
88
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
99

1010
import React from 'react';
11-
import makeStyles from '@mui/styles/makeStyles';
1211
import CircularProgress from '@mui/material/CircularProgress';
13-
14-
const useStyles = makeStyles({
15-
loading: {
16-
margin: '10px auto',
17-
display: 'flex',
18-
justifyContent: 'center',
19-
},
20-
});
12+
import { Box } from '@mui/system';
2113

2214
interface IProps {
2315
shouldRender?: boolean | (() => boolean)
@@ -30,7 +22,6 @@ export default function LoadingPlaceholder(props: IProps) {
3022
const {
3123
children, shouldRender, component, componentProps,
3224
} = props;
33-
const classes = useStyles();
3425

3526
let condition = true;
3627
if (shouldRender !== undefined) {
@@ -52,8 +43,13 @@ export default function LoadingPlaceholder(props: IProps) {
5243
}
5344

5445
return (
55-
<div className={classes.loading}>
46+
<Box sx={{
47+
margin: '10px auto',
48+
display: 'flex',
49+
justifyContent: 'center',
50+
}}
51+
>
5652
<CircularProgress thickness={5} />
57-
</div>
53+
</Box>
5854
);
5955
}

0 commit comments

Comments
 (0)