add link to back-project page

This commit is contained in:
Barry Gitarts 2019-03-04 15:53:21 -05:00 committed by Barry G
parent ad991066d7
commit 5e52dd2ce7
3 changed files with 21 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import ContractAdmin from './ContractAdmin'
import TransferGraph from './TransfersGraph'
import Dashboard from './Dashboard'
import Project from './projects/Project'
import BackProject from './projects/BackProject'
const drawerWidth = 240
@ -88,7 +89,7 @@ const styles = theme => ({
link: {
textDecoration: 'none'
}
});
})
class PersistentDrawerLeft extends React.Component {
state = {
@ -200,6 +201,7 @@ class PersistentDrawerLeft extends React.Component {
<Route path="/funds-management" render={() => <FundsManagement open={open} />} />
<Route path="/insights" component={TransferGraph} />
<Route path="/project/:id" component={Project} />
<Route path="/back-project/:id" component={BackProject} />
</Switch>
{this.props.children}
</div>

View File

@ -0,0 +1,11 @@
import React, { useMemo, useState, useEffect } from 'react'
function BackProject({match}) {
const projectId = match.params.id
console.log({projectId})
return (
<div>Back Project Page</div>
)
}
export default BackProject

View File

@ -1,5 +1,6 @@
import web3 from 'Embark/web3'
import React, { useMemo, useState, useEffect } from 'react'
import { Link } from 'react-router-dom'
import Typography from '@material-ui/core/Typography'
import Button from '@material-ui/core/Button'
import withObservables from '@nozbe/with-observables'
@ -84,6 +85,9 @@ const styles = theme => ({
},
linearBarColorPrimary: {
backgroundColor: theme.palette.primary.main
},
link: {
textDecoration: 'none'
}
})
@ -240,7 +244,9 @@ function Project({ classes, match, profile, transfers, pledges, projectAddedEven
<span className={classes.infoText}>{projectAge}</span>
<span className={classes.subtext}>days active</span>
</div>
<Button color="primary" variant="contained" style={{ height: '50px' }}>Back this project</Button>
<Link to={`/back-project/${projectId}`} className={classes.link}>
<Button color="primary" variant="contained" style={{ height: '50px', width: '100%' }}>Back this project</Button>
</Link>
</div>
</div>
</div>