mirror of
https://github.com/status-im/liquid-funding.git
synced 2025-01-30 21:28:09 +00:00
create breadcrumb component
link breadcrumb back project listing
This commit is contained in:
parent
f3ba805057
commit
d752653ba4
@ -153,7 +153,6 @@ class PersistentDrawerLeft extends React.Component {
|
||||
render() {
|
||||
const { classes, theme, loading, account, enableEthereum, location: { pathname, search } } = this.props
|
||||
const { open } = this.state
|
||||
console.log(this.props)
|
||||
const isHome = pathname === "/"
|
||||
const queryParams = queryString.parse(search)
|
||||
|
||||
|
36
src/components/base/BreadCrumb.jsx
Normal file
36
src/components/base/BreadCrumb.jsx
Normal file
@ -0,0 +1,36 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import { Link } from 'react-router-dom'
|
||||
import classnames from 'classnames'
|
||||
|
||||
const styles = theme => ({
|
||||
theme,
|
||||
main: {
|
||||
color: '#939BA1'
|
||||
},
|
||||
link: {
|
||||
textDecoration: 'none',
|
||||
color: '#939BA1'
|
||||
}
|
||||
})
|
||||
|
||||
function BreadCrumb({ classes, className, trail }){
|
||||
const trailString = trail ? ` > ${trail.join(' > ')}` : ''
|
||||
return (
|
||||
<div className={classnames(classes.main, className)}>
|
||||
<Link className={classes.link} to={'/'}>
|
||||
All projects
|
||||
</Link>
|
||||
{<span>{trailString}</span>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
BreadCrumb.propTypes = {
|
||||
classes: PropTypes.object.isRequired,
|
||||
className: PropTypes.string,
|
||||
trail: PropTypes.array
|
||||
}
|
||||
|
||||
export default withStyles(styles)(BreadCrumb)
|
@ -17,6 +17,7 @@ import { convertTokenAmountUsd } from '../../utils/prices'
|
||||
import { setMediaType } from '../../utils/project'
|
||||
import MediaView from '../base/MediaView'
|
||||
import { isVideo } from '../../utils/images'
|
||||
import BreadCrumb from '../base/BreadCrumb'
|
||||
|
||||
|
||||
const { addProject } = LiquidPledging.methods
|
||||
@ -237,9 +238,10 @@ const SubmissionSection = ({ classes, history }) => {
|
||||
return (
|
||||
<form onSubmit={handleSubmit} className={classes.submissionRoot}>
|
||||
<div className={firstHalf}>
|
||||
<div className={classnames(classes.breadCrumb, fullWidth)}>
|
||||
{'All projects and delegates > Create new'}
|
||||
</div>
|
||||
<BreadCrumb
|
||||
className={fullWidth}
|
||||
trail={['Create new']}
|
||||
/>
|
||||
<StatusTextField
|
||||
className={fullWidth}
|
||||
isRequired={true}
|
||||
|
@ -20,6 +20,7 @@ import StatusTextField from '../base/TextField'
|
||||
import { getProfileById } from './queries'
|
||||
import styles from './styles/FundProject'
|
||||
import Loading from '../base/Loading'
|
||||
import BreadCrumb from '../base/BreadCrumb'
|
||||
|
||||
|
||||
const { addGiverAndDonate } = LiquidPledging.methods
|
||||
@ -93,9 +94,10 @@ const SubmissionSection = ({ classes, projectData, projectId, profileData, start
|
||||
return (
|
||||
<form onSubmit={handleSubmit} className={classes.submissionRoot}>
|
||||
{manifest && <div className={firstHalf}>
|
||||
<div className={classnames(classes.breadCrumb, fullWidth)}>
|
||||
{`All projects > ${manifest.title}`}
|
||||
</div>
|
||||
<BreadCrumb
|
||||
className={fullWidth}
|
||||
trail={[manifest.title]}
|
||||
/>
|
||||
<Typography className={classes.projectTitle} component="h2" gutterBottom>
|
||||
{manifest && manifest.title}
|
||||
</Typography>
|
||||
|
Loading…
x
Reference in New Issue
Block a user