From 4edbcfbfd46221dc0dd4c3211af148bb83ba8e09 Mon Sep 17 00:00:00 2001 From: "Valentin D. Pinkman" Date: Tue, 19 Feb 2019 16:29:03 +0100 Subject: [PATCH] LL-636 recover nano x from passphrase in onboarding --- .../steps/SelectPIN/SelectPINRestoreNanoX.js | 82 +++++++++++++++++++ .../Onboarding/steps/SelectPIN/index.js | 3 +- static/i18n/en/app.json | 7 ++ 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 src/components/Onboarding/steps/SelectPIN/SelectPINRestoreNanoX.js diff --git a/src/components/Onboarding/steps/SelectPIN/SelectPINRestoreNanoX.js b/src/components/Onboarding/steps/SelectPIN/SelectPINRestoreNanoX.js new file mode 100644 index 00000000..997bb4ae --- /dev/null +++ b/src/components/Onboarding/steps/SelectPIN/SelectPINRestoreNanoX.js @@ -0,0 +1,82 @@ +// @flow +import React, { PureComponent } from 'react' +import { translate } from 'react-i18next' +import { colors } from 'styles/theme' +import { i } from 'helpers/staticPath' + +import Box from 'components/base/Box' + +import type { T } from 'types/common' + +import IconChevronRight from 'icons/ChevronRight' + +import { IconOptionRow, DisclaimerBox, OptionRow, Inner } from '../../helperComponents' + +type Props = { + t: T, +} + +class SelectPINrestoreNanoX extends PureComponent { + render() { + const { t } = this.props + + const stepsLedgerNano = [ + { + key: 'step1', + icon: {'1.'}, + desc: t('onboarding.selectPIN.restore.instructions.nanoX.step1'), + }, + { + key: 'step2', + icon: {'2.'}, + desc: t('onboarding.selectPIN.restore.instructions.nanoX.step2'), + }, + { + key: 'step3', + icon: {'3.'}, + desc: t('onboarding.selectPIN.restore.instructions.nanoX.step3'), + }, + { + key: 'step4', + icon: {'4.'}, + desc: t('onboarding.selectPIN.restore.instructions.nanoX.step4'), + }, + { + key: 'step5', + icon: {'5.'}, + desc: t('onboarding.selectPIN.restore.instructions.nanoX.step5'), + }, + ] + const disclaimerNotes = [ + { + key: 'note1', + icon: , + desc: t('onboarding.selectPIN.disclaimer.note1'), + }, + { + key: 'note2', + icon: , + desc: t('onboarding.selectPIN.disclaimer.note2'), + }, + { + key: 'note3', + icon: , + desc: t('onboarding.selectPIN.disclaimer.note3'), + }, + ] + + return ( + + + + + {stepsLedgerNano.map(step => )} + + + + + ) + } +} + +export default translate()(SelectPINrestoreNanoX) diff --git a/src/components/Onboarding/steps/SelectPIN/index.js b/src/components/Onboarding/steps/SelectPIN/index.js index 603d9cb7..bef8b153 100644 --- a/src/components/Onboarding/steps/SelectPIN/index.js +++ b/src/components/Onboarding/steps/SelectPIN/index.js @@ -14,13 +14,14 @@ import SelectPINnano from './SelectPINnano' import SelectPINblue from './SelectPINblue' import SelectPINnanoX from './SelectPINnanoX' import SelectPINrestoreNano from './SelectPINrestoreNano' +import SelectPINRestoreNanoX from './SelectPINRestoreNanoX' import SelectPINrestoreBlue from './SelectPINrestoreBlue' import type { StepProps } from '../..' const SelectPin = ({ modelId, restore = false }: { modelId: DeviceModelId, restore?: boolean }) => { switch (modelId) { case 'nanoX': - return restore ? : // TODO: Restore NanoX + return restore ? : case 'blue': return restore ? : default: diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 0080018a..d4c82529 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -602,6 +602,13 @@ "step3": "Press the left or right button to select a digit. Press both buttons to validate.", "step4": "Select ✓ to confirm your PIN code. Select ⬅ to erase a digit." }, + "nanoX": { + "step1": "Connect your Ledger Nano X to your computer.", + "step2": "Press both buttons as instructed on your Ledger Nano X screen.", + "step3": "Press the left button to cancel Configure as new device.", + "step4": "Press the right button to select Restore configuration.", + "step5": "Choose a PIN code between 4 and 8 digits long." + }, "blue": { "step1": "Connect the Ledger Blue to your computer.", "step2": "Tap on <1><0>Restore configuration.",