From 9228600522c16d548ef5512450a48bfaa7c1fdda Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Sun, 25 Nov 2018 16:52:23 +0100 Subject: [PATCH 1/6] Moves the account exporter from the experimental to a top level tab Tried to stay as true as possible to the design while removing the references to QrCodes I kept the experimental tab available but without content right now. --- src/components/Onboarding/helperComponents.js | 13 ++ src/components/SettingsPage/index.js | 6 + .../SettingsPage/sections/Export.js | 166 ++++++++++++++++++ src/components/SettingsPage/sections/Tools.js | 42 +---- .../Receive/steps/02-step-connect-device.js | 2 +- src/components/modals/Send/index.js | 10 +- static/i18n/en/app.json | 13 ++ 7 files changed, 205 insertions(+), 47 deletions(-) create mode 100644 src/components/SettingsPage/sections/Export.js diff --git a/src/components/Onboarding/helperComponents.js b/src/components/Onboarding/helperComponents.js index c9e62747..632d79e3 100644 --- a/src/components/Onboarding/helperComponents.js +++ b/src/components/Onboarding/helperComponents.js @@ -69,6 +69,19 @@ export function OptionRow({ step, ...p }: { step: StepType }) { ) } +export function BulletRow({ step, ...p }: { step: StepType }) { + const { icon, desc } = step + return ( + + + {icon} + + + {desc} + + + ) +} export const OptionRowDesc = styled(Box).attrs({ ff: 'Open Sans|Regular', fontSize: 4, diff --git a/src/components/SettingsPage/index.js b/src/components/SettingsPage/index.js index 5652f5f3..35afee4d 100644 --- a/src/components/SettingsPage/index.js +++ b/src/components/SettingsPage/index.js @@ -15,6 +15,7 @@ import SectionDisplay from './sections/Display' import SectionCurrencies from './sections/Currencies' import SectionHelp from './sections/Help' import SectionAbout from './sections/About' +import SectionExport from './sections/Export' import SectionTools from './sections/Tools' const mapStateToProps = state => ({ @@ -48,6 +49,11 @@ class SettingsPage extends PureComponent { label: , value: SectionCurrencies, }, + { + key: 'export', + label: , + value: SectionExport, + }, { key: 'about', label: , diff --git a/src/components/SettingsPage/sections/Export.js b/src/components/SettingsPage/sections/Export.js new file mode 100644 index 00000000..a00c6c72 --- /dev/null +++ b/src/components/SettingsPage/sections/Export.js @@ -0,0 +1,166 @@ +// @flow + +import React, { PureComponent } from 'react' +import { Trans, translate } from 'react-i18next' + +import type { T } from 'types/common' + +import TrackPage from 'analytics/TrackPage' +import styled from 'styled-components' +import { SettingsSection as Section, SettingsSectionHeader as Header } from '../SettingsSection' +import IconShare from '../../../icons/Share' +import Button from '../../base/Button' +import Modal, { ModalBody, ModalContent, ModalFooter, ModalTitle } from '../../base/Modal' +import Box from '../../base/Box' +import QRCodeExporter from '../../QRCodeExporter' +import { BulletRow } from '../../Onboarding/helperComponents' +import Text from '../../base/Text' + +const BulletRowIcon = styled(Box).attrs({ + ff: 'Open Sans|Regular', + fontSize: 12, + textAlign: 'center', + color: 'wallet', + pl: 2, +})` + background-color: rgba(100, 144, 241, 0.1); + border-radius: 12px; + display: inline-flex; + height: 18px; + width: 18px; + padding: 0px; +` + +type Props = { + t: T, +} + +type State = { + isModalOpened: boolean, +} + +class SectionExport extends PureComponent { + state = { + isModalOpened: false, + } + + onModalOpen = () => { + this.setState({ isModalOpened: true }) + } + + onModalClose = () => { + this.setState({ isModalOpened: false }) + } + + renderModal = ({ onClose }: any) => { + const { t } = this.props + const stepsImportMobile = [ + { + key: 'step1', + icon: {'1'}, + desc: ( + + + {'Go to'} + + {'Accounts'} + + + + ), + }, + { + key: 'step2', + icon: {'2'}, + desc: ( + + + {'Click on the'} + + {'+'} + + {'button'} + + + ), + }, + { + key: 'step3', + icon: {'3'}, + desc: ( + + + {'Select'} + + {'Import accounts'} + + + + ), + }, + { + key: 'step4', + icon: {'4'}, + desc: ( + + + {'Scan the image'} + + {'until the loader hits 100%'} + + + + ), + }, + ] + + return ( + + {'Export accounts'} + + + + + + + {t('settings.export.modal.listTitle')} + + + + {stepsImportMobile.map(step => )} + + + + + + + ) + } + + render() { + const { t } = this.props + const { isModalOpened } = this.state + + return ( +
+ + +
} + title={t('settings.tabs.export')} + desc={t('settings.export.desc')} + renderRight={ + + } + /> + +
+ ) + } +} + +export default translate()(SectionExport) diff --git a/src/components/SettingsPage/sections/Tools.js b/src/components/SettingsPage/sections/Tools.js index 23192ed1..d16ebc62 100644 --- a/src/components/SettingsPage/sections/Tools.js +++ b/src/components/SettingsPage/sections/Tools.js @@ -3,54 +3,14 @@ /* eslint-disable react/jsx-no-literals */ import React, { PureComponent } from 'react' -import liveCommonPkg from '@ledgerhq/live-common/package.json' import { translate } from 'react-i18next' import Box, { Card } from 'components/base/Box' -import Modal, { ModalBody, ModalContent, ModalTitle } from 'components/base/Modal' -import Button from 'components/base/Button' -import QRCodeExporter from 'components/QRCodeExporter' class TabProfile extends PureComponent<*, *> { - state = { - qrcodeMobileExportModal: false, - } - - onQRCodeMobileExport = () => { - this.setState({ qrcodeMobileExportModal: true }) - } - - onRequestClose = () => { - this.setState({ qrcodeMobileExportModal: false }) - } - - renderQRCodeModal = ({ onClose }: any) => ( - - {'QRCode Mobile Export'} - - Scan this animated QRCode with Ledger Live Mobile App - - - - {liveCommonPkg.version} - - - ) - render() { - const { qrcodeMobileExportModal } = this.state return ( - - - - - + Nothing here ) } diff --git a/src/components/modals/Receive/steps/02-step-connect-device.js b/src/components/modals/Receive/steps/02-step-connect-device.js index ecd156ae..2b8ec6be 100644 --- a/src/components/modals/Receive/steps/02-step-connect-device.js +++ b/src/components/modals/Receive/steps/02-step-connect-device.js @@ -8,8 +8,8 @@ import EnsureDeviceApp from 'components/EnsureDeviceApp' import CurrencyDownStatusAlert from 'components/CurrencyDownStatusAlert' import TrackPage from 'analytics/TrackPage' -import type { StepProps } from '../index' import { Trans } from 'react-i18next' +import type { StepProps } from '../index' export default function StepConnectDevice({ account, onChangeAppOpened }: StepProps) { return ( diff --git a/src/components/modals/Send/index.js b/src/components/modals/Send/index.js index 724c1b53..6ed05d4c 100644 --- a/src/components/modals/Send/index.js +++ b/src/components/modals/Send/index.js @@ -4,7 +4,7 @@ import React, { PureComponent } from 'react' import invariant from 'invariant' import { compose } from 'redux' import { connect } from 'react-redux' -import {Trans, translate} from 'react-i18next' +import { Trans, translate } from 'react-i18next' import { createStructuredSelector } from 'reselect' import type { Account, Operation } from '@ledgerhq/live-common/lib/types' @@ -75,26 +75,26 @@ export type StepProps = DefaultStepProps & { const createSteps = () => [ { id: 'amount', - label: , + label: , component: StepAmount, footer: StepAmountFooter, }, { id: 'device', - label: , + label: , component: StepConnectDevice, footer: StepConnectDeviceFooter, onBack: ({ transitionTo }) => transitionTo('amount'), }, { id: 'verification', - label: , + label: , component: StepVerification, shouldPreventClose: true, }, { id: 'confirmation', - label: , + label: , component: StepConfirmation, footer: StepConfirmationFooter, onBack: ({ transitionTo, onRetry }) => { diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 65d182f0..59ee4edc 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -347,10 +347,23 @@ "title": "Settings", "tabs": { "display": "General", + "export": "Export accounts", "currencies": "Currencies", "help": "Help", "about": "About" }, + "export": { + "desc": "Import accounts on your Ledger Live Mobile app", + "button": "Export", + "modal":{ + "button": "Done", + "listTitle": "To import accounts on your Ledger Live Mobile app:", + "step1": "Go to <1><0>Accounts", + "step2": "Click on the <1><0>+ button", + "step3": "Select <1><0>Import accounts", + "step4": "Scan the image <1><0>until the loader hits 100%" + } + }, "display": { "desc": "Configure general Ledger Live settings.", "language": "Display language", From b3df6109fecc381fd24b56ecb2e8304ac62773f9 Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Tue, 27 Nov 2018 19:12:45 +0100 Subject: [PATCH 2/6] Updated literals --- .../SettingsPage/sections/Export.js | 33 ++++--------------- static/i18n/en/app.json | 8 ++--- 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/src/components/SettingsPage/sections/Export.js b/src/components/SettingsPage/sections/Export.js index a00c6c72..2d5fbf73 100644 --- a/src/components/SettingsPage/sections/Export.js +++ b/src/components/SettingsPage/sections/Export.js @@ -61,10 +61,11 @@ class SectionExport extends PureComponent { desc: ( - {'Go to'} + {'Tap the'} - {'Accounts'} + {'+'} + {'button in Accounts'} ), @@ -75,11 +76,10 @@ class SectionExport extends PureComponent { desc: ( - {'Click on the'} + {'Tap'} - {'+'} + {'Import desktop accounts'} - {'button'} ), @@ -89,26 +89,7 @@ class SectionExport extends PureComponent { icon: {'3'}, desc: ( - - {'Select'} - - {'Import accounts'} - - - - ), - }, - { - key: 'step4', - icon: {'4'}, - desc: ( - - - {'Scan the image'} - - {'until the loader hits 100%'} - - + ), }, @@ -116,7 +97,7 @@ class SectionExport extends PureComponent { return ( - {'Export accounts'} + {t('settings.export.modal.title')} diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 59ee4edc..9a49099f 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -357,11 +357,11 @@ "button": "Export", "modal":{ "button": "Done", + "title": "Scan to export to mobile", "listTitle": "To import accounts on your Ledger Live Mobile app:", - "step1": "Go to <1><0>Accounts", - "step2": "Click on the <1><0>+ button", - "step3": "Select <1><0>Import accounts", - "step4": "Scan the image <1><0>until the loader hits 100%" + "step1": "Tap the <1><0>+ button in Account", + "step2": "Tap <1><0>Import desktop accounts", + "step3": "Scan until the loader hits 100%" } }, "display": { From 5c57f87e66ba59d95e3d1c6317c82535875d270e Mon Sep 17 00:00:00 2001 From: meriadec Date: Wed, 28 Nov 2018 11:38:23 +0100 Subject: [PATCH 3/6] Install libudev-dev on CI and clear CI cache --- .circleci/config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d1b8ee6..e590dbc9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,8 @@ jobs: build: <<: *defaults steps: + - run: sudo apt-get update + - run: sudo apt-get install -y libudev-dev - run: name: Install latest yarn command: | @@ -19,10 +21,10 @@ jobs: - checkout - restore_cache: keys: - - v11-yarn-packages-{{ checksum "yarn.lock" }} + - v12-yarn-packages-{{ checksum "yarn.lock" }} - run: yarn install - save_cache: - key: v11-yarn-packages-{{ checksum "yarn.lock" }} + key: v12-yarn-packages-{{ checksum "yarn.lock" }} paths: - node_modules - run: yarn lint From 486ee24b585c896fb09e8aa0b596bdab1f434152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Wed, 28 Nov 2018 13:08:24 +0100 Subject: [PATCH 4/6] Less Sentry events --- src/sentry/install.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sentry/install.js b/src/sentry/install.js index 5d75ed47..7f2b3622 100644 --- a/src/sentry/install.js +++ b/src/sentry/install.js @@ -14,13 +14,17 @@ export default (Raven: any, shouldSendCallback: () => boolean, userId: string) = tags: { git_commit: __GIT_REVISION__, }, + sampleRate: 0.01, environment: __DEV__ ? 'development' : 'production', shouldSendCallback, ignoreErrors: [ + 'failed with status code', 'status code 404', 'timeout', 'socket hang up', - 'getaddrinfo ', + 'getaddrinfo', + 'could not read from HID device', + 'ENOTFOUND', 'ETIMEDOUT', 'ECONNRESET', 'ENETUNREACH', From c7158fc7cb07eb5cf041ec24033539c604a3b87c Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Wed, 28 Nov 2018 20:00:14 +0100 Subject: [PATCH 5/6] Fixed some wording Along with the missing S and fixed font, I fixed some missing wording --- src/components/EnsureDeviceApp.js | 4 ++-- src/components/GenuineCheck.js | 8 ++++---- src/components/SettingsPage/sections/Export.js | 5 +++-- static/i18n/en/app.json | 13 +++++-------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/components/EnsureDeviceApp.js b/src/components/EnsureDeviceApp.js index 1d300a98..e742a663 100644 --- a/src/components/EnsureDeviceApp.js +++ b/src/components/EnsureDeviceApp.js @@ -77,7 +77,7 @@ class EnsureDeviceApp extends Component<{ const cur = account ? account.currency : currency invariant(cur, 'No currency given') return ( - + {'Open the '} {cur.managerAppName} {' app on your device'} @@ -97,7 +97,7 @@ class EnsureDeviceApp extends Component<{ { id: 'device', title: ( - + {'Connect and unlock your '} {'Ledger device'} diff --git a/src/components/GenuineCheck.js b/src/components/GenuineCheck.js index 325f9dfa..aef771e9 100644 --- a/src/components/GenuineCheck.js +++ b/src/components/GenuineCheck.js @@ -124,7 +124,7 @@ class GenuineCheck extends PureComponent { { id: 'device', title: ( - + {'Connect and unlock your '} {'Ledger device'} @@ -135,10 +135,10 @@ class GenuineCheck extends PureComponent { { id: 'deviceInfo', title: ( - + {'Navigate to the '} {'dashboard'} - {' on your device'} + {' app on your device'} ), icon: homeIcon, @@ -147,7 +147,7 @@ class GenuineCheck extends PureComponent { { id: 'isGenuine', title: ( - + {'Allow '} {'Ledger Manager'} {' on your device'} diff --git a/src/components/SettingsPage/sections/Export.js b/src/components/SettingsPage/sections/Export.js index 2d5fbf73..17932932 100644 --- a/src/components/SettingsPage/sections/Export.js +++ b/src/components/SettingsPage/sections/Export.js @@ -17,8 +17,8 @@ import { BulletRow } from '../../Onboarding/helperComponents' import Text from '../../base/Text' const BulletRowIcon = styled(Box).attrs({ - ff: 'Open Sans|Regular', - fontSize: 12, + ff: 'Rubik|Regular', + fontSize: 10, textAlign: 'center', color: 'wallet', pl: 2, @@ -29,6 +29,7 @@ const BulletRowIcon = styled(Box).attrs({ height: 18px; width: 18px; padding: 0px; + padding-top: 2px; ` type Props = { diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 9a49099f..d4f947f9 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -138,12 +138,9 @@ "messageIfSkipped": "Your {{currencyName}} address has not been confirmed on your Ledger device. Please verify it for optimal security." }, "deviceConnect": { - "step1": { - "connect": "Connect and unlock your <1>Ledger device" - }, - "step2": { - "open": "Open the <1><0>{{managerAppName}} app on your device" - } + "step1": "Connect and unlock your <1>Ledger device", + "step2": "Navigate to the <1><0>{{managerAppName}} app on your device", + "step3": "Allow <1><0>Ledger Manager on your device" }, "emptyState": { "sidebar": { @@ -359,7 +356,7 @@ "button": "Done", "title": "Scan to export to mobile", "listTitle": "To import accounts on your Ledger Live Mobile app:", - "step1": "Tap the <1><0>+ button in Account", + "step1": "Tap the <1><0>+ button in Accounts", "step2": "Tap <1><0>Import desktop accounts", "step3": "Scan until the loader hits 100%" } @@ -632,7 +629,7 @@ "step2": { "title": "Did you save your recovery phrase by yourself?" }, - "step3": { + "step3":{ "title": "Is your Ledger device genuine?" }, "isGenuinePassed": "Your device is genuine", From bce8acfc7ec4f9837b89f537550fc304473cfcaf Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Thu, 29 Nov 2018 11:35:18 +0100 Subject: [PATCH 6/6] Made the export only visible if experimental tooling flag is on And removed the non-used tools section --- src/components/SettingsPage/index.js | 10 ++-------- src/components/SettingsPage/sections/Tools.js | 19 ------------------- 2 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 src/components/SettingsPage/sections/Tools.js diff --git a/src/components/SettingsPage/index.js b/src/components/SettingsPage/index.js index 35afee4d..9c773cd7 100644 --- a/src/components/SettingsPage/index.js +++ b/src/components/SettingsPage/index.js @@ -16,7 +16,6 @@ import SectionCurrencies from './sections/Currencies' import SectionHelp from './sections/Help' import SectionAbout from './sections/About' import SectionExport from './sections/Export' -import SectionTools from './sections/Tools' const mapStateToProps = state => ({ accountsCount: accountsSelector(state).length, @@ -49,11 +48,6 @@ class SettingsPage extends PureComponent { label: , value: SectionCurrencies, }, - { - key: 'export', - label: , - value: SectionExport, - }, { key: 'about', label: , @@ -67,10 +61,10 @@ class SettingsPage extends PureComponent { ] if (EXPERIMENTAL_TOOLS_SETTINGS) { - this._items.push({ + this._items.splice(2, 0, { key: 'tool', label: 'Experimental Tools', - value: SectionTools, + value: SectionExport, }) } diff --git a/src/components/SettingsPage/sections/Tools.js b/src/components/SettingsPage/sections/Tools.js deleted file mode 100644 index d16ebc62..00000000 --- a/src/components/SettingsPage/sections/Tools.js +++ /dev/null @@ -1,19 +0,0 @@ -// @flow - -/* eslint-disable react/jsx-no-literals */ - -import React, { PureComponent } from 'react' -import { translate } from 'react-i18next' -import Box, { Card } from 'components/base/Box' - -class TabProfile extends PureComponent<*, *> { - render() { - return ( - - Nothing here - - ) - } -} - -export default translate()(TabProfile)