Make unlock metamask step look more like mock
This commit is contained in:
		@@ -3,7 +3,7 @@ import * as React from 'react';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import * as _ from 'lodash';
 | 
					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, ContainerProps } 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';
 | 
				
			||||||
@@ -12,6 +12,7 @@ export type ContinueButtonDisplay = 'enabled' | 'disabled';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
export interface OnboardingCardProps {
 | 
					export interface OnboardingCardProps {
 | 
				
			||||||
    title?: string;
 | 
					    title?: string;
 | 
				
			||||||
 | 
					    shouldCenterTitle?: boolean;
 | 
				
			||||||
    content: React.ReactNode;
 | 
					    content: React.ReactNode;
 | 
				
			||||||
    isLastStep: boolean;
 | 
					    isLastStep: boolean;
 | 
				
			||||||
    onClose: () => void;
 | 
					    onClose: () => void;
 | 
				
			||||||
@@ -23,10 +24,13 @@ export interface OnboardingCardProps {
 | 
				
			|||||||
    shouldHideNextButton?: boolean;
 | 
					    shouldHideNextButton?: boolean;
 | 
				
			||||||
    continueButtonText?: string;
 | 
					    continueButtonText?: string;
 | 
				
			||||||
    borderRadius?: string;
 | 
					    borderRadius?: string;
 | 
				
			||||||
 | 
					    // Used for super-custom content.
 | 
				
			||||||
 | 
					    shouldRemoveExtraSpacing?: boolean;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const OnboardingCard: React.StatelessComponent<OnboardingCardProps> = ({
 | 
					export const OnboardingCard: React.StatelessComponent<OnboardingCardProps> = ({
 | 
				
			||||||
    title,
 | 
					    title,
 | 
				
			||||||
 | 
					    shouldCenterTitle,
 | 
				
			||||||
    content,
 | 
					    content,
 | 
				
			||||||
    continueButtonDisplay,
 | 
					    continueButtonDisplay,
 | 
				
			||||||
    continueButtonText,
 | 
					    continueButtonText,
 | 
				
			||||||
@@ -37,55 +41,75 @@ export const OnboardingCard: React.StatelessComponent<OnboardingCardProps> = ({
 | 
				
			|||||||
    shouldHideBackButton,
 | 
					    shouldHideBackButton,
 | 
				
			||||||
    shouldHideNextButton,
 | 
					    shouldHideNextButton,
 | 
				
			||||||
    borderRadius,
 | 
					    borderRadius,
 | 
				
			||||||
}) => (
 | 
					    shouldRemoveExtraSpacing,
 | 
				
			||||||
    <Island borderRadius={borderRadius}>
 | 
					}) => {
 | 
				
			||||||
        <Container paddingRight="30px" paddingLeft="30px" paddingTop="15px" paddingBottom="15px">
 | 
					    const padding = shouldRemoveExtraSpacing
 | 
				
			||||||
            <div className="flex flex-column">
 | 
					        ? {}
 | 
				
			||||||
                <div className="flex justify-between">
 | 
					        : {
 | 
				
			||||||
                    <Title>{title}</Title>
 | 
					              paddingRight: '30px',
 | 
				
			||||||
                    <Container position="relative" bottom="20px" left="15px">
 | 
					              paddingLeft: '30px',
 | 
				
			||||||
                        <IconButton color={colors.grey} iconName="zmdi-close" onClick={onClose}>
 | 
					              paddingTop: '15px',
 | 
				
			||||||
                            Close
 | 
					              paddingBottom: '15px',
 | 
				
			||||||
                        </IconButton>
 | 
					          };
 | 
				
			||||||
 | 
					    const closeIconPositioning = shouldRemoveExtraSpacing
 | 
				
			||||||
 | 
					        ? { right: '15px', bottom: '3px' }
 | 
				
			||||||
 | 
					        : { bottom: '20px', left: '15px' };
 | 
				
			||||||
 | 
					    return (
 | 
				
			||||||
 | 
					        <Island borderRadius={borderRadius}>
 | 
				
			||||||
 | 
					            <Container {...padding}>
 | 
				
			||||||
 | 
					                <div className="flex flex-column">
 | 
				
			||||||
 | 
					                    <Container className="flex justify-between">
 | 
				
			||||||
 | 
					                        <Container width="100%">
 | 
				
			||||||
 | 
					                            <Title center={shouldCenterTitle}>{title}</Title>
 | 
				
			||||||
 | 
					                        </Container>
 | 
				
			||||||
 | 
					                        <Container position="relative" {...closeIconPositioning}>
 | 
				
			||||||
 | 
					                            <IconButton color={colors.grey} iconName="zmdi-close" onClick={onClose}>
 | 
				
			||||||
 | 
					                                Close
 | 
				
			||||||
 | 
					                            </IconButton>
 | 
				
			||||||
 | 
					                        </Container>
 | 
				
			||||||
                    </Container>
 | 
					                    </Container>
 | 
				
			||||||
 | 
					                    <Container marginBottom={shouldRemoveExtraSpacing ? undefined : '15px'}>
 | 
				
			||||||
 | 
					                        <Text>{content}</Text>
 | 
				
			||||||
 | 
					                    </Container>
 | 
				
			||||||
 | 
					                    {continueButtonDisplay && (
 | 
				
			||||||
 | 
					                        <Button
 | 
				
			||||||
 | 
					                            isDisabled={continueButtonDisplay === 'disabled'}
 | 
				
			||||||
 | 
					                            onClick={!_.isUndefined(onContinueButtonClick) ? onContinueButtonClick : onClickNext}
 | 
				
			||||||
 | 
					                            fontColor={colors.white}
 | 
				
			||||||
 | 
					                            fontSize="15px"
 | 
				
			||||||
 | 
					                            backgroundColor={colors.mediumBlue}
 | 
				
			||||||
 | 
					                        >
 | 
				
			||||||
 | 
					                            {continueButtonText}
 | 
				
			||||||
 | 
					                        </Button>
 | 
				
			||||||
 | 
					                    )}
 | 
				
			||||||
 | 
					                    {!(shouldHideBackButton && shouldHideNextButton) && (
 | 
				
			||||||
 | 
					                        <Container className="clearfix" marginTop="15px">
 | 
				
			||||||
 | 
					                            <div className="left">
 | 
				
			||||||
 | 
					                                {!shouldHideBackButton && (
 | 
				
			||||||
 | 
					                                    <Text fontColor={colors.grey} onClick={onClickBack}>
 | 
				
			||||||
 | 
					                                        Back
 | 
				
			||||||
 | 
					                                    </Text>
 | 
				
			||||||
 | 
					                                )}
 | 
				
			||||||
 | 
					                            </div>
 | 
				
			||||||
 | 
					                            <div className="right">
 | 
				
			||||||
 | 
					                                {!shouldHideNextButton && (
 | 
				
			||||||
 | 
					                                    <Text fontColor={colors.grey} onClick={onClickNext}>
 | 
				
			||||||
 | 
					                                        Skip
 | 
				
			||||||
 | 
					                                    </Text>
 | 
				
			||||||
 | 
					                                )}
 | 
				
			||||||
 | 
					                            </div>
 | 
				
			||||||
 | 
					                        </Container>
 | 
				
			||||||
 | 
					                    )}
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <Container marginBottom="15px">
 | 
					            </Container>
 | 
				
			||||||
                    <Text>{content}</Text>
 | 
					        </Island>
 | 
				
			||||||
                </Container>
 | 
					    );
 | 
				
			||||||
                {continueButtonDisplay && (
 | 
					};
 | 
				
			||||||
                    <Button
 | 
					 | 
				
			||||||
                        isDisabled={continueButtonDisplay === 'disabled'}
 | 
					 | 
				
			||||||
                        onClick={!_.isUndefined(onContinueButtonClick) ? onContinueButtonClick : onClickNext}
 | 
					 | 
				
			||||||
                        fontColor={colors.white}
 | 
					 | 
				
			||||||
                        fontSize="15px"
 | 
					 | 
				
			||||||
                        backgroundColor={colors.mediumBlue}
 | 
					 | 
				
			||||||
                    >
 | 
					 | 
				
			||||||
                        {continueButtonText}
 | 
					 | 
				
			||||||
                    </Button>
 | 
					 | 
				
			||||||
                )}
 | 
					 | 
				
			||||||
                <Container className="clearfix" marginTop="15px">
 | 
					 | 
				
			||||||
                    <div className="left">
 | 
					 | 
				
			||||||
                        {!shouldHideBackButton && (
 | 
					 | 
				
			||||||
                            <Text fontColor={colors.grey} onClick={onClickBack}>
 | 
					 | 
				
			||||||
                                Back
 | 
					 | 
				
			||||||
                            </Text>
 | 
					 | 
				
			||||||
                        )}
 | 
					 | 
				
			||||||
                    </div>
 | 
					 | 
				
			||||||
                    <div className="right">
 | 
					 | 
				
			||||||
                        {!shouldHideNextButton && (
 | 
					 | 
				
			||||||
                            <Text fontColor={colors.grey} onClick={onClickNext}>
 | 
					 | 
				
			||||||
                                Skip
 | 
					 | 
				
			||||||
                            </Text>
 | 
					 | 
				
			||||||
                        )}
 | 
					 | 
				
			||||||
                    </div>
 | 
					 | 
				
			||||||
                </Container>
 | 
					 | 
				
			||||||
            </div>
 | 
					 | 
				
			||||||
        </Container>
 | 
					 | 
				
			||||||
    </Island>
 | 
					 | 
				
			||||||
);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
OnboardingCard.defaultProps = {
 | 
					OnboardingCard.defaultProps = {
 | 
				
			||||||
    continueButtonText: 'Continue',
 | 
					    continueButtonText: 'Continue',
 | 
				
			||||||
 | 
					    shouldCenterTitle: false,
 | 
				
			||||||
 | 
					    shouldRemoveExtraSpacing: false,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
OnboardingCard.displayName = 'OnboardingCard';
 | 
					OnboardingCard.displayName = 'OnboardingCard';
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,12 +31,15 @@ export interface Step {
 | 
				
			|||||||
    // Provide either a CSS selector, or fixed position settings. Only applies to desktop.
 | 
					    // Provide either a CSS selector, or fixed position settings. Only applies to desktop.
 | 
				
			||||||
    position: TargetPositionSettings | FixedPositionSettings;
 | 
					    position: TargetPositionSettings | FixedPositionSettings;
 | 
				
			||||||
    title?: string;
 | 
					    title?: string;
 | 
				
			||||||
 | 
					    shouldCenterTitle?: boolean;
 | 
				
			||||||
    content: React.ReactNode;
 | 
					    content: React.ReactNode;
 | 
				
			||||||
    shouldHideBackButton?: boolean;
 | 
					    shouldHideBackButton?: boolean;
 | 
				
			||||||
    shouldHideNextButton?: boolean;
 | 
					    shouldHideNextButton?: boolean;
 | 
				
			||||||
    continueButtonDisplay?: ContinueButtonDisplay;
 | 
					    continueButtonDisplay?: ContinueButtonDisplay;
 | 
				
			||||||
    continueButtonText?: string;
 | 
					    continueButtonText?: string;
 | 
				
			||||||
    onContinueButtonClick?: () => void;
 | 
					    onContinueButtonClick?: () => void;
 | 
				
			||||||
 | 
					    // Only used for very custom steps.
 | 
				
			||||||
 | 
					    shouldRemoveExtraSpacing?: boolean;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface OnboardingFlowProps {
 | 
					export interface OnboardingFlowProps {
 | 
				
			||||||
@@ -114,6 +117,7 @@ export class OnboardingFlow extends React.Component<OnboardingFlowProps> {
 | 
				
			|||||||
            <Container marginLeft="30px" width="400px">
 | 
					            <Container marginLeft="30px" width="400px">
 | 
				
			||||||
                <OnboardingTooltip
 | 
					                <OnboardingTooltip
 | 
				
			||||||
                    title={step.title}
 | 
					                    title={step.title}
 | 
				
			||||||
 | 
					                    shouldCenterTitle={step.shouldCenterTitle}
 | 
				
			||||||
                    content={step.content}
 | 
					                    content={step.content}
 | 
				
			||||||
                    isLastStep={isLastStep}
 | 
					                    isLastStep={isLastStep}
 | 
				
			||||||
                    shouldHideBackButton={step.shouldHideBackButton}
 | 
					                    shouldHideBackButton={step.shouldHideBackButton}
 | 
				
			||||||
@@ -125,6 +129,7 @@ export class OnboardingFlow extends React.Component<OnboardingFlowProps> {
 | 
				
			|||||||
                    continueButtonText={step.continueButtonText}
 | 
					                    continueButtonText={step.continueButtonText}
 | 
				
			||||||
                    onContinueButtonClick={step.onContinueButtonClick}
 | 
					                    onContinueButtonClick={step.onContinueButtonClick}
 | 
				
			||||||
                    pointerDisplay={tooltipPointerDisplay}
 | 
					                    pointerDisplay={tooltipPointerDisplay}
 | 
				
			||||||
 | 
					                    shouldRemoveExtraSpacing={step.shouldRemoveExtraSpacing}
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
            </Container>
 | 
					            </Container>
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
@@ -138,6 +143,7 @@ export class OnboardingFlow extends React.Component<OnboardingFlowProps> {
 | 
				
			|||||||
            <Container position="relative" zIndex={1}>
 | 
					            <Container position="relative" zIndex={1}>
 | 
				
			||||||
                <OnboardingCard
 | 
					                <OnboardingCard
 | 
				
			||||||
                    title={step.title}
 | 
					                    title={step.title}
 | 
				
			||||||
 | 
					                    shouldCenterTitle={step.shouldCenterTitle}
 | 
				
			||||||
                    content={step.content}
 | 
					                    content={step.content}
 | 
				
			||||||
                    isLastStep={isLastStep}
 | 
					                    isLastStep={isLastStep}
 | 
				
			||||||
                    shouldHideBackButton={step.shouldHideBackButton}
 | 
					                    shouldHideBackButton={step.shouldHideBackButton}
 | 
				
			||||||
@@ -149,6 +155,7 @@ export class OnboardingFlow extends React.Component<OnboardingFlowProps> {
 | 
				
			|||||||
                    continueButtonText={step.continueButtonText}
 | 
					                    continueButtonText={step.continueButtonText}
 | 
				
			||||||
                    onContinueButtonClick={step.onContinueButtonClick}
 | 
					                    onContinueButtonClick={step.onContinueButtonClick}
 | 
				
			||||||
                    borderRadius="10px 10px 0px 0px"
 | 
					                    borderRadius="10px 10px 0px 0px"
 | 
				
			||||||
 | 
					                    shouldRemoveExtraSpacing={step.shouldRemoveExtraSpacing}
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
            </Container>
 | 
					            </Container>
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -91,8 +91,8 @@ class PlainPortalOnboardingFlow extends React.Component<PortalOnboardingFlowProp
 | 
				
			|||||||
        };
 | 
					        };
 | 
				
			||||||
        const underMetamaskExtension: FixedPositionSettings = {
 | 
					        const underMetamaskExtension: FixedPositionSettings = {
 | 
				
			||||||
            type: 'fixed',
 | 
					            type: 'fixed',
 | 
				
			||||||
            top: '5px',
 | 
					            top: '10px',
 | 
				
			||||||
            right: '5px',
 | 
					            right: '10px',
 | 
				
			||||||
            tooltipPointerDisplay: 'none',
 | 
					            tooltipPointerDisplay: 'none',
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        const steps: Step[] = [
 | 
					        const steps: Step[] = [
 | 
				
			||||||
@@ -109,6 +109,8 @@ class PlainPortalOnboardingFlow extends React.Component<PortalOnboardingFlowProp
 | 
				
			|||||||
                content: <UnlockWalletOnboardingStep />,
 | 
					                content: <UnlockWalletOnboardingStep />,
 | 
				
			||||||
                shouldHideBackButton: true,
 | 
					                shouldHideBackButton: true,
 | 
				
			||||||
                shouldHideNextButton: true,
 | 
					                shouldHideNextButton: true,
 | 
				
			||||||
 | 
					                shouldCenterTitle: true,
 | 
				
			||||||
 | 
					                shouldRemoveExtraSpacing: true,
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                position: nextToWalletPosition,
 | 
					                position: nextToWalletPosition,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,9 +4,5 @@ import { Image } from 'ts/components/ui/image';
 | 
				
			|||||||
export interface UnlockWalletOnboardingStepProps {}
 | 
					export interface UnlockWalletOnboardingStepProps {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const UnlockWalletOnboardingStep: React.StatelessComponent<UnlockWalletOnboardingStepProps> = () => (
 | 
					export const UnlockWalletOnboardingStep: React.StatelessComponent<UnlockWalletOnboardingStepProps> = () => (
 | 
				
			||||||
    <div className="flex items-center flex-column">
 | 
					    <Image src="/images/unlock-mm.png" />
 | 
				
			||||||
        <div className="flex items-center flex-column">
 | 
					 | 
				
			||||||
            <Image src="/images/unlock-mm.png" />
 | 
					 | 
				
			||||||
        </div>
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user