From 824c331ea0c0f57a717a242aab82dadfe9737004 Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 6 Jul 2018 15:11:01 -0700 Subject: Make unlock metamask step look more like mock --- .../ts/components/onboarding/onboarding_card.tsx | 114 +++++++++++++-------- .../ts/components/onboarding/onboarding_flow.tsx | 7 ++ .../onboarding/portal_onboarding_flow.tsx | 6 +- .../onboarding/unlock_wallet_onboarding_step.tsx | 6 +- 4 files changed, 81 insertions(+), 52 deletions(-) (limited to 'packages/website/ts') diff --git a/packages/website/ts/components/onboarding/onboarding_card.tsx b/packages/website/ts/components/onboarding/onboarding_card.tsx index ba5b3d6ea..4e853719e 100644 --- a/packages/website/ts/components/onboarding/onboarding_card.tsx +++ b/packages/website/ts/components/onboarding/onboarding_card.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import * as _ from 'lodash'; import { Button } from 'ts/components/ui/button'; -import { Container } from 'ts/components/ui/container'; +import { Container, ContainerProps } from 'ts/components/ui/container'; import { IconButton } from 'ts/components/ui/icon_button'; import { Island } from 'ts/components/ui/island'; import { Text, Title } from 'ts/components/ui/text'; @@ -12,6 +12,7 @@ export type ContinueButtonDisplay = 'enabled' | 'disabled'; export interface OnboardingCardProps { title?: string; + shouldCenterTitle?: boolean; content: React.ReactNode; isLastStep: boolean; onClose: () => void; @@ -23,10 +24,13 @@ export interface OnboardingCardProps { shouldHideNextButton?: boolean; continueButtonText?: string; borderRadius?: string; + // Used for super-custom content. + shouldRemoveExtraSpacing?: boolean; } export const OnboardingCard: React.StatelessComponent = ({ title, + shouldCenterTitle, content, continueButtonDisplay, continueButtonText, @@ -37,55 +41,75 @@ export const OnboardingCard: React.StatelessComponent = ({ shouldHideBackButton, shouldHideNextButton, borderRadius, -}) => ( - - -
-
- {title} - - - Close - + shouldRemoveExtraSpacing, +}) => { + const padding = shouldRemoveExtraSpacing + ? {} + : { + paddingRight: '30px', + paddingLeft: '30px', + paddingTop: '15px', + paddingBottom: '15px', + }; + const closeIconPositioning = shouldRemoveExtraSpacing + ? { right: '15px', bottom: '3px' } + : { bottom: '20px', left: '15px' }; + return ( + + +
+ + + {title} + + + + Close + + + + {content} + + {continueButtonDisplay && ( + + )} + {!(shouldHideBackButton && shouldHideNextButton) && ( + +
+ {!shouldHideBackButton && ( + + Back + + )} +
+
+ {!shouldHideNextButton && ( + + Skip + + )} +
+
+ )}
- - {content} - - {continueButtonDisplay && ( - - )} - -
- {!shouldHideBackButton && ( - - Back - - )} -
-
- {!shouldHideNextButton && ( - - Skip - - )} -
-
-
- - -); + + + ); +}; OnboardingCard.defaultProps = { continueButtonText: 'Continue', + shouldCenterTitle: false, + shouldRemoveExtraSpacing: false, }; OnboardingCard.displayName = 'OnboardingCard'; diff --git a/packages/website/ts/components/onboarding/onboarding_flow.tsx b/packages/website/ts/components/onboarding/onboarding_flow.tsx index 8aebdf1d3..91d5f2476 100644 --- a/packages/website/ts/components/onboarding/onboarding_flow.tsx +++ b/packages/website/ts/components/onboarding/onboarding_flow.tsx @@ -31,12 +31,15 @@ export interface Step { // Provide either a CSS selector, or fixed position settings. Only applies to desktop. position: TargetPositionSettings | FixedPositionSettings; title?: string; + shouldCenterTitle?: boolean; content: React.ReactNode; shouldHideBackButton?: boolean; shouldHideNextButton?: boolean; continueButtonDisplay?: ContinueButtonDisplay; continueButtonText?: string; onContinueButtonClick?: () => void; + // Only used for very custom steps. + shouldRemoveExtraSpacing?: boolean; } export interface OnboardingFlowProps { @@ -114,6 +117,7 @@ export class OnboardingFlow extends React.Component { { continueButtonText={step.continueButtonText} onContinueButtonClick={step.onContinueButtonClick} pointerDisplay={tooltipPointerDisplay} + shouldRemoveExtraSpacing={step.shouldRemoveExtraSpacing} /> ); @@ -138,6 +143,7 @@ export class OnboardingFlow extends React.Component { { continueButtonText={step.continueButtonText} onContinueButtonClick={step.onContinueButtonClick} borderRadius="10px 10px 0px 0px" + shouldRemoveExtraSpacing={step.shouldRemoveExtraSpacing} /> ); diff --git a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx index 3dec8a444..20a8f0a32 100644 --- a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx +++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx @@ -91,8 +91,8 @@ class PlainPortalOnboardingFlow extends React.Component, shouldHideBackButton: true, shouldHideNextButton: true, + shouldCenterTitle: true, + shouldRemoveExtraSpacing: true, }, { position: nextToWalletPosition, diff --git a/packages/website/ts/components/onboarding/unlock_wallet_onboarding_step.tsx b/packages/website/ts/components/onboarding/unlock_wallet_onboarding_step.tsx index a1de469ad..358141520 100644 --- a/packages/website/ts/components/onboarding/unlock_wallet_onboarding_step.tsx +++ b/packages/website/ts/components/onboarding/unlock_wallet_onboarding_step.tsx @@ -4,9 +4,5 @@ import { Image } from 'ts/components/ui/image'; export interface UnlockWalletOnboardingStepProps {} export const UnlockWalletOnboardingStep: React.StatelessComponent = () => ( -
-
- -
-
+ ); -- cgit