feat(back-project): add message about needing a delegate to back

This commit is contained in:
Jonathan Rainville 2019-04-03 15:43:49 -04:00 committed by Barry G
parent 9b0594533f
commit 776d0834a5
4 changed files with 11689 additions and 12458 deletions

View File

@ -1,11 +1,7 @@
import React, { createRef } from 'react'
import { Formik } from 'formik'
import LiquidPledging from 'Embark/contracts/LiquidPledging'
import Button from '@material-ui/core/Button'
import MenuItem from '@material-ui/core/MenuItem'
import TextField from '@material-ui/core/TextField'
import Snackbar from '@material-ui/core/Snackbar'
import InputAdornment from '@material-ui/core/InputAdornment'
import {TextField, Button, MenuItem, Snackbar, InputAdornment} from '@material-ui/core'
import CloudUpload from '@material-ui/icons/CloudUpload'
import web3 from 'Embark/web3'
import { MySnackbarContentWrapper } from './base/SnackBars'

View File

@ -6,10 +6,7 @@ import { Q } from '@nozbe/watermelondb'
import { withDatabase } from '@nozbe/watermelondb/DatabaseProvider'
import { withStyles } from '@material-ui/core/styles'
import { useProjectData, useProfileData } from './hooks'
import Button from '@material-ui/core/Button'
import Divider from '@material-ui/core/Divider'
import TextField from '@material-ui/core/TextField'
import MenuItem from '@material-ui/core/MenuItem'
import {TextField, Button, MenuItem, Divider, Typography, Link} from '@material-ui/core'
import { toEther, toWei } from '../../utils/conversions'
import { getTokenLabel } from '../../utils/currencies'
@ -100,11 +97,16 @@ const SubmissionSection = ({ classes, profiles, delegatePledges, projectId, open
status
}) => {
const filteredPledges = values.delegateProfile ? delegatePledges.filter(
d => d.profile.id == values.delegateProfile.id && d.pledgeData.amount != '0' && d.pledgeData.pledgeState == 0 && d.pledgeData.intendedProject == 0
d => d.profile.id === values.delegateProfile.id && d.pledgeData.amount !== '0' && d.pledgeData.pledgeState === 0 && d.pledgeData.intendedProject === 0
) : null
console.log({filteredPledges})
return (
<form onSubmit={handleSubmit} className={classes.submissionRoot}>
{profiles && profiles.length === 0 &&
<Typography color="error">
Please create a Delegate profile before backing -
<Link href="/#/funds-management"> Delegate creation page</Link>
</Typography>}
<TextField
className={classes.textField}
id="delegateProfile"
@ -116,6 +118,7 @@ const SubmissionSection = ({ classes, profiles, delegatePledges, projectId, open
variant="outlined"
onChange={handleChange}
onBlur={handleBlur}
disabled={!profiles || profiles.length === 0}
value={values.delegateProfile || ''}
>
{profiles && profiles.map(profile => (

24127
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -67,6 +67,7 @@
"cytoscape": "^3.3.0",
"cytoscape-cose-bilkent": "^4.0.0",
"cytoscape-dagre": "^2.2.2",
"embark": "4.0.0-alpha.2",
"eslint": "^5.9.0",
"eth-contract-class": "^0.0.12",
"formik": "^1.3.2",