add spinner

This commit is contained in:
Barry Gitarts 2019-09-24 07:48:01 -04:00 committed by Barry G
parent bd65e9f8fd
commit 0a830ca0e3
2 changed files with 17 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import classnames from 'classnames'
import { useQuery } from '@apollo/react-hooks' import { useQuery } from '@apollo/react-hooks'
import LiquidPledging from '../../embarkArtifacts/contracts/LiquidPledging' import LiquidPledging from '../../embarkArtifacts/contracts/LiquidPledging'
import Button from '@material-ui/core/Button' import Button from '@material-ui/core/Button'
import CircularProgress from '@material-ui/core/CircularProgress'
import Typography from '@material-ui/core/Typography' import Typography from '@material-ui/core/Typography'
import { FundingContext } from '../../context' import { FundingContext } from '../../context'
import TextDisplay from '../base/TextDisplay' import TextDisplay from '../base/TextDisplay'
@ -240,7 +241,12 @@ const SubmissionSection = ({ classes, projectData, projectId, profileData, start
/> />
<div className={classes.amountText}>{getTokenLabel(manifest.goalToken)}</div> <div className={classes.amountText}>{getTokenLabel(manifest.goalToken)}</div>
</div>} </div>}
<Button disabled={activeStep >= IS_SUBMITTED} type="submit" color="primary" variant="contained" className={classnames(classes.formButton)}>{buttonText[activeStep]}</Button> <Button disabled={activeStep >= IS_SUBMITTED} type="submit" color="primary" variant="contained" className={classnames(classes.formButton)}>
<div className={classes.buttonContent}>
<CircularProgress className={classes.progress} size={24} disableShrink />
{buttonText[activeStep]}
</div>
</Button>
<FundStepper steps={STEPS} activeStep={activeStep} /> <FundStepper steps={STEPS} activeStep={activeStep} />
</div>} </div>}
</form> </form>

View File

@ -49,6 +49,10 @@ const styles = theme => ({
gridColumnStart: 1, gridColumnStart: 1,
gridColumnEnd: 13 gridColumnEnd: 13
}, },
progress: {
color: 'white',
animationDuration: '350ms'
},
submissionRoot: { submissionRoot: {
display: 'grid', display: 'grid',
gridTemplateColumns: 'repeat(12, [col] 1fr)', gridTemplateColumns: 'repeat(12, [col] 1fr)',
@ -76,6 +80,12 @@ const styles = theme => ({
marginTop: '1.5rem', marginTop: '1.5rem',
borderRadius: '8px' borderRadius: '8px'
}, },
buttonContent: {
display: 'flex',
justifyContent: 'space-evenly',
alignItems: 'center',
width: '50%'
},
textField: { textField: {
gridColumnStart: '1', gridColumnStart: '1',
gridColumnEnd: '13' gridColumnEnd: '13'