aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-07 09:06:03 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-07 09:06:03 +0800
commitcbe5438a31a54a92a198b2cc5ad8a5d5feb033b4 (patch)
tree69859892a8be12cc531fbd2e79976db3c2b2fa88 /packages/website/ts/components
parent612cc96e417c1397e1874be22208864f12acbda3 (diff)
downloaddexon-0x-contracts-cbe5438a31a54a92a198b2cc5ad8a5d5feb033b4.tar
dexon-0x-contracts-cbe5438a31a54a92a198b2cc5ad8a5d5feb033b4.tar.gz
dexon-0x-contracts-cbe5438a31a54a92a198b2cc5ad8a5d5feb033b4.tar.bz2
dexon-0x-contracts-cbe5438a31a54a92a198b2cc5ad8a5d5feb033b4.tar.lz
dexon-0x-contracts-cbe5438a31a54a92a198b2cc5ad8a5d5feb033b4.tar.xz
dexon-0x-contracts-cbe5438a31a54a92a198b2cc5ad8a5d5feb033b4.tar.zst
dexon-0x-contracts-cbe5438a31a54a92a198b2cc5ad8a5d5feb033b4.zip
Render TokenAllowance
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r--packages/website/ts/components/onboarding/portal_onboarding_flow.tsx21
1 files changed, 18 insertions, 3 deletions
diff --git a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
index 55d89d61e..78592c67f 100644
--- a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
+++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
@@ -4,7 +4,7 @@ import * as React from 'react';
import { BigNumber } from '@0xproject/utils';
import { Blockchain } from 'ts/blockchain';
import { OnboardingFlow, Step } from 'ts/components/onboarding/onboarding_flow';
-import { ProviderType, TokenByAddress, TokenStateByAddress } from 'ts/types';
+import { ProviderType, Token, TokenByAddress, TokenStateByAddress } from 'ts/types';
import { utils } from 'ts/utils/utils';
import { AllowanceToggle } from 'ts/containers/inputs/allowance_toggle';
@@ -83,7 +83,8 @@ export class PortalOnboardingFlow extends React.Component<PortalOnboardingFlowPr
},
{
target: '.weth-row',
- content: 'Unlock your tokens for trading. You only need to do this once for each token.',
+ // content: <div> Unlock your tokens for trading. You only need to do this once for each token. {this._renderEthAllowanceToggle()}</div>,
+ content: 'blah',
placement: 'right',
continueButtonDisplay: 'disabled',
},
@@ -135,9 +136,23 @@ export class PortalOnboardingFlow extends React.Component<PortalOnboardingFlowPr
this.props.updateIsRunning(true);
}
}
- private _renderAllowanceToggle(): React.ReactNode {
+ private _renderZrxAllowanceToggle(): React.ReactNode {
+ const zrxToken = utils.getZrxToken(this.props.tokenByAddress)
+ return this._renderAllowanceToggle(zrxToken);
+ }
+ private _renderEthAllowanceToggle(): React.ReactNode {
+ const ethToken = utils.getEthToken(this.props.tokenByAddress);
+ return this._renderAllowanceToggle(ethToken);
+ }
+ private _renderAllowanceToggle(token: Token): React.ReactNode {
+ if (!token) {
+ return null;
+ }
+ const tokenState = this.props.trackedTokenStateByAddress[token.address];
return (
<AllowanceToggle
+ token={token}
+ tokenState={tokenState}
blockchain={this.props.blockchain}
refetchTokenStateAsync={this.props.refetchTokenStateAsync}
/>