Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate LoadingPlaceholder to Mui 5 #96

Merged
merged 1 commit into from
Nov 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
}