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 { Box, LinearProgress } from '@mui/material';
|
||||||
|
|
||||||
|
import styles from './styles';
|
||||||
|
|
||||||
function LoadingIndicator({ isLoading }) {
|
function LoadingIndicator({ isLoading }) {
|
||||||
|
const { box, linearProgress } = styles;
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<Box sx={box}>
|
<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;
|
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