Skip to content
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.

Commit

Permalink
improved progressdialog
Browse files Browse the repository at this point in the history
  • Loading branch information
h0tw4t3r committed Mar 18, 2020
1 parent cc0db60 commit 93051ba
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
18 changes: 18 additions & 0 deletions src/components/MUIComponents/MUIBackdropProgress/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react'
import Backdrop from '@material-ui/core/Backdrop'
import CircularProgress from '@material-ui/core/CircularProgress'
import { makeStyles } from '@material-ui/core/styles'

const useStyles = makeStyles(theme => ({
backdrop: {
zIndex: theme.zIndex.drawer + 1
}
}))

const MUIBackdropProgress = () => (
<Backdrop className={useStyles().backdrop} open={true}>
<CircularProgress color='primary' />
</Backdrop>
)

export default MUIBackdropProgress
1 change: 1 addition & 0 deletions src/components/MUIComponents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export { default as MUIPasswordField } from './MUIPasswordField'
export { default as MUIRouterLink } from './MUIRouterLink'
export { default as MUILabeledCheckbox } from './MUILabeledCheckbox'
export { default as MUIAlertDialog } from './MUIAlertDialog'
export { default as MUIBackdropProgress } from './MUIBackdropProgress'
5 changes: 2 additions & 3 deletions src/pages/Cabinet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { connect } from 'react-redux'
import { Redirect } from 'react-router-dom'
import PropTypes from 'prop-types'
import { userActions, cabinetActions, tokensActions, alertActions } from '../../actions'
import { CircularProgress } from '@material-ui/core'
import { api } from './api'
import { MUIAlertDialog } from '../../components/MUIComponents'
import { MUIAlertDialog, MUIBackdropProgress } from '../../components/MUIComponents'

const Cabinet = ({ resource }) => {
resource.read()
Expand Down Expand Up @@ -39,7 +38,7 @@ const CabinetPage = ({
}

return (
<Suspense fallback={<CircularProgress />}>
<Suspense fallback={<MUIBackdropProgress />}>
{alert.message ? (
<MUIAlertDialog
title={alert.message}
Expand Down

0 comments on commit 93051ba

Please sign in to comment.