| Total Complexity | 1 |
| Complexity/F | 0 |
| Lines of Code | 44 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | import React from 'react' |
||
| 2 | import PropTypes from 'prop-types' |
||
| 3 | import { makeStyles } from '@material-ui/core/styles' |
||
| 4 | import CircularProgress from '@material-ui/core/CircularProgress' |
||
| 5 | |||
| 6 | 2 | const useStyles = makeStyles(theme => ({ |
|
| 7 | root: { |
||
| 8 | display: 'flex', |
||
| 9 | width: '100vw', |
||
| 10 | height: '100vh', |
||
| 11 | alignItems: 'center', |
||
| 12 | justifyContent: 'center', |
||
| 13 | position: 'absolute', |
||
| 14 | zIndex: theme.zIndex.modal, |
||
| 15 | backgroundColor: 'rgba(0,0,0,0.7)' |
||
| 16 | }, |
||
| 17 | bottom: { |
||
| 18 | color: theme.colors.primaryBg, |
||
| 19 | animationDuration: '550ms' |
||
| 20 | } |
||
| 21 | })) |
||
| 22 | |||
| 23 | 2 | const FullScreenLoading = ({ isLoading }) => { |
|
| 24 | 2 | const classes = useStyles() |
|
| 25 | |||
| 26 | 2 | return isLoading ? ( |
|
| 27 | <div className={classes.root}> |
||
| 28 | <CircularProgress |
||
| 29 | size={52} |
||
| 30 | thickness={4} |
||
| 31 | className={classes.bottom} |
||
| 32 | variant="indeterminate" |
||
| 33 | disableShrink |
||
| 34 | /> |
||
| 35 | </div> |
||
| 36 | ) : null |
||
| 37 | } |
||
| 38 | |||
| 39 | export default FullScreenLoading |
||
| 40 | |||
| 41 | 2 | FullScreenLoading.propTypes = { |
|
| 42 | isLoading: PropTypes.bool |
||
| 43 | } |
||
| 44 |