Browse Source

Merge branch 'develop' into decred-integration

gre-patch-1
meriadec 6 years ago
parent
commit
4d5bf6eb80
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 6
      .circleci/config.yml
  2. 4
      src/components/EnsureDeviceApp.js
  3. 8
      src/components/GenuineCheck.js
  4. 13
      src/components/Onboarding/helperComponents.js
  5. 6
      src/components/SettingsPage/index.js
  6. 148
      src/components/SettingsPage/sections/Export.js
  7. 59
      src/components/SettingsPage/sections/Tools.js
  8. 6
      src/sentry/install.js
  9. 24
      static/i18n/en/app.json

6
.circleci/config.yml

@ -9,6 +9,8 @@ jobs:
build: build:
<<: *defaults <<: *defaults
steps: steps:
- run: sudo apt-get update
- run: sudo apt-get install -y libudev-dev
- run: - run:
name: Install latest yarn name: Install latest yarn
command: | command: |
@ -19,10 +21,10 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- v11-yarn-packages-{{ checksum "yarn.lock" }} - v12-yarn-packages-{{ checksum "yarn.lock" }}
- run: yarn install - run: yarn install
- save_cache: - save_cache:
key: v11-yarn-packages-{{ checksum "yarn.lock" }} key: v12-yarn-packages-{{ checksum "yarn.lock" }}
paths: paths:
- node_modules - node_modules
- run: yarn lint - run: yarn lint

4
src/components/EnsureDeviceApp.js

@ -77,7 +77,7 @@ class EnsureDeviceApp extends Component<{
const cur = account ? account.currency : currency const cur = account ? account.currency : currency
invariant(cur, 'No currency given') invariant(cur, 'No currency given')
return ( return (
<Trans i18nKey="deviceConnect.step2.open" parent="div"> <Trans i18nKey="deviceConnect.step2" parent="div">
{'Open the '} {'Open the '}
<Bold>{cur.managerAppName}</Bold> <Bold>{cur.managerAppName}</Bold>
{' app on your device'} {' app on your device'}
@ -97,7 +97,7 @@ class EnsureDeviceApp extends Component<{
{ {
id: 'device', id: 'device',
title: ( title: (
<Trans i18nKey="deviceConnect.step1.connect" parent="div"> <Trans i18nKey="deviceConnect.step1" parent="div">
{'Connect and unlock your '} {'Connect and unlock your '}
<Bold>{'Ledger device'}</Bold> <Bold>{'Ledger device'}</Bold>
</Trans> </Trans>

8
src/components/GenuineCheck.js

@ -124,7 +124,7 @@ class GenuineCheck extends PureComponent<Props> {
{ {
id: 'device', id: 'device',
title: ( title: (
<Trans i18nKey="deviceConnect.step1.connect" parent="div"> <Trans i18nKey="deviceConnect.step1" parent="div">
{'Connect and unlock your '} {'Connect and unlock your '}
<Bold>{'Ledger device'}</Bold> <Bold>{'Ledger device'}</Bold>
</Trans> </Trans>
@ -135,10 +135,10 @@ class GenuineCheck extends PureComponent<Props> {
{ {
id: 'deviceInfo', id: 'deviceInfo',
title: ( title: (
<Trans i18nKey="deviceConnect:dashboard.open" parent="div"> <Trans i18nKey="deviceConnect.step2" parent="div">
{'Navigate to the '} {'Navigate to the '}
<Bold>{'dashboard'}</Bold> <Bold>{'dashboard'}</Bold>
{' on your device'} {' app on your device'}
</Trans> </Trans>
), ),
icon: homeIcon, icon: homeIcon,
@ -147,7 +147,7 @@ class GenuineCheck extends PureComponent<Props> {
{ {
id: 'isGenuine', id: 'isGenuine',
title: ( title: (
<Trans i18nKey="deviceConnect:stepGenuine.open" parent="div"> <Trans i18nKey="deviceConnect.step3" parent="div">
{'Allow '} {'Allow '}
<Bold>{'Ledger Manager'}</Bold> <Bold>{'Ledger Manager'}</Bold>
{' on your device'} {' on your device'}

13
src/components/Onboarding/helperComponents.js

@ -69,6 +69,19 @@ export function OptionRow({ step, ...p }: { step: StepType }) {
</Box> </Box>
) )
} }
export function BulletRow({ step, ...p }: { step: StepType }) {
const { icon, desc } = step
return (
<Box horizontal my="7px">
<Box {...p} mr="7px">
{icon}
</Box>
<Box justify="center" shrink>
<OptionRowDesc>{desc}</OptionRowDesc>
</Box>
</Box>
)
}
export const OptionRowDesc = styled(Box).attrs({ export const OptionRowDesc = styled(Box).attrs({
ff: 'Open Sans|Regular', ff: 'Open Sans|Regular',
fontSize: 4, fontSize: 4,

6
src/components/SettingsPage/index.js

@ -15,7 +15,7 @@ import SectionDisplay from './sections/Display'
import SectionCurrencies from './sections/Currencies' import SectionCurrencies from './sections/Currencies'
import SectionHelp from './sections/Help' import SectionHelp from './sections/Help'
import SectionAbout from './sections/About' import SectionAbout from './sections/About'
import SectionTools from './sections/Tools' import SectionExport from './sections/Export'
const mapStateToProps = state => ({ const mapStateToProps = state => ({
accountsCount: accountsSelector(state).length, accountsCount: accountsSelector(state).length,
@ -61,10 +61,10 @@ class SettingsPage extends PureComponent<Props, State> {
] ]
if (EXPERIMENTAL_TOOLS_SETTINGS) { if (EXPERIMENTAL_TOOLS_SETTINGS) {
this._items.push({ this._items.splice(2, 0, {
key: 'tool', key: 'tool',
label: 'Experimental Tools', label: 'Experimental Tools',
value: SectionTools, value: SectionExport,
}) })
} }

148
src/components/SettingsPage/sections/Export.js

@ -0,0 +1,148 @@
// @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: 'Rubik|Regular',
fontSize: 10,
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;
padding-top: 2px;
`
type Props = {
t: T,
}
type State = {
isModalOpened: boolean,
}
class SectionExport extends PureComponent<Props, State> {
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: <BulletRowIcon>{'1'}</BulletRowIcon>,
desc: (
<Box style={{ display: 'block' }}>
<Trans i18nKey="settings.export.modal.step1">
{'Tap the'}
<Text ff="Open Sans|SemiBold" color="dark">
{'+'}
</Text>
{'button in Accounts'}
</Trans>
</Box>
),
},
{
key: 'step2',
icon: <BulletRowIcon>{'2'}</BulletRowIcon>,
desc: (
<Box style={{ display: 'block' }}>
<Trans i18nKey="settings.export.modal.step2">
{'Tap'}
<Text ff="Open Sans|SemiBold" color="dark">
{'Import desktop accounts'}
</Text>
</Trans>
</Box>
),
},
{
key: 'step3',
icon: <BulletRowIcon>{'3'}</BulletRowIcon>,
desc: (
<Box style={{ display: 'block' }}>
<Trans i18nKey="settings.export.modal.step3" />
</Box>
),
},
]
return (
<ModalBody onClose={onClose}>
<ModalTitle>{t('settings.export.modal.title')}</ModalTitle>
<ModalContent flow={2} justify="center" align="center">
<Box flow={2}>
<QRCodeExporter size={330} />
</Box>
<Box shrink style={{ width: 330, fontSize: 13, marginTop: 20 }}>
<Text ff="Open Sans|SemiBold" color="dark">
{t('settings.export.modal.listTitle')}
</Text>
</Box>
<Box style={{ width: 330 }}>
{stepsImportMobile.map(step => <BulletRow key={step.key} step={step} />)}
</Box>
</ModalContent>
<ModalFooter horizontal align="center" justify="flex-end" flow={2}>
<Button small onClick={onClose} primary>
{t('settings.export.modal.button')}
</Button>
</ModalFooter>
</ModalBody>
)
}
render() {
const { t } = this.props
const { isModalOpened } = this.state
return (
<Section style={{ flowDirection: 'column' }}>
<TrackPage category="Settings" name="Export" />
<Header
icon={<IconShare size={16} />}
title={t('settings.tabs.export')}
desc={t('settings.export.desc')}
renderRight={
<Button small onClick={this.onModalOpen} primary>
{t('settings.export.button')}
</Button>
}
/>
<Modal isOpened={isModalOpened} onClose={this.onModalClose} render={this.renderModal} />
</Section>
)
}
}
export default translate()(SectionExport)

59
src/components/SettingsPage/sections/Tools.js

@ -1,59 +0,0 @@
// @flow
/* 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) => (
<ModalBody onClose={onClose} justify="center" align="center">
<ModalTitle>{'QRCode Mobile Export'}</ModalTitle>
<ModalContent flow={2}>
<Box>Scan this animated QRCode with Ledger Live Mobile App</Box>
<Box flow={2}>
<QRCodeExporter />
</Box>
<Box style={{ textAlign: 'right' }}>{liveCommonPkg.version}</Box>
</ModalContent>
</ModalBody>
)
render() {
const { qrcodeMobileExportModal } = this.state
return (
<Card flow={3}>
<Box horizontal>
<Button small onClick={this.onQRCodeMobileExport} primary>
QRCode Mobile Export
</Button>
<Modal
isOpened={qrcodeMobileExportModal}
onClose={this.onRequestClose}
render={this.renderQRCodeModal}
/>
</Box>
</Card>
)
}
}
export default translate()(TabProfile)

6
src/sentry/install.js

@ -14,13 +14,17 @@ export default (Raven: any, shouldSendCallback: () => boolean, userId: string) =
tags: { tags: {
git_commit: __GIT_REVISION__, git_commit: __GIT_REVISION__,
}, },
sampleRate: 0.01,
environment: __DEV__ ? 'development' : 'production', environment: __DEV__ ? 'development' : 'production',
shouldSendCallback, shouldSendCallback,
ignoreErrors: [ ignoreErrors: [
'failed with status code',
'status code 404', 'status code 404',
'timeout', 'timeout',
'socket hang up', 'socket hang up',
'getaddrinfo ', 'getaddrinfo',
'could not read from HID device',
'ENOTFOUND',
'ETIMEDOUT', 'ETIMEDOUT',
'ECONNRESET', 'ECONNRESET',
'ENETUNREACH', 'ENETUNREACH',

24
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." "messageIfSkipped": "Your {{currencyName}} address has not been confirmed on your Ledger device. Please verify it for optimal security."
}, },
"deviceConnect": { "deviceConnect": {
"step1": { "step1": "Connect and unlock your <1>Ledger device</1>",
"connect": "Connect and unlock your <1>Ledger device</1>" "step2": "Navigate to the <1><0>{{managerAppName}}</0></1> app on your device",
}, "step3": "Allow <1><0>Ledger Manager</0></1> on your device"
"step2": {
"open": "Open the <1><0>{{managerAppName}}</0></1> app on your device"
}
}, },
"emptyState": { "emptyState": {
"sidebar": { "sidebar": {
@ -347,10 +344,23 @@
"title": "Settings", "title": "Settings",
"tabs": { "tabs": {
"display": "General", "display": "General",
"export": "Export accounts",
"currencies": "Currencies", "currencies": "Currencies",
"help": "Help", "help": "Help",
"about": "About" "about": "About"
}, },
"export": {
"desc": "Import accounts on your Ledger Live Mobile app",
"button": "Export",
"modal":{
"button": "Done",
"title": "Scan to export to mobile",
"listTitle": "To import accounts on your Ledger Live Mobile app:",
"step1": "Tap the <1><0>+</0></1> button in Accounts",
"step2": "Tap <1><0>Import desktop accounts</0></1>",
"step3": "Scan until the loader hits 100%"
}
},
"display": { "display": {
"desc": "Configure general Ledger Live settings.", "desc": "Configure general Ledger Live settings.",
"language": "Display language", "language": "Display language",
@ -619,7 +629,7 @@
"step2": { "step2": {
"title": "Did you save your recovery phrase by yourself?" "title": "Did you save your recovery phrase by yourself?"
}, },
"step3": { "step3":{
"title": "Is your Ledger device genuine?" "title": "Is your Ledger device genuine?"
}, },
"isGenuinePassed": "Your device is genuine", "isGenuinePassed": "Your device is genuine",

Loading…
Cancel
Save