Passed
Push — master ( 4b5d2d...8d3c4a )
by Huu-Phat
06:03 queued 02:06
created

cms/src/core/components/FullScreenLoading.js   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 44
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 37
mnd 1
bc 1
fnc 0
dl 0
loc 44
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 10
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