add progress bar

This commit is contained in:
Barry Gitarts 2019-02-12 12:50:14 -05:00 committed by Barry G
parent 44c7e9d373
commit fd4a5ae3db
2 changed files with 26 additions and 7 deletions

View File

@ -199,7 +199,7 @@ class PersistentDrawerLeft extends React.Component {
<Route path="/admin" component={ContractAdmin} /> <Route path="/admin" component={ContractAdmin} />
<Route path="/funds-management" render={() => <FundsManagement open={open} />} /> <Route path="/funds-management" render={() => <FundsManagement open={open} />} />
<Route path="/insights" component={TransferGraph} /> <Route path="/insights" component={TransferGraph} />
<Route path="/project" component={Project} /> <Route path="/project/:id" component={Project} />
</Switch> </Switch>
{this.props.children} {this.props.children}
</div> </div>

View File

@ -7,6 +7,7 @@ import CardMedia from '@material-ui/core/CardMedia'
import CardContent from '@material-ui/core/CardContent' import CardContent from '@material-ui/core/CardContent'
import CardActions from '@material-ui/core/CardActions' import CardActions from '@material-ui/core/CardActions'
import CardActionArea from '@material-ui/core/CardActionArea' import CardActionArea from '@material-ui/core/CardActionArea'
import LinearProgress from '@material-ui/core/LinearProgress'
import Avatar from '@material-ui/core/Avatar' import Avatar from '@material-ui/core/Avatar'
import { withStyles } from '@material-ui/core/styles' import { withStyles } from '@material-ui/core/styles'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
@ -54,7 +55,7 @@ const styles = theme => ({
}, },
infoBox: { infoBox: {
display: 'grid', display: 'grid',
gridTemplateRows: '2.5rem 2.5rem 2.5rem 2.5rem', gridTemplateRows: '0rem 2.5rem 2.5rem 2.5rem',
gridRowGap: '2rem' gridRowGap: '2rem'
}, },
infoBoxSection: { infoBoxSection: {
@ -64,19 +65,28 @@ const styles = theme => ({
infoText: { infoText: {
fontSize: '2rem' fontSize: '2rem'
}, },
raisedAmount: {
fontSize: '2em',
color: theme.palette.primary.main
},
subtext: { subtext: {
...theme.typography.caption, ...theme.typography.caption,
fontSize: '1rem' fontSize: '1rem'
},
linearColorPrimary: {
backgroundColor: '#00000014',
},
linearBarColorPrimary: {
backgroundColor: theme.palette.primary.main
} }
}) })
function Project({ classes }) { function Project({ classes, match }) {
const projectId = match.params.id
return ( return (
<div className={classes.root}> <div className={classes.root}>
<div className={classes.creator}> <div className={classes.creator}>
<Avatar> <Avatar src="https://material-ui.com/static/images/avatar/1.jpg" />
R
</Avatar>
<Typography className={classes.creatorName}>By Creator Name</Typography> <Typography className={classes.creatorName}>By Creator Name</Typography>
</div> </div>
<div> <div>
@ -97,8 +107,16 @@ function Project({ classes }) {
/> />
<div className={classes.infoBox}> <div className={classes.infoBox}>
<LinearProgress
classes={{
colorPrimary: classes.linearColorPrimary,
barColorPrimary: classes.linearBarColorPrimary,
}}
variant="determinate"
value={30}
/>
<div className={classes.infoBoxSection}> <div className={classes.infoBoxSection}>
<span className={classes.infoText}> <span className={classes.raisedAmount}>
$13,412 $13,412
</span> </span>
<span className={classes.subtext}>pledged of $48,894 goal</span> <span className={classes.subtext}>pledged of $48,894 goal</span>
@ -120,6 +138,7 @@ function Project({ classes }) {
Project.propTypes = { Project.propTypes = {
classes: PropTypes.object.isRequired, classes: PropTypes.object.isRequired,
match: PropTypes.object
} }
export default withStyles(styles)(Project) export default withStyles(styles)(Project)