From 4454cfa65dfb2f0928cddc8732a64010b0c5f0d8 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 27 Jun 2018 18:21:51 -0700 Subject: Customize flow depending on what steps you've completed --- .../onboarding/add_eth_onboarding_step.tsx | 36 ++++++++++++++-------- .../ts/components/onboarding/onboarding_flow.tsx | 2 +- .../onboarding/portal_onboarding_flow.tsx | 16 ++++++++-- .../onboarding/wrap_eth_onboarding_step.tsx | 9 ++++-- 4 files changed, 43 insertions(+), 20 deletions(-) (limited to 'packages/website/ts/components') diff --git a/packages/website/ts/components/onboarding/add_eth_onboarding_step.tsx b/packages/website/ts/components/onboarding/add_eth_onboarding_step.tsx index 1dd47773c..62d44885c 100644 --- a/packages/website/ts/components/onboarding/add_eth_onboarding_step.tsx +++ b/packages/website/ts/components/onboarding/add_eth_onboarding_step.tsx @@ -2,17 +2,27 @@ import * as React from 'react'; import { Container } from 'ts/components/ui/container'; import { Text } from 'ts/components/ui/text'; -export interface AddEthOnboardingStepProps {} +export interface AddEthOnboardingStepProps { + hasEth: boolean; +} -export const AddEthOnboardingStep: React.StatelessComponent = () => ( -
- Before you begin you will need to send some ETH to your wallet. - - - - - Click on the metamask extension in your - browser and click either BUY or DEPOSIT. - -
-); +export const AddEthOnboardingStep: React.StatelessComponent = props => + props.hasEth ? ( +
+ Great! Looks like you already have ETH in your wallet. + + + +
+ ) : ( +
+ Before you begin you will need to send some ETH to your wallet. + + + + + Click on the metamask extension in + your browser and click either BUY or DEPOSIT. + +
+ ); diff --git a/packages/website/ts/components/onboarding/onboarding_flow.tsx b/packages/website/ts/components/onboarding/onboarding_flow.tsx index e3de7e098..e20e58eec 100644 --- a/packages/website/ts/components/onboarding/onboarding_flow.tsx +++ b/packages/website/ts/components/onboarding/onboarding_flow.tsx @@ -3,10 +3,10 @@ import { Placement, Popper, PopperChildrenProps } from 'react-popper'; import { OnboardingCard } from 'ts/components/onboarding/onboarding_card'; import { ContinueButtonDisplay, OnboardingTooltip } from 'ts/components/onboarding/onboarding_tooltip'; -import { zIndex } from 'ts/style/z_index'; import { Animation } from 'ts/components/ui/animation'; import { Container } from 'ts/components/ui/container'; import { Overlay } from 'ts/components/ui/overlay'; +import { zIndex } from 'ts/style/z_index'; export interface Step { target: string; diff --git a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx index 4dfc948a5..2102f39f9 100644 --- a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx +++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx @@ -96,7 +96,15 @@ class PlainPortalOnboardingFlow extends React.Component, + content: ( + + ), placement: 'right', continueButtonDisplay: this._userHasVisibleEth() ? 'enabled' : 'disabled', }, @@ -119,7 +127,9 @@ class PlainPortalOnboardingFlow extends React.Component ), placement: 'right', @@ -127,7 +137,7 @@ class PlainPortalOnboardingFlow extends React.Component = ({ - formattedEthBalance, + formattedWethBalanceIfExists, }) => (
- You currently have {formattedEthBalance} in your wallet. + + You have {formattedWethBalanceIfExists || '0 WETH'} in your wallet. + {formattedWethBalanceIfExists && ' Great!'} +
1 ETH -- cgit