mirror of
https://github.com/status-im/liquid-funding.git
synced 2025-02-04 15:44:44 +00:00
use CurrencySelect in CreateProject
This commit is contained in:
parent
1351f31fc1
commit
a09b5b85f8
@ -16,7 +16,9 @@ CurrencySelect.propTypes = {
|
|||||||
onBlur: PropTypes.func.isRequired,
|
onBlur: PropTypes.func.isRequired,
|
||||||
value: PropTypes.string,
|
value: PropTypes.string,
|
||||||
showBalances: PropTypes.bool,
|
showBalances: PropTypes.bool,
|
||||||
enableToggles: PropTypes.bool
|
enableToggles: PropTypes.bool,
|
||||||
|
className: PropTypes.string,
|
||||||
|
InputProps: PropTypes.object
|
||||||
}
|
}
|
||||||
|
|
||||||
function CurrencySelect({
|
function CurrencySelect({
|
||||||
@ -26,7 +28,9 @@ function CurrencySelect({
|
|||||||
onBlur,
|
onBlur,
|
||||||
value,
|
value,
|
||||||
showBalances,
|
showBalances,
|
||||||
enableToggles
|
enableToggles,
|
||||||
|
className,
|
||||||
|
InputProps
|
||||||
}) {
|
}) {
|
||||||
const context = useContext(FundingContext)
|
const context = useContext(FundingContext)
|
||||||
const { account } = context
|
const { account } = context
|
||||||
@ -69,6 +73,8 @@ function CurrencySelect({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TextField
|
<TextField
|
||||||
|
className={className}
|
||||||
|
InputProps={InputProps}
|
||||||
id={id}
|
id={id}
|
||||||
name={id}
|
name={id}
|
||||||
select
|
select
|
||||||
|
@ -3,7 +3,6 @@ import React, { createRef, useState, useContext } from 'react'
|
|||||||
import { Formik } from 'formik'
|
import { Formik } from 'formik'
|
||||||
import LiquidPledging from '../../embarkArtifacts/contracts/LiquidPledging'
|
import LiquidPledging from '../../embarkArtifacts/contracts/LiquidPledging'
|
||||||
import TextField from '@material-ui/core/TextField'
|
import TextField from '@material-ui/core/TextField'
|
||||||
import MenuItem from '@material-ui/core/MenuItem'
|
|
||||||
import Divider from '@material-ui/core/Divider'
|
import Divider from '@material-ui/core/Divider'
|
||||||
import FormControlLabel from '@material-ui/core/FormControlLabel'
|
import FormControlLabel from '@material-ui/core/FormControlLabel'
|
||||||
import Switch from '@material-ui/core/Switch'
|
import Switch from '@material-ui/core/Switch'
|
||||||
@ -12,9 +11,9 @@ import InputAdornment from '@material-ui/core/InputAdornment'
|
|||||||
import CloudUpload from '@material-ui/icons/CloudUpload'
|
import CloudUpload from '@material-ui/icons/CloudUpload'
|
||||||
import { withStyles } from '@material-ui/core/styles'
|
import { withStyles } from '@material-ui/core/styles'
|
||||||
import { formatForIpfs, uploadToIpfs, formatMedia, isWeb } from '../../utils/ipfs'
|
import { formatForIpfs, uploadToIpfs, formatMedia, isWeb } from '../../utils/ipfs'
|
||||||
import { currencies, TOKEN_ICON_API } from '../../utils/currencies'
|
|
||||||
import { FundingContext } from '../../context'
|
import { FundingContext } from '../../context'
|
||||||
import {ZERO_ADDRESS} from '../../utils/address'
|
import {ZERO_ADDRESS} from '../../utils/address'
|
||||||
|
import CurrencySelect from '../base/CurrencySelect'
|
||||||
|
|
||||||
const { addProject } = LiquidPledging.methods
|
const { addProject } = LiquidPledging.methods
|
||||||
|
|
||||||
@ -316,7 +315,7 @@ const SubmissionSection = ({ classes, history }) => {
|
|||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
value={values.goal || ''}
|
value={values.goal || ''}
|
||||||
/>
|
/>
|
||||||
<TextField
|
<CurrencySelect
|
||||||
className={classes.textField}
|
className={classes.textField}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
classes: {
|
classes: {
|
||||||
@ -324,28 +323,11 @@ const SubmissionSection = ({ classes, history }) => {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
id="goalToken"
|
id="goalToken"
|
||||||
name="goalToken"
|
|
||||||
select
|
|
||||||
label="Select Token"
|
label="Select Token"
|
||||||
placeholder="Select Token"
|
|
||||||
margin="normal"
|
|
||||||
variant="outlined"
|
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
value={values.goalToken || ''}
|
value={values.goalToken}
|
||||||
>
|
/>
|
||||||
{currencies.map((option) => (
|
|
||||||
<MenuItem style={{display: 'flex', alignItems: 'center'}} key={option.value} value={option.value}>
|
|
||||||
<div style={{display: 'flex', alignItems: 'center'}}>
|
|
||||||
{option.icon || <img
|
|
||||||
src={option.img || `${TOKEN_ICON_API}/${option.value}.png`}
|
|
||||||
style={{width: option.width, marginRight: '3%'}}
|
|
||||||
/>}
|
|
||||||
{option.label}
|
|
||||||
</div>
|
|
||||||
</MenuItem>
|
|
||||||
))}
|
|
||||||
</TextField>
|
|
||||||
<TextField
|
<TextField
|
||||||
className={classes.textField}
|
className={classes.textField}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user