From 7799ae79781f6b9dd6549b5940def27d12f7ab39 Mon Sep 17 00:00:00 2001 From: NastiaS Date: Wed, 16 May 2018 13:32:18 +0200 Subject: [PATCH] selectPIN screen, chooseDevice screen --- src/components/Onboarding/index.js | 4 +- .../Onboarding/steps/ChooseDevice.js | 46 ++++++--- src/components/Onboarding/steps/ChoosePIN.js | 93 ++++++++++++++++--- src/components/Onboarding/steps/Init.js | 27 +++--- src/components/Onboarding/steps/Start.js | 6 +- src/icons/onboarding/LedgerBlue.js | 32 +++++++ src/icons/onboarding/LedgerNano.js | 36 +++++++ src/icons/onboarding/SelectPIN.js | 75 +++++++++++++++ static/i18n/en/onboarding.yml | 34 +++++++ 9 files changed, 306 insertions(+), 47 deletions(-) create mode 100644 src/icons/onboarding/LedgerBlue.js create mode 100644 src/icons/onboarding/LedgerNano.js create mode 100644 src/icons/onboarding/SelectPIN.js create mode 100644 static/i18n/en/onboarding.yml diff --git a/src/components/Onboarding/index.js b/src/components/Onboarding/index.js index ca9dbdf7..8fe5e2a8 100644 --- a/src/components/Onboarding/index.js +++ b/src/components/Onboarding/index.js @@ -128,7 +128,7 @@ class Onboarding extends PureComponent { const Container = styled(Box).attrs({ bg: 'white', - p: 5, + p: 60, })` position: fixed; top: 0; @@ -138,6 +138,6 @@ const Container = styled(Box).attrs({ z-index: 25; ` const StepContainer = styled(Box).attrs({ - p: 20, + p: 40, })`` export default compose(connect(mapStateToProps, mapDispatchToProps), translate())(Onboarding) diff --git a/src/components/Onboarding/steps/ChooseDevice.js b/src/components/Onboarding/steps/ChooseDevice.js index 7da5e8a8..582ad42d 100644 --- a/src/components/Onboarding/steps/ChooseDevice.js +++ b/src/components/Onboarding/steps/ChooseDevice.js @@ -4,39 +4,40 @@ import React from 'react' import styled from 'styled-components' import Box from 'components/base/Box' -import IconNanoS from 'icons/device/NanoS' -import IconBlue from 'icons/device/Blue' +import IconLedgerNano from 'icons/onboarding/LedgerNano' +import IconLedgerBlue from 'icons/onboarding/LedgerBlue' import { Title, Description, Inner } from '../helperComponents' import type { StepProps } from '..' export default (props: StepProps) => { - const { nextStep } = props + const { nextStep, t } = props return ( - This is the title of the screen. 1 line is the maximum - - This is a long text, please replace it with the final wording once it’s done. -
- Lorem ipsum dolor amet ledger lorem dolor ipsum amet -
+ {t('onboarding:chooseDevice.title')} + {/* TODO shrink description so it forms 2 lines */} + {t('onboarding:chooseDevice.desc')} nextStep()}> - + - Ledger Nano S - Please replace it with the final wording once it’s done. + {t('onboarding:chooseDevice.ledgerNanoCard.title')} + + {t('onboarding:chooseDevice.ledgerNanoCard.desc')} + - + - Ledger Blue - Please replace it with the final wording once it’s done. + {t('onboarding:chooseDevice.ledgerBlueCard.title')} + + {t('onboarding:chooseDevice.ledgerBlueCard.desc')} + @@ -59,4 +60,19 @@ const DeviceIcon = styled(Box).attrs({ color: 'graphite', })` width: 55px; + min-height: 80px; +` +export const BlockDescription = styled(Box).attrs({ + ff: 'Open Sans|Regular', + fontSize: 4, + textAlign: 'center', + color: 'smoke', +})`` +export const BlockTitle = styled(Box).attrs({ + ff: 'Open Sans|Regular', + fontSize: 4, + textAlign: 'center', +})` + font-weight: 600; + padding-bottom: 10px; ` diff --git a/src/components/Onboarding/steps/ChoosePIN.js b/src/components/Onboarding/steps/ChoosePIN.js index 794f4b71..48cabebb 100644 --- a/src/components/Onboarding/steps/ChoosePIN.js +++ b/src/components/Onboarding/steps/ChoosePIN.js @@ -4,30 +4,99 @@ import React from 'react' import Box from 'components/base/Box' import Button from 'components/base/Button' -import { Title, Description, OnboardingFooter } from '../helperComponents' +import styled from 'styled-components' + +import IconSelectPIN from 'icons/onboarding/SelectPIN' +import { Title, Description, OnboardingFooter, Inner } from '../helperComponents' import type { StepProps } from '..' +export const IconSelectStep = styled(Box).attrs({ + width: 26, + height: 26, + textAlign: 'center', +})` + border-radius: 100%; + background: #6490f126; +` + export default (props: StepProps) => { - const { nextStep, prevStep } = props + const { nextStep, prevStep, t } = props + const steps = [ + { + key: 'step1', + icon: 1, + desc: t('onboarding:selectPIN.instructions.step1'), + }, + { + key: 'step2', + icon: 2, + desc: t('onboarding:selectPIN.instructions.step2'), + }, + { + key: 'step3', + icon: 3, + desc: t('onboarding:selectPIN.instructions.step3'), + }, + { + key: 'step4', + icon: 4, + desc: t('onboarding:selectPIN.instructions.step4'), + }, + ] return ( - - - This is CHOOSE PIN screen. 1 line is the maximum - - This is a long text, please replace it with the final wording once it’s done. -
- Lorem ipsum dolor amet ledger lorem dolor ipsum amet -
+ + + + {t('onboarding:selectPIN.title')} + {t('onboarding:selectPIN.desc')} + + + + + + + + + {steps.map(step => )} + + + - + - ) } + +type StepType = { + icon: any, + desc: string, +} +export function SelectPINStep({ step }: { step: StepType }) { + const { icon, desc } = step + return ( + + + {icon} + + + {desc} + + + ) +} + +export const CardDescription = styled(Box).attrs({ + ff: 'Open Sans|Regular', + fontSize: 4, + textAlign: 'left', + color: 'smoke', + shrink: 1, +})`` diff --git a/src/components/Onboarding/steps/Init.js b/src/components/Onboarding/steps/Init.js index 99a5d759..355ded40 100644 --- a/src/components/Onboarding/steps/Init.js +++ b/src/components/Onboarding/steps/Init.js @@ -12,34 +12,34 @@ import { Title } from '../helperComponents' import type { StepProps } from '..' export default (props: StepProps) => { - const { nextStep, jumpStep } = props + const { nextStep, jumpStep, t } = props const optionCards = [ { key: 'newDevice', icon: , - title: 'Initialize your new Ledger device', - desc: 'Please replace it with the final wording once it’s done.', + title: t('onboarding:init.newDevice.title'), + desc: t('onboarding:init.newDevice.desc'), onClick: () => nextStep(), }, { key: 'restoreDevice', icon: , - title: 'Restore a Ledger device', - desc: 'Please replace it with the final wording once it’s done.', + title: t('onboarding:init.restoreDevice.title'), + desc: t('onboarding:init.restoreDevice.desc'), onClick: () => jumpStep('choosePIN'), }, { key: 'initializedDevice', icon: , - title: 'I have already initialized my device', - desc: 'Please replace it with the final wording once it’s done.', + title: t('onboarding:init.initializedDevice.title'), + desc: t('onboarding:init.initializedDevice.desc'), onClick: () => jumpStep('choosePIN'), }, { key: 'noDevice', icon: , - title: 'Do not have a Ledger device yet? Buy one', - desc: 'Please replace it with the final wording once it’s done.', + title: t('onboarding:init.noDevice.title'), + desc: t('onboarding:init.noDevice.desc'), onClick: () => shell.openExternal('https://www.ledger.fr/'), }, ] @@ -51,10 +51,7 @@ export default (props: StepProps) => {
- - Welcome to Ledger Live, the computer companion app to your Ledger device. Please select - one of the options below: - + {t('onboarding:init.title')} {optionCards.map(card => )}
@@ -64,8 +61,8 @@ export default (props: StepProps) => { type CardType = { icon: any, - desc: string, - title: string, + desc: any, + title: any, onClick: Function, } diff --git a/src/components/Onboarding/steps/Start.js b/src/components/Onboarding/steps/Start.js index ab948625..773c9cfa 100644 --- a/src/components/Onboarding/steps/Start.js +++ b/src/components/Onboarding/steps/Start.js @@ -10,14 +10,14 @@ import type { StepProps } from '..' import { Title, Description } from '../helperComponents' export default (props: StepProps) => { - const { jumpStep } = props + const { jumpStep, t } = props return ( - Welcome to the new Ledger Live Desktop app. - Let’s get started! + {t('onboarding:start.title')} + {t('onboarding:start.desc')}