aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/onboarding
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-05-31 08:51:21 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-05 01:25:38 +0800
commitf382609d01ab86da52a746ba24ddd73a1a507aa6 (patch)
tree298e0a84dd6844d4a76384172e7b738bc5b31315 /packages/website/ts/components/onboarding
parentf9615c18a1cc16794b6a55b76aa361332494a6ac (diff)
downloaddexon-sol-tools-f382609d01ab86da52a746ba24ddd73a1a507aa6.tar
dexon-sol-tools-f382609d01ab86da52a746ba24ddd73a1a507aa6.tar.gz
dexon-sol-tools-f382609d01ab86da52a746ba24ddd73a1a507aa6.tar.bz2
dexon-sol-tools-f382609d01ab86da52a746ba24ddd73a1a507aa6.tar.lz
dexon-sol-tools-f382609d01ab86da52a746ba24ddd73a1a507aa6.tar.xz
dexon-sol-tools-f382609d01ab86da52a746ba24ddd73a1a507aa6.tar.zst
dexon-sol-tools-f382609d01ab86da52a746ba24ddd73a1a507aa6.zip
Implement WETH step logic for continue
Diffstat (limited to 'packages/website/ts/components/onboarding')
-rw-r--r--packages/website/ts/components/onboarding/portal_onboarding_flow.tsx11
1 files changed, 8 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 2014dd7b0..398ce0141 100644
--- a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
+++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx
@@ -3,7 +3,7 @@ import * as React from 'react';
import { BigNumber } from '@0xproject/utils';
import { OnboardingFlow, Step } from 'ts/components/onboarding/onboarding_flow';
-import { ProviderType, TokenByAddress } from 'ts/types';
+import { ProviderType, TokenByAddress, TokenStateByAddress } from 'ts/types';
import { utils } from 'ts/utils/utils';
export interface PortalOnboardingFlowProps {
@@ -16,6 +16,7 @@ export interface PortalOnboardingFlowProps {
blockchainIsLoaded: boolean;
userEtherBalanceInWei?: BigNumber;
tokenByAddress: TokenByAddress;
+ trackedTokenStateByAddress: TokenStateByAddress;
updateIsRunning: (isRunning: boolean) => void;
updateOnboardingStep: (stepIndex: number) => void;
}
@@ -89,8 +90,12 @@ export class PortalOnboardingFlow extends React.Component<PortalOnboardingFlowPr
}
private _userHasWeth(): boolean {
- // TODO: https://app.asana.com/0/681385331277907/690722374136933
- return false;
+ const ethToken = utils.getEthToken(this.props.tokenByAddress);
+ if (!ethToken) {
+ return false;
+ }
+ const wethTokenState = this.props.trackedTokenStateByAddress[ethToken.address];
+ return wethTokenState.balance > new BigNumber(0);
}
private _overrideOnboardingStateIfShould(): void {