Implement WETH step logic for continue
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user