add enable token permissions to mobile registration screen

This commit is contained in:
Barry Gitarts 2018-08-15 16:27:43 -04:00
parent b267cdeb63
commit 7f1540d387
1 changed files with 91 additions and 85 deletions

View File

@ -11,6 +11,7 @@ import { zeroAddress, zeroBytes32, formatPrice } from './utils';
import { getStatusContactCode, getSNTAllowance } from '../../reducers/accounts';
import FieldGroup from '../standard/FieldGroup';
import LinearProgress from '@material-ui/core/LinearProgress';
import TokenPermissions from '../standard/TokenPermissionConnect';
import { generateXY } from '../../utils/ecdsa';
const { soliditySha3, fromWei } = web3.utils;
@ -18,7 +19,6 @@ const { soliditySha3, fromWei } = web3.utils;
const InnerForm = ({
values,
errors,
touched,
handleChange,
handleBlur,
handleSubmit,
@ -27,7 +27,7 @@ const InnerForm = ({
subDomain,
domainName,
domainPrice,
statusContactCode,
SNTAllowance,
}) => (
<form onSubmit={handleSubmit}>
<div style={{ margin: '10px' }}>
@ -120,7 +120,13 @@ const InnerForm = ({
wide />
</Field>
<div style={{ position: 'relative', left: 0, right: 0, bottom: 0 }}>
<MobileButton type="submit" text="Register with transaction" style={{ width: '100%' }}/>
{!Number(SNTAllowance) ? <TokenPermissions
symbol="SNT"
spender={ENSSubdomainRegistry.address}
methods={TestToken.methods}
mobile
/>
: <MobileButton type="submit" text="Register with transaction" style={{ width: '100%' }}/>}
</div>
</Hidden>
</div>