From 0a869d2525145b7b2c11766474b2cb4676352dd1 Mon Sep 17 00:00:00 2001 From: Anastasia Poupeney Date: Thu, 7 Jun 2018 18:54:14 +0200 Subject: [PATCH 1/3] pixel fixes wip onboarding --- electron-builder.yml | 2 + src/components/Onboarding/OnboardingFooter.js | 22 ++++++++-- src/components/Onboarding/helperComponents.js | 4 +- .../Onboarding/steps/GenuineCheck.js | 4 +- src/components/Onboarding/steps/Init.js | 36 +++++++-------- .../Onboarding/steps/SelectDevice.js | 33 +++++++++----- .../steps/SelectPIN/SelectPINnano.js | 6 +-- .../Onboarding/steps/SelectPIN/index.js | 4 +- .../steps/WriteSeed/WriteSeedNano.js | 9 ++-- .../Onboarding/steps/WriteSeed/index.js | 4 +- src/icons/illustrations/LedgerBlue.js | 16 +++---- .../illustrations/LedgerNanoSelectPIN.js | 44 ++++++------------- src/icons/illustrations/WriteSeed.js | 17 +++---- src/reducers/onboarding.js | 4 +- static/i18n/en/onboarding.yml | 2 +- 15 files changed, 107 insertions(+), 100 deletions(-) diff --git a/electron-builder.yml b/electron-builder.yml index d14b428f..cfe58724 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -1,5 +1,7 @@ appId: com.ledger.live +npmRebuild: false + protocols: name: Ledger Live schemes: diff --git a/src/components/Onboarding/OnboardingFooter.js b/src/components/Onboarding/OnboardingFooter.js index dcaff84c..2e56d1f0 100644 --- a/src/components/Onboarding/OnboardingFooter.js +++ b/src/components/Onboarding/OnboardingFooter.js @@ -13,7 +13,7 @@ const Wrapper = styled(Box).attrs({ px: 5, py: 3, })` - border-top: 2px solid ${p => p.theme.colors.lightGrey}; + border-top: 1px solid ${p => p.theme.colors.lightFog}; border-bottom-left-radius: ${radii[1]}px; border-bottom-right-radius: ${radii[1]}px; ` @@ -22,15 +22,31 @@ type Props = { t: T, nextStep: () => void, prevStep: () => void, + jumpStep?: string => void, + jumpTo?: string, isContinueDisabled?: boolean, } -const OnboardingFooter = ({ t, nextStep, prevStep, isContinueDisabled, ...props }: Props) => ( +const OnboardingFooter = ({ + t, + nextStep, + prevStep, + isContinueDisabled, + jumpStep, + jumpTo, + ...props +}: Props) => ( - diff --git a/src/components/Onboarding/helperComponents.js b/src/components/Onboarding/helperComponents.js index aa6cf988..f2b905fa 100644 --- a/src/components/Onboarding/helperComponents.js +++ b/src/components/Onboarding/helperComponents.js @@ -64,7 +64,7 @@ export const OptionRowDesc = styled(Box).attrs({ textAlign: 'left', color: 'smoke', grow: true, - pl: 3, + pl: 2, })`` export const IconOptionRow = styled(Box).attrs({ @@ -92,7 +92,7 @@ const DisclaimerBoxContainer = styled(Box).attrs({ borderRadius: '4px', bg: '#f9f9f980', })` - min-width: 680px; + min-width: 620px; border: 1px dashed ${p => p.theme.colors.fog}; ` const DisclaimerBoxIconContainer = styled(Box).attrs({ diff --git a/src/components/Onboarding/steps/GenuineCheck.js b/src/components/Onboarding/steps/GenuineCheck.js index 337b30bc..32b91bad 100644 --- a/src/components/Onboarding/steps/GenuineCheck.js +++ b/src/components/Onboarding/steps/GenuineCheck.js @@ -295,8 +295,8 @@ const CardWrapper = styled(Card).attrs({ flow: 2, justify: 'space-between', })` - height: 97px; - width: 620px; + width: 550px; + height: 70px; border: ${p => `1px ${p.isDisabled ? 'dashed' : 'solid'} ${p.theme.colors.fog}`}; pointer-events: ${p => (p.isDisabled ? 'none' : 'auto')}; background-color: ${p => (p.isDisabled ? p.theme.colors.lightGrey : p.theme.colors.white)}; diff --git a/src/components/Onboarding/steps/Init.js b/src/components/Onboarding/steps/Init.js index fe2fd881..2d0cf31e 100644 --- a/src/components/Onboarding/steps/Init.js +++ b/src/components/Onboarding/steps/Init.js @@ -27,7 +27,7 @@ class Init extends PureComponent { const optionCards = [ { key: 'newDevice', - icon: , + icon: , title: t('onboarding:init.newDevice.title'), onClick: () => { nextStep() @@ -36,7 +36,7 @@ class Init extends PureComponent { }, { key: 'restoreDevice', - icon: , + icon: , title: t('onboarding:init.restoreDevice.title'), onClick: () => { nextStep() @@ -45,7 +45,7 @@ class Init extends PureComponent { }, { key: 'initializedDevice', - icon: , + icon: , title: t('onboarding:init.initializedDevice.title'), onClick: () => { nextStep() @@ -54,7 +54,7 @@ class Init extends PureComponent { }, { key: 'noDevice', - icon: , + icon: , title: t('onboarding:init.noDevice.title'), onClick: () => { shell.openExternal('https://www.ledger.fr/') @@ -64,15 +64,15 @@ class Init extends PureComponent { ] return ( - - + + - + {t('onboarding:init.title')} - + {optionCards.map(card => )} @@ -102,21 +102,25 @@ export function OptionFlowCard({ card }: { card: CardType }) { {title} - - + + ) } -const InitCardContainer = styled(Card).attrs({ +const InitCardContainer = styled(Box).attrs({ p: 3, horizontal: true, borderRadius: '4px', })` border: 1px solid ${p => p.theme.colors.fog}; - width: 550px; + width: 530px; height: 70px; + &:hover { + cursor: pointer; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.05); + } ` export const CardTitle = styled(Box).attrs({ @@ -126,12 +130,8 @@ export const CardTitle = styled(Box).attrs({ })`` const InitIconContainer = styled(Box).attrs({ - mx: 4, - my: 3, + ml: 3, + mr: 4, })` - width: 40px; - height: 40px; - border-radius: 50%; - background: rgba(100, 144, 241, 0.1); text-align: -webkit-center; ` diff --git a/src/components/Onboarding/steps/SelectDevice.js b/src/components/Onboarding/steps/SelectDevice.js index 9a99480a..2357ce27 100644 --- a/src/components/Onboarding/steps/SelectDevice.js +++ b/src/components/Onboarding/steps/SelectDevice.js @@ -7,6 +7,7 @@ import { rgba } from 'styles/helpers' import { isLedgerNano } from 'reducers/onboarding' +import OnboardingFooter from '../OnboardingFooter' import Box from 'components/base/Box' import IconCheckCirle from 'icons/Check' import IconLedgerNano from 'icons/illustrations/LedgerNano' @@ -20,18 +21,17 @@ const mapDispatchToProps = { isLedgerNano } class SelectDevice extends PureComponent { handleIsLedgerNano = (isLedgerNano: boolean) => { this.props.isLedgerNano(isLedgerNano) - this.props.onboarding.flowType === 'initializedDevice' - ? this.props.jumpStep('genuineCheck') - : this.props.nextStep() } render() { - const { t, onboarding } = this.props - + const { t, onboarding, nextStep, prevStep, jumpStep } = this.props + console.log('wewee: ', onboarding.isLedgerNano) return ( - - - {t('onboarding:selectDevice.title')} - + + + + {t('onboarding:selectDevice.title')} + + { {t('onboarding:selectDevice.ledgerNanoCard.title')} this.handleIsLedgerNano(false)} > - {!onboarding.isLedgerNano && } + {!onboarding.isLedgerNano && onboarding.isLedgerNano !== null && } @@ -56,6 +56,16 @@ class SelectDevice extends PureComponent { + ) } @@ -70,6 +80,7 @@ const DeviceContainer = styled(Box).attrs({ alignItems: 'center', justifyContent: 'center', relative: true, + borderRadius: '4px', })` width: 218px; height: 204px; diff --git a/src/components/Onboarding/steps/SelectPIN/SelectPINnano.js b/src/components/Onboarding/steps/SelectPIN/SelectPINnano.js index dfe794c3..ceeb552c 100644 --- a/src/components/Onboarding/steps/SelectPIN/SelectPINnano.js +++ b/src/components/Onboarding/steps/SelectPIN/SelectPINnano.js @@ -63,10 +63,8 @@ class SelectPINnano extends PureComponent { return ( - - - - + + {stepsLedgerNano.map(step => )} diff --git a/src/components/Onboarding/steps/SelectPIN/index.js b/src/components/Onboarding/steps/SelectPIN/index.js index 276de841..209bec3e 100644 --- a/src/components/Onboarding/steps/SelectPIN/index.js +++ b/src/components/Onboarding/steps/SelectPIN/index.js @@ -15,8 +15,8 @@ export default (props: StepProps) => { const { nextStep, prevStep, t, onboarding } = props return ( - - + + {t('onboarding:selectPIN.title')} {onboarding.isLedgerNano ? : } diff --git a/src/components/Onboarding/steps/WriteSeed/WriteSeedNano.js b/src/components/Onboarding/steps/WriteSeed/WriteSeedNano.js index 250e6cd4..f86ff293 100644 --- a/src/components/Onboarding/steps/WriteSeed/WriteSeedNano.js +++ b/src/components/Onboarding/steps/WriteSeed/WriteSeedNano.js @@ -72,12 +72,13 @@ class WriteSeedNano extends PureComponent { {t('onboarding:writeSeed.nano.title')} {t('onboarding:writeSeed.nano.desc')} - - - + + + - + + {steps.map(step => )} diff --git a/src/components/Onboarding/steps/WriteSeed/index.js b/src/components/Onboarding/steps/WriteSeed/index.js index df9264eb..e0306307 100644 --- a/src/components/Onboarding/steps/WriteSeed/index.js +++ b/src/components/Onboarding/steps/WriteSeed/index.js @@ -16,8 +16,8 @@ export default (props: StepProps) => { const { nextStep, prevStep, t, onboarding } = props return ( - - + + {onboarding.flowType === 'restoreDevice' ? ( ) : onboarding.isLedgerNano ? ( diff --git a/src/icons/illustrations/LedgerBlue.js b/src/icons/illustrations/LedgerBlue.js index 781df02d..739afc2c 100644 --- a/src/icons/illustrations/LedgerBlue.js +++ b/src/icons/illustrations/LedgerBlue.js @@ -3,12 +3,12 @@ import React from 'react' export default () => ( - + - + ( rx="3.2" /> ( - - - + + + + - @@ -46,21 +39,12 @@ export default () => ( stroke="#142533" strokeLinejoin="square" strokeWidth="2" - d="M91 1a3 3 0 0 0-3 3v108.144C88 123.11 96.89 132 107.856 132c10.966 0 19.855-8.89 19.855-19.856V4a3 3 0 0 0-3-3H91z" - /> - + ( - + ( strokeWidth="1.8" rx="3.6" /> + ( fillRule="nonzero" stroke="#6490F1" strokeWidth="2" - d="M85.623 57.047a17.987 17.987 0 0 1 6.194 13.596c0 9.92-8.032 17.99-17.909 17.99-9.876 0-17.908-8.07-17.908-17.99a17.986 17.986 0 0 1 6.194-13.596v-3.281C62.194 47.278 67.447 42 73.908 42c6.462 0 11.715 5.278 11.715 11.766v3.28zM73.809 74.193zm.003-.018v4.55a.1.1 0 0 0 .096.102.1.1 0 0 0 .097-.102v-4.55a3.149 3.149 0 0 1-.006-.054l-.088-.899.885-.179a4.505 4.505 0 0 0 3.596-4.42c0-2.493-2.008-4.51-4.484-4.51-2.475 0-4.483 2.018-4.483 4.51a4.505 4.505 0 0 0 3.596 4.42l.885.18-.088.898a3.149 3.149 0 0 1-.006.054zm.196.018a.1.1 0 0 0 0 .004v-.004zm0 .004v-.002zm-7.62-19.876a17.719 17.719 0 0 1 7.52-1.668c2.633 0 5.186.577 7.521 1.668v-.555c0-4.17-3.375-7.562-7.52-7.562-4.146 0-7.521 3.392-7.521 7.562v.555z" + d="M85.623 56.047a17.987 17.987 0 0 1 6.194 13.596c0 9.92-8.032 17.99-17.909 17.99-9.876 0-17.908-8.07-17.908-17.99a17.986 17.986 0 0 1 6.194-13.596v-3.281C62.194 46.278 67.447 41 73.908 41c6.462 0 11.715 5.278 11.715 11.766v3.28zM73.809 73.193zm.003-.018v4.55a.1.1 0 0 0 .096.102.1.1 0 0 0 .097-.102v-4.55a3.149 3.149 0 0 1-.006-.054l-.088-.899.885-.179a4.505 4.505 0 0 0 3.596-4.42c0-2.493-2.008-4.51-4.484-4.51-2.475 0-4.483 2.018-4.483 4.51a4.505 4.505 0 0 0 3.596 4.42l.885.18-.088.898a3.149 3.149 0 0 1-.006.054zm.196.018a.1.1 0 0 0 0 .004v-.004zm0 .004v-.002zm-7.62-19.876a17.719 17.719 0 0 1 7.52-1.668c2.633 0 5.186.577 7.521 1.668v-.555c0-4.17-3.375-7.562-7.52-7.562-4.146 0-7.521 3.392-7.521 7.562v.555z" /> - {/* - - RECOVERY PHRASE - - */} - ) diff --git a/src/reducers/onboarding.js b/src/reducers/onboarding.js index 91837e3a..3c57ba63 100644 --- a/src/reducers/onboarding.js +++ b/src/reducers/onboarding.js @@ -23,7 +23,7 @@ export type OnboardingState = { isGenuineFail: boolean, isDeviceGenuine: boolean, }, - isLedgerNano: boolean, + isLedgerNano: boolean | null, flowType: string, } @@ -36,7 +36,7 @@ const state: OnboardingState = { isGenuineFail: false, isDeviceGenuine: false, }, - isLedgerNano: true, + isLedgerNano: null, flowType: '', steps: [ { diff --git a/static/i18n/en/onboarding.yml b/static/i18n/en/onboarding.yml index 35baff43..e0ed0394 100644 --- a/static/i18n/en/onboarding.yml +++ b/static/i18n/en/onboarding.yml @@ -12,7 +12,7 @@ init: title: I have already initialized my device desc: Please replace it with the final wording once it’s done. noDevice: - title: Do not have a Ledger device yet? Buy one + title: Do not have a Ledger device yet? desc: Please replace it with the final wording once it’s done. selectDevice: title: To get started, select your device From 8def4f5571e4f665ed0313fb4b2ac3a261c0c688 Mon Sep 17 00:00:00 2001 From: Anastasia Poupeney Date: Fri, 8 Jun 2018 11:36:53 +0200 Subject: [PATCH 2/3] pixel polish, a few functional fixes, some new icons --- src/components/Onboarding/OnboardingFooter.js | 2 +- src/components/Onboarding/helperComponents.js | 4 +- src/components/Onboarding/steps/Analytics.js | 35 +++++------ .../Onboarding/steps/GenuineCheck.js | 61 +++++++++---------- src/components/Onboarding/steps/Init.js | 2 +- .../Onboarding/steps/SelectDevice.js | 3 +- .../steps/SelectPIN/SelectPINblue.js | 6 +- src/components/base/Button/index.js | 11 ++++ .../illustrations/LedgerNanoSelectPIN.js | 1 + .../illustrations/SensitiveOperationShield.js | 61 +++++++++++++++++++ 10 files changed, 127 insertions(+), 59 deletions(-) create mode 100644 src/icons/illustrations/SensitiveOperationShield.js diff --git a/src/components/Onboarding/OnboardingFooter.js b/src/components/Onboarding/OnboardingFooter.js index 2e56d1f0..c2658001 100644 --- a/src/components/Onboarding/OnboardingFooter.js +++ b/src/components/Onboarding/OnboardingFooter.js @@ -37,7 +37,7 @@ const OnboardingFooter = ({ ...props }: Props) => ( -