Skip to content

Commit

Permalink
fix: replace MUI with ui-core components - loading spinner (TECH-324) (
Browse files Browse the repository at this point in the history
…#814)

Replaces the MUI loading spinner with the equivalent component from ui-core. https://jira.dhis2.org/browse/TECH-324
Also removed the duplicate LoadingMask file.
  • Loading branch information
martinkrulltott authored Mar 31, 2020
1 parent 3240092 commit 8eeb16a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 61 deletions.
33 changes: 0 additions & 33 deletions packages/app/src/components/Visualization/LoadingMask.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/app/src/components/Visualization/Visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
NoDataOrDataElementGroupSetError,
CombinationDEGSRRError,
} from '../../modules/error'
import LoadingMask from './LoadingMask'
import LoadingMask from '../../widgets/LoadingMask'

export class Visualization extends Component {
constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '../Visualization'
import StartScreen from '../StartScreen'
import { GenericServerError } from '../../../modules/error'
import LoadingMask from '../LoadingMask'
import LoadingMask from '../../../widgets/LoadingMask'

jest.mock('@dhis2/data-visualizer-plugin', () => () => <div />)

Expand Down
32 changes: 6 additions & 26 deletions packages/app/src/widgets/LoadingMask.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
import React from 'react'
import PropTypes from 'prop-types'
import { withStyles } from '@material-ui/core/styles'
import CircularProgress from '@material-ui/core/CircularProgress'
import styles from './styles/LoadingMask.module.css'
import { CircularLoader } from '@dhis2/ui-core'

const styles = theme => ({
progress: {
margin: theme.spacing.unit * 2,
maxWidth: 200,
textAlign: 'center',
alignSelf: 'center',
},
outer: {
display: 'flex',
justifyContent: 'center',
height: '100%',
},
})

function CircularIndeterminate(props) {
const { classes } = props
function LoadingMask() {
return (
<div className={classes.outer}>
<CircularProgress className={classes.progress} />
<div className={styles.outer}>
<CircularLoader className={styles.progress} />
</div>
)
}

CircularIndeterminate.propTypes = {
classes: PropTypes.object.isRequired,
}

export default withStyles(styles)(CircularIndeterminate)
export default LoadingMask
12 changes: 12 additions & 0 deletions packages/app/src/widgets/styles/LoadingMask.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.progress {
margin: var(--spacers-dp12);
max-width: 200;
text-align: center;
align-self: center;
}

.outer {
display: flex;
justify-content: center;
height: 100%;
}

0 comments on commit 8eeb16a

Please sign in to comment.