Anastasia Poupeney
7 years ago
12 changed files with 222 additions and 139 deletions
@ -1,120 +0,0 @@ |
|||||
// @flow
|
|
||||
|
|
||||
import React, { Fragment } from 'react' |
|
||||
|
|
||||
import Box from 'components/base/Box' |
|
||||
import { colors } from 'styles/theme' |
|
||||
|
|
||||
import IconLedgerNanoSelectPIN from 'icons/illustrations/LedgerNanoSelectPIN' |
|
||||
import IconLedgerBlueSelectPIN from 'icons/illustrations/LedgerBlueSelectPIN' |
|
||||
import IconChevronRight from 'icons/ChevronRight' |
|
||||
|
|
||||
import { Title, Inner, OptionRow, IconOptionRow, DisclaimerBox } from '../helperComponents' |
|
||||
import OnboardingFooter from '../OnboardingFooter' |
|
||||
|
|
||||
import type { StepProps } from '..' |
|
||||
|
|
||||
// TODO: adjust for different wording based on the flow type when we have wording
|
|
||||
export default (props: StepProps) => { |
|
||||
const { nextStep, prevStep, t, onboarding } = props |
|
||||
const stepsLedgerNano = [ |
|
||||
{ |
|
||||
key: 'step1', |
|
||||
icon: <IconOptionRow>1.</IconOptionRow>, |
|
||||
desc: t('onboarding:selectPIN.instructions.ledgerNano.step1'), |
|
||||
}, |
|
||||
{ |
|
||||
key: 'step2', |
|
||||
icon: <IconOptionRow>2.</IconOptionRow>, |
|
||||
desc: t('onboarding:selectPIN.instructions.ledgerNano.step2'), |
|
||||
}, |
|
||||
{ |
|
||||
key: 'step3', |
|
||||
icon: <IconOptionRow>3.</IconOptionRow>, |
|
||||
desc: t('onboarding:selectPIN.instructions.ledgerNano.step3'), |
|
||||
}, |
|
||||
{ |
|
||||
key: 'step4', |
|
||||
icon: <IconOptionRow>4.</IconOptionRow>, |
|
||||
desc: t('onboarding:selectPIN.instructions.ledgerNano.step4'), |
|
||||
}, |
|
||||
] |
|
||||
|
|
||||
const stepsLedgerBlue = [ |
|
||||
{ |
|
||||
key: 'step1', |
|
||||
icon: <IconOptionRow>1.</IconOptionRow>, |
|
||||
desc: t('onboarding:selectPIN.instructions.ledgerBlue.step1'), |
|
||||
}, |
|
||||
{ |
|
||||
key: 'step2', |
|
||||
icon: <IconOptionRow>2.</IconOptionRow>, |
|
||||
desc: t('onboarding:selectPIN.instructions.ledgerBlue.step2'), |
|
||||
}, |
|
||||
{ |
|
||||
key: 'step3', |
|
||||
icon: <IconOptionRow>3.</IconOptionRow>, |
|
||||
desc: t('onboarding:selectPIN.instructions.ledgerBlue.step3'), |
|
||||
}, |
|
||||
] |
|
||||
const disclaimerNotes = [ |
|
||||
{ |
|
||||
key: 'note1', |
|
||||
icon: <IconChevronRight size={12} style={{ color: colors.smoke }} />, |
|
||||
desc: t('onboarding:selectPIN.disclaimer.note1'), |
|
||||
}, |
|
||||
{ |
|
||||
key: 'note2', |
|
||||
icon: <IconChevronRight size={12} style={{ color: colors.smoke }} />, |
|
||||
desc: t('onboarding:selectPIN.disclaimer.note2'), |
|
||||
}, |
|
||||
{ |
|
||||
key: 'note3', |
|
||||
icon: <IconChevronRight size={12} style={{ color: colors.smoke }} />, |
|
||||
desc: t('onboarding:selectPIN.disclaimer.note3'), |
|
||||
}, |
|
||||
] |
|
||||
return ( |
|
||||
<Box sticky pt={170}> |
|
||||
<Box grow alignItems="center"> |
|
||||
<Title>{t('onboarding:selectPIN.title')}</Title> |
|
||||
<Box align="center" mt={7}> |
|
||||
{onboarding.isLedgerNano ? ( |
|
||||
<Fragment> |
|
||||
<Inner style={{ width: 700 }}> |
|
||||
<Box style={{ width: 260, justifyContent: 'center', alignItems: 'center' }} mt={5}> |
|
||||
<IconLedgerNanoSelectPIN /> |
|
||||
</Box> |
|
||||
|
|
||||
<Box shrink grow flow={4}> |
|
||||
{stepsLedgerNano.map(step => <OptionRow key={step.key} step={step} />)} |
|
||||
</Box> |
|
||||
</Inner> |
|
||||
</Fragment> |
|
||||
) : ( |
|
||||
<Fragment> |
|
||||
<Inner style={{ width: 700 }}> |
|
||||
<Box style={{ width: 260, justifyContent: 'center', alignItems: 'center' }} mt={2}> |
|
||||
<IconLedgerBlueSelectPIN /> |
|
||||
</Box> |
|
||||
|
|
||||
<Box shrink grow flow={4}> |
|
||||
{stepsLedgerBlue.map(step => <OptionRow key={step.key} step={step} />)} |
|
||||
</Box> |
|
||||
</Inner> |
|
||||
</Fragment> |
|
||||
)} |
|
||||
<DisclaimerBox mt={6} disclaimerNotes={disclaimerNotes} /> |
|
||||
</Box> |
|
||||
</Box> |
|
||||
<OnboardingFooter |
|
||||
horizontal |
|
||||
align="center" |
|
||||
flow={2} |
|
||||
t={t} |
|
||||
nextStep={nextStep} |
|
||||
prevStep={prevStep} |
|
||||
/> |
|
||||
</Box> |
|
||||
) |
|
||||
} |
|
@ -0,0 +1,77 @@ |
|||||
|
// @flow
|
||||
|
import React, { PureComponent } from 'react' |
||||
|
import { translate } from 'react-i18next' |
||||
|
import { colors } from 'styles/theme' |
||||
|
|
||||
|
import Box from 'components/base/Box' |
||||
|
|
||||
|
import type { T } from 'types/common' |
||||
|
import IconLedgerBlueSelectPIN from 'icons/illustrations/LedgerBlueSelectPIN' |
||||
|
|
||||
|
import IconChevronRight from 'icons/ChevronRight' |
||||
|
|
||||
|
import { IconOptionRow, DisclaimerBox, OptionRow, Inner } from '../../helperComponents' |
||||
|
|
||||
|
type Props = { |
||||
|
t: T, |
||||
|
} |
||||
|
|
||||
|
class SelectPIN extends PureComponent<Props, *> { |
||||
|
render() { |
||||
|
const { t } = this.props |
||||
|
|
||||
|
const stepsLedgerBlue = [ |
||||
|
{ |
||||
|
key: 'step1', |
||||
|
icon: <IconOptionRow>1.</IconOptionRow>, |
||||
|
desc: t('onboarding:selectPIN.instructions.ledgerBlue.step1'), |
||||
|
}, |
||||
|
{ |
||||
|
key: 'step2', |
||||
|
icon: <IconOptionRow>2.</IconOptionRow>, |
||||
|
desc: t('onboarding:selectPIN.instructions.ledgerBlue.step2'), |
||||
|
}, |
||||
|
{ |
||||
|
key: 'step3', |
||||
|
icon: <IconOptionRow>3.</IconOptionRow>, |
||||
|
desc: t('onboarding:selectPIN.instructions.ledgerBlue.step3'), |
||||
|
}, |
||||
|
] |
||||
|
|
||||
|
const disclaimerNotes = [ |
||||
|
{ |
||||
|
key: 'note1', |
||||
|
icon: <IconChevronRight size={12} style={{ color: colors.smoke }} />, |
||||
|
desc: t('onboarding:selectPIN.disclaimer.note1'), |
||||
|
}, |
||||
|
{ |
||||
|
key: 'note2', |
||||
|
icon: <IconChevronRight size={12} style={{ color: colors.smoke }} />, |
||||
|
desc: t('onboarding:selectPIN.disclaimer.note2'), |
||||
|
}, |
||||
|
{ |
||||
|
key: 'note3', |
||||
|
icon: <IconChevronRight size={12} style={{ color: colors.smoke }} />, |
||||
|
desc: t('onboarding:selectPIN.disclaimer.note3'), |
||||
|
}, |
||||
|
] |
||||
|
|
||||
|
return ( |
||||
|
<Box align="center"> |
||||
|
<Inner style={{ width: 700 }}> |
||||
|
<Box style={{ width: 260, justifyContent: 'center', alignItems: 'center' }} mt={2}> |
||||
|
<IconLedgerBlueSelectPIN /> |
||||
|
</Box> |
||||
|
<Box mt={4}> |
||||
|
<Box shrink grow flow={4}> |
||||
|
{stepsLedgerBlue.map(step => <OptionRow key={step.key} step={step} />)} |
||||
|
</Box> |
||||
|
</Box> |
||||
|
</Inner> |
||||
|
<DisclaimerBox mt={6} disclaimerNotes={disclaimerNotes} /> |
||||
|
</Box> |
||||
|
) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export default translate()(SelectPIN) |
@ -0,0 +1,79 @@ |
|||||
|
// @flow
|
||||
|
import React, { PureComponent } from 'react' |
||||
|
import { translate } from 'react-i18next' |
||||
|
import { colors } from 'styles/theme' |
||||
|
|
||||
|
import Box from 'components/base/Box' |
||||
|
|
||||
|
import type { T } from 'types/common' |
||||
|
import IconLedgerNanoSelectPIN from 'icons/illustrations/LedgerNanoSelectPIN' |
||||
|
|
||||
|
import IconChevronRight from 'icons/ChevronRight' |
||||
|
|
||||
|
import { IconOptionRow, DisclaimerBox, OptionRow, Inner } from '../../helperComponents' |
||||
|
|
||||
|
type Props = { |
||||
|
t: T, |
||||
|
} |
||||
|
|
||||
|
class SelectPINnano extends PureComponent<Props, *> { |
||||
|
render() { |
||||
|
const { t } = this.props |
||||
|
|
||||
|
const stepsLedgerNano = [ |
||||
|
{ |
||||
|
key: 'step1', |
||||
|
icon: <IconOptionRow>1.</IconOptionRow>, |
||||
|
desc: t('onboarding:selectPIN.instructions.ledgerNano.step1'), |
||||
|
}, |
||||
|
{ |
||||
|
key: 'step2', |
||||
|
icon: <IconOptionRow>2.</IconOptionRow>, |
||||
|
desc: t('onboarding:selectPIN.instructions.ledgerNano.step2'), |
||||
|
}, |
||||
|
{ |
||||
|
key: 'step3', |
||||
|
icon: <IconOptionRow>3.</IconOptionRow>, |
||||
|
desc: t('onboarding:selectPIN.instructions.ledgerNano.step3'), |
||||
|
}, |
||||
|
{ |
||||
|
key: 'step4', |
||||
|
icon: <IconOptionRow>4.</IconOptionRow>, |
||||
|
desc: t('onboarding:selectPIN.instructions.ledgerNano.step4'), |
||||
|
}, |
||||
|
] |
||||
|
const disclaimerNotes = [ |
||||
|
{ |
||||
|
key: 'note1', |
||||
|
icon: <IconChevronRight size={12} style={{ color: colors.smoke }} />, |
||||
|
desc: t('onboarding:selectPIN.disclaimer.note1'), |
||||
|
}, |
||||
|
{ |
||||
|
key: 'note2', |
||||
|
icon: <IconChevronRight size={12} style={{ color: colors.smoke }} />, |
||||
|
desc: t('onboarding:selectPIN.disclaimer.note2'), |
||||
|
}, |
||||
|
{ |
||||
|
key: 'note3', |
||||
|
icon: <IconChevronRight size={12} style={{ color: colors.smoke }} />, |
||||
|
desc: t('onboarding:selectPIN.disclaimer.note3'), |
||||
|
}, |
||||
|
] |
||||
|
|
||||
|
return ( |
||||
|
<Box align="center" mt={3}> |
||||
|
<Inner style={{ width: 700 }}> |
||||
|
<Box style={{ width: 260, justifyContent: 'center', alignItems: 'center' }} mt={5}> |
||||
|
<IconLedgerNanoSelectPIN /> |
||||
|
</Box> |
||||
|
<Box shrink grow flow={4}> |
||||
|
{stepsLedgerNano.map(step => <OptionRow key={step.key} step={step} />)} |
||||
|
</Box> |
||||
|
</Inner> |
||||
|
<DisclaimerBox mt={6} disclaimerNotes={disclaimerNotes} /> |
||||
|
</Box> |
||||
|
) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export default translate()(SelectPINnano) |
@ -0,0 +1,28 @@ |
|||||
|
// @flow
|
||||
|
|
||||
|
import React from 'react' |
||||
|
|
||||
|
import Box from 'components/base/Box' |
||||
|
|
||||
|
import { Title } from '../../helperComponents' |
||||
|
import OnboardingFooter from '../../OnboardingFooter' |
||||
|
import SelectPINnano from './SelectPINnano' |
||||
|
import SelectPINblue from './SelectPINblue' |
||||
|
|
||||
|
import type { StepProps } from '../..' |
||||
|
|
||||
|
export default (props: StepProps) => { |
||||
|
const { nextStep, prevStep, t, onboarding } = props |
||||
|
|
||||
|
return ( |
||||
|
<Box sticky pt={170}> |
||||
|
<Box grow alignItems="center"> |
||||
|
<Title>{t('onboarding:selectPIN.title')}</Title> |
||||
|
<Box align="center" mt={7}> |
||||
|
{onboarding.isLedgerNano ? <SelectPINnano /> : <SelectPINblue />} |
||||
|
</Box> |
||||
|
</Box> |
||||
|
<OnboardingFooter horizontal flow={2} t={t} nextStep={nextStep} prevStep={prevStep} /> |
||||
|
</Box> |
||||
|
) |
||||
|
} |
Loading…
Reference in new issue