Show eth balance in add eth balance onboarding step
This commit is contained in:
@@ -1,15 +1,26 @@
|
|||||||
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Container } from 'ts/components/ui/container';
|
import { Container } from 'ts/components/ui/container';
|
||||||
import { Text } from 'ts/components/ui/text';
|
import { Text } from 'ts/components/ui/text';
|
||||||
|
import { constants } from 'ts/utils/constants';
|
||||||
|
import { utils } from 'ts/utils/utils';
|
||||||
|
|
||||||
export interface AddEthOnboardingStepProps {
|
export interface AddEthOnboardingStepProps {
|
||||||
hasEth: boolean;
|
userEthBalanceInWei: BigNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AddEthOnboardingStep: React.StatelessComponent<AddEthOnboardingStepProps> = props =>
|
export const AddEthOnboardingStep: React.StatelessComponent<AddEthOnboardingStepProps> = props =>
|
||||||
props.hasEth ? (
|
props.userEthBalanceInWei.gt(0) ? (
|
||||||
<div className="flex items-center flex-column">
|
<div className="flex items-center flex-column">
|
||||||
<Text> Great! Looks like you already have ETH in your wallet.</Text>
|
<Text>
|
||||||
|
Great! Looks like you already have{' '}
|
||||||
|
{utils.getFormattedAmount(
|
||||||
|
props.userEthBalanceInWei,
|
||||||
|
constants.DECIMAL_PLACES_ETH,
|
||||||
|
constants.ETHER_SYMBOL,
|
||||||
|
)}{' '}
|
||||||
|
in your wallet.
|
||||||
|
</Text>
|
||||||
<Container marginTop="15px" marginBottom="15px">
|
<Container marginTop="15px" marginBottom="15px">
|
||||||
<img src="/images/ether_alt.svg" height="50px" width="50px" />
|
<img src="/images/ether_alt.svg" height="50px" width="50px" />
|
||||||
</Container>
|
</Container>
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
import { colors } from '@0xproject/react-shared';
|
import { colors } from '@0xproject/react-shared';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
|
import * as _ from 'lodash';
|
||||||
import { Button } from 'ts/components/ui/button';
|
import { Button } from 'ts/components/ui/button';
|
||||||
import { Container } from 'ts/components/ui/container';
|
import { Container } from 'ts/components/ui/container';
|
||||||
import { IconButton } from 'ts/components/ui/icon_button';
|
import { IconButton } from 'ts/components/ui/icon_button';
|
||||||
import { Island } from 'ts/components/ui/island';
|
import { Island } from 'ts/components/ui/island';
|
||||||
import { Text, Title } from 'ts/components/ui/text';
|
import { Text, Title } from 'ts/components/ui/text';
|
||||||
import * as _ from 'lodash';
|
|
||||||
|
|
||||||
export type ContinueButtonDisplay = 'enabled' | 'disabled';
|
export type ContinueButtonDisplay = 'enabled' | 'disabled';
|
||||||
|
|
||||||
|
@@ -97,13 +97,7 @@ class PlainPortalOnboardingFlow extends React.Component<PortalOnboardingFlowProp
|
|||||||
target: '.wallet',
|
target: '.wallet',
|
||||||
title: 'Step 1: Add ETH',
|
title: 'Step 1: Add ETH',
|
||||||
content: (
|
content: (
|
||||||
<AddEthOnboardingStep
|
<AddEthOnboardingStep userEthBalanceInWei={this.props.userEtherBalanceInWei || new BigNumber(0)} />
|
||||||
hasEth={
|
|
||||||
!_.isUndefined(this.props.userEtherBalanceInWei)
|
|
||||||
? this.props.userEtherBalanceInWei.gt(0)
|
|
||||||
: false
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
),
|
),
|
||||||
placement: 'right',
|
placement: 'right',
|
||||||
continueButtonDisplay: this._userHasVisibleEth() ? 'enabled' : 'disabled',
|
continueButtonDisplay: this._userHasVisibleEth() ? 'enabled' : 'disabled',
|
||||||
|
Reference in New Issue
Block a user