replace eth with weth for publishing

This commit is contained in:
Barry Gitarts 2019-12-05 10:52:53 -05:00 committed by Barry G
parent 65daf01c35
commit ec556141f7
2 changed files with 16 additions and 3 deletions

View File

@ -18,7 +18,18 @@ CurrencySelect.propTypes = {
showBalances: PropTypes.bool, showBalances: PropTypes.bool,
enableToggles: PropTypes.bool, enableToggles: PropTypes.bool,
className: PropTypes.string, className: PropTypes.string,
InputProps: PropTypes.object InputProps: PropTypes.object,
publishing: PropTypes.bool
}
const orderCurrencies = (currencies, publishing) => {
if (publishing) {
const temp = [...currencies]
let weth = currencies.findIndex(e => e.label === 'WETH')
temp[0] = temp[weth]
return temp.filter(e => e !== undefined)
}
return currencies
} }
function CurrencySelect({ function CurrencySelect({
@ -30,7 +41,8 @@ function CurrencySelect({
showBalances, showBalances,
enableToggles, enableToggles,
className, className,
InputProps InputProps,
publishing
}) { }) {
const context = useContext(FundingContext) const context = useContext(FundingContext)
const { account } = context const { account } = context
@ -87,7 +99,7 @@ function CurrencySelect({
onBlur={onBlur} onBlur={onBlur}
value={value || ''} value={value || ''}
> >
{!!currencies && currencies.map((option, idx) => ( {!!currencies && orderCurrencies(currencies, publishing).map((option, idx) => (
<MenuItem style={{display: 'flex', alignItems: 'center'}} key={option.value} value={option.value}> <MenuItem style={{display: 'flex', alignItems: 'center'}} key={option.value} value={option.value}>
<div style={{display: 'flex', alignItems: 'center'}}> <div style={{display: 'flex', alignItems: 'center'}}>
{option.icon || <img {option.icon || <img

View File

@ -433,6 +433,7 @@ const SubmissionSection = ({ classes, history }) => {
onChange={handleChange} onChange={handleChange}
onBlur={handleBlur} onBlur={handleBlur}
value={values.goalToken} value={values.goalToken}
publishing
/> />
<StatusTextField <StatusTextField
className={classnames(classes.threeFourthWidth)} className={classnames(classes.threeFourthWidth)}