Refactor LinearProgress
This commit is contained in:
parent
661653f561
commit
3387d94ea4
2 changed files with 16 additions and 10 deletions
|
@ -1,6 +1,10 @@
|
|||
import { Box, LinearProgress } from '@mui/material';
|
||||
|
||||
import styles from './styles';
|
||||
|
||||
function LoadingIndicator({ isLoading }) {
|
||||
const { box, linearProgress } = styles;
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<Box sx={box}>
|
||||
|
@ -10,14 +14,4 @@ function LoadingIndicator({ isLoading }) {
|
|||
}
|
||||
}
|
||||
|
||||
const box = {
|
||||
width: '100%',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
};
|
||||
|
||||
const linearProgress = {
|
||||
height: '7px',
|
||||
};
|
||||
|
||||
export default LoadingIndicator;
|
12
src/components/LoadingIndicator/styles.js
Normal file
12
src/components/LoadingIndicator/styles.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
const box = {
|
||||
width: '100%',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
};
|
||||
|
||||
const linearProgress = {
|
||||
height: '7px',
|
||||
};
|
||||
|
||||
const styles = { box, linearProgress };
|
||||
export default styles;
|
Loading…
Reference in a new issue