mirror of
https://github.com/status-im/liquid-funding.git
synced 2025-01-11 12:04:21 +00:00
add input field to fund
This commit is contained in:
parent
b664756f98
commit
ab33e96ab0
@ -87,6 +87,7 @@ function Input({
|
|||||||
isRequired,
|
isRequired,
|
||||||
endAdornment,
|
endAdornment,
|
||||||
InputProps,
|
InputProps,
|
||||||
|
inputClass,
|
||||||
label,
|
label,
|
||||||
bottomRightLabel,
|
bottomRightLabel,
|
||||||
bottomLeftLabel,
|
bottomLeftLabel,
|
||||||
@ -105,7 +106,7 @@ function Input({
|
|||||||
const bottomRight = bottomRightLabel ? renderLabel(classnames(classes.formLabel, classes.bottomRight), idFor, bottomRightLabel) : null
|
const bottomRight = bottomRightLabel ? renderLabel(classnames(classes.formLabel, classes.bottomRight), idFor, bottomRightLabel) : null
|
||||||
return (
|
return (
|
||||||
<FormControl
|
<FormControl
|
||||||
className={classnames(classes.margin, classes.container, className)}
|
className={classnames(classes.container, className)}
|
||||||
>
|
>
|
||||||
{ labelForm }
|
{ labelForm }
|
||||||
{ topRightLabel }
|
{ topRightLabel }
|
||||||
@ -118,7 +119,7 @@ function Input({
|
|||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
classes={{
|
classes={{
|
||||||
root: multiline ? classes.multi : classes.root,
|
root: multiline ? classes.multi : classes.root,
|
||||||
input: classes.input,
|
input: classnames(classes.input, inputClass),
|
||||||
}}
|
}}
|
||||||
onBlur={onBlur}
|
onBlur={onBlur}
|
||||||
value={value}
|
value={value}
|
||||||
|
@ -20,6 +20,7 @@ import { useProjectData } from './hooks'
|
|||||||
import { getNumberOfBackers, getMediaType, getMediaSrc } from '../../utils/project'
|
import { getNumberOfBackers, getMediaType, getMediaSrc } from '../../utils/project'
|
||||||
import { getDateCreated, convertToHours } from '../../utils/dates'
|
import { getDateCreated, convertToHours } from '../../utils/dates'
|
||||||
import MediaView from '../base/MediaView'
|
import MediaView from '../base/MediaView'
|
||||||
|
import StatusTextField from '../base/TextField'
|
||||||
|
|
||||||
const { addProject } = LiquidPledging.methods
|
const { addProject } = LiquidPledging.methods
|
||||||
|
|
||||||
@ -33,6 +34,12 @@ const styles = theme => ({
|
|||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
color: '#4360DF'
|
color: '#4360DF'
|
||||||
},
|
},
|
||||||
|
amount: {
|
||||||
|
marginTop: '3rem'
|
||||||
|
},
|
||||||
|
amountInput: {
|
||||||
|
textAlign: 'right'
|
||||||
|
},
|
||||||
root: {
|
root: {
|
||||||
display: 'grid',
|
display: 'grid',
|
||||||
gridTemplateColumns: 'repeat(12, [col] 1fr)',
|
gridTemplateColumns: 'repeat(12, [col] 1fr)',
|
||||||
@ -223,7 +230,7 @@ const SubmissionSection = ({ classes, history, projectData, projectId, pledges,
|
|||||||
return (
|
return (
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={{
|
initialValues={{
|
||||||
title: '',
|
amount: '0',
|
||||||
subtitle: '',
|
subtitle: '',
|
||||||
creator: '',
|
creator: '',
|
||||||
repo: '',
|
repo: '',
|
||||||
@ -275,6 +282,7 @@ const SubmissionSection = ({ classes, history, projectData, projectId, pledges,
|
|||||||
isSubmitting
|
isSubmitting
|
||||||
}) => {
|
}) => {
|
||||||
const { firstHalf, secondHalf, fullWidth } = classes
|
const { firstHalf, secondHalf, fullWidth } = classes
|
||||||
|
const usdValue = manifest ? convertTokenAmountUsd(manifest.goalToken, values.amount, prices) : 0
|
||||||
//start project view
|
//start project view
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -331,6 +339,18 @@ const SubmissionSection = ({ classes, history, projectData, projectId, pledges,
|
|||||||
<Typography className={classnames(classes.fullWidth, classes.usdText)}>
|
<Typography className={classnames(classes.fullWidth, classes.usdText)}>
|
||||||
{`${totalPledged ? convertTokenAmountUsd(manifest.goalToken, totalPledged, prices) : '$0'} of ${convertTokenAmountUsd(manifest.goalToken, manifest.goal, prices)} USD`}
|
{`${totalPledged ? convertTokenAmountUsd(manifest.goalToken, totalPledged, prices) : '$0'} of ${convertTokenAmountUsd(manifest.goalToken, manifest.goal, prices)} USD`}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
<StatusTextField
|
||||||
|
className={classnames(fullWidth, classes.amount)}
|
||||||
|
inputClass={classes.amountInput}
|
||||||
|
isRequired={true}
|
||||||
|
idFor="amount"
|
||||||
|
name="amount"
|
||||||
|
placeholder="Enter amount"
|
||||||
|
bottomRightLabel={usdValue}
|
||||||
|
onChange={handleChange}
|
||||||
|
onBlur={handleBlur}
|
||||||
|
value={values.amount || ''}
|
||||||
|
/>
|
||||||
<Button type="submit" color="primary" variant="contained" className={classnames(classes.formButton)}>{isSubmitting ? 'Ethereum Submission In Progress' : 'Fund'}</Button>
|
<Button type="submit" color="primary" variant="contained" className={classnames(classes.formButton)}>{isSubmitting ? 'Ethereum Submission In Progress' : 'Fund'}</Button>
|
||||||
<CurrencySelect
|
<CurrencySelect
|
||||||
className={fullWidth}
|
className={fullWidth}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user