diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-05-30 08:57:22 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-05-30 08:57:22 +0800 |
commit | b14c3fe48dc8eb5bad6eefceac872754eec34ffe (patch) | |
tree | 4b151a99b892d8adf3c53418c3a1b03600da87bc /packages/website/ts/components/onboarding/onboarding_tooltip.tsx | |
parent | bc28a08dd0d4db99549122fb4912b4931a3aad78 (diff) | |
download | dexon-0x-contracts-b14c3fe48dc8eb5bad6eefceac872754eec34ffe.tar.gz dexon-0x-contracts-b14c3fe48dc8eb5bad6eefceac872754eec34ffe.tar.zst dexon-0x-contracts-b14c3fe48dc8eb5bad6eefceac872754eec34ffe.zip |
Onboarding: implement add ETH step, and stub for add WETH step
Diffstat (limited to 'packages/website/ts/components/onboarding/onboarding_tooltip.tsx')
-rw-r--r-- | packages/website/ts/components/onboarding/onboarding_tooltip.tsx | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/packages/website/ts/components/onboarding/onboarding_tooltip.tsx b/packages/website/ts/components/onboarding/onboarding_tooltip.tsx index 41925a672..eb34a87f2 100644 --- a/packages/website/ts/components/onboarding/onboarding_tooltip.tsx +++ b/packages/website/ts/components/onboarding/onboarding_tooltip.tsx @@ -4,6 +4,8 @@ import { colors } from '@0xproject/react-shared'; import { Container } from 'ts/components/ui/container'; import { Island } from 'ts/components/ui/island'; +export type ContinueButtonDisplay = 'enabled' | 'disabled'; + export interface OnboardingTooltipProps { title?: string; content: React.ReactNode; @@ -11,19 +13,44 @@ export interface OnboardingTooltipProps { onClose: () => void; onClickNext: () => void; onClickBack: () => void; + continueButtonDisplay?: ContinueButtonDisplay; hideBackButton?: boolean; + hideNextButton?: boolean; +} + +// TODO: Make this more general button. +export interface ContinueButtonProps { + display: ContinueButtonDisplay; + children?: string; + onClick: () => void; } +export const ContinueButton: React.StatelessComponent<ContinueButtonProps> = (props: ContinueButtonProps) => { + const isDisabled = props.display === 'disabled'; + return ( + <button disabled={isDisabled} onClick={isDisabled ? undefined : props.onClick}> + {props.children} + </button> + ); +}; + export const OnboardingTooltip: React.StatelessComponent<OnboardingTooltipProps> = (props: OnboardingTooltipProps) => ( <Island> <Container paddingRight="30px" paddingLeft="30px" maxWidth={350} paddingTop="15px" paddingBottom="15px"> <div className="flex flex-column"> {props.title} {props.content} + {props.continueButtonDisplay && ( + <ContinueButton onClick={props.onClickNext} display={props.continueButtonDisplay}> + Continue + </ContinueButton> + )} {!props.hideBackButton && <button onClick={props.onClickBack}>Back</button>} - <button onClick={props.onClickNext}>Skip</button> + {!props.hideNextButton && <button onClick={props.onClickNext}>Skip</button>} <button onClick={props.onClose}>Close</button> </div> </Container> </Island> ); + +OnboardingTooltip.displayName = 'OnboardingTooltip'; |