Skip to content

Commit

Permalink
migrate LoadingPlaceholder to Mui 5 (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriaMoradi authored Nov 17, 2021
1 parent 70febec commit cc1d945
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/components/util/LoadingPlaceholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

import React from 'react';
import makeStyles from '@mui/styles/makeStyles';
import CircularProgress from '@mui/material/CircularProgress';

const useStyles = makeStyles({
loading: {
margin: '10px auto',
display: 'flex',
justifyContent: 'center',
},
});
import { Box } from '@mui/system';

interface IProps {
shouldRender?: boolean | (() => boolean)
Expand All @@ -30,7 +22,6 @@ export default function LoadingPlaceholder(props: IProps) {
const {
children, shouldRender, component, componentProps,
} = props;
const classes = useStyles();

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

return (
<div className={classes.loading}>
<Box sx={{
margin: '10px auto',
display: 'flex',
justifyContent: 'center',
}}
>
<CircularProgress thickness={5} />
</div>
</Box>
);
}

0 comments on commit cc1d945

Please sign in to comment.