Browse Source

Add missing i18n + ignore eslint false positives

master
Thibaut Boustany 7 years ago
parent
commit
7177136eba
No known key found for this signature in database GPG Key ID: 32475B11A2B13EEC
  1. 2
      src/components/AccountPage/index.js
  2. 1
      src/components/CurrentAddress/index.js
  3. 2
      src/components/DashboardPage/AccountCard.js
  4. 1
      src/components/DeviceConnect/index.js
  5. 14
      src/components/FeesField/BitcoinKind.js
  6. 25
      src/components/MainSideBar/index.js
  7. 2
      src/components/Onboarding/helperComponents.js
  8. 6
      src/components/Onboarding/steps/GenuineCheck.js
  9. 6
      src/components/Onboarding/steps/SelectPIN/SelectPINblue.js
  10. 8
      src/components/Onboarding/steps/SelectPIN/SelectPINnano.js
  11. 6
      src/components/Onboarding/steps/WriteSeed/WriteSeedBlue.js
  12. 6
      src/components/Onboarding/steps/WriteSeed/WriteSeedNano.js
  13. 8
      src/components/Onboarding/steps/WriteSeed/WriteSeedRestore.js
  14. 2
      src/components/RequestAmount/index.js
  15. 6
      src/components/SettingsPage/index.js
  16. 13
      src/components/ThrowBlock.js
  17. 6
      src/components/base/AccountsList/AccountRow.js
  18. 1
      src/components/base/AccountsList/index.js
  19. 10
      src/components/base/LegacySelect/index.js
  20. 3
      src/components/base/StepperNumber/index.js
  21. 2
      src/components/modals/AddAccounts/index.js
  22. 2
      src/components/modals/AddAccounts/steps/02-step-connect-device.js
  23. 12
      src/components/modals/AddAccounts/steps/03-step-import.js
  24. 6
      src/components/modals/AddAccounts/steps/04-step-finish.js
  25. 1
      src/components/modals/Debug.js
  26. 2
      src/components/modals/OperationDetails.js
  27. 4
      src/components/modals/Send/Footer.js
  28. 13
      static/i18n/en/app.yml

2
src/components/AccountPage/index.js

@ -143,7 +143,7 @@ class AccountPage extends PureComponent<Props, State> {
<BalanceSummary <BalanceSummary
accounts={[account]} accounts={[account]}
chartColor={account.currency.color} chartColor={account.currency.color}
chartId={`account-chart-${account.id}`} chartId={`account-chart-${account.id}`} /* eslint-disable-line react/jsx-no-literals */
counterValue={counterValue} counterValue={counterValue}
daysCount={daysCount} daysCount={daysCount}
selectedTime={selectedTime} selectedTime={selectedTime}

1
src/components/CurrentAddress/index.js

@ -183,6 +183,7 @@ class CurrentAddress extends PureComponent<Props> {
<Box> <Box>
{accountName ? ( {accountName ? (
<Trans i18nKey="app:currentAddress.for" parent="div"> <Trans i18nKey="app:currentAddress.for" parent="div">
{/* eslint-disable-line react/jsx-no-literals */}
Address for <strong>{accountName}</strong> Address for <strong>{accountName}</strong>
</Trans> </Trans>
) : ( ) : (

2
src/components/DashboardPage/AccountCard.js

@ -89,7 +89,7 @@ class AccountCard extends PureComponent<{
height={52} height={52}
hideAxis hideAxis
isInteractive={false} isInteractive={false}
id={`account-chart-${account.id}`} id={`account-chart-${account.id}`} /* eslint-disable-line react/jsx-no-literals */
unit={account.unit} unit={account.unit}
/> />
</Box> </Box>

1
src/components/DeviceConnect/index.js

@ -200,6 +200,7 @@ class DeviceConnect extends PureComponent<Props> {
const hasDevice = devices.length > 0 const hasDevice = devices.length > 0
const hasMultipleDevices = devices.length > 1 const hasMultipleDevices = devices.length > 1
/* eslint-disable react/jsx-no-literals */
return ( return (
<Box flow={4} ff="Open Sans"> <Box flow={4} ff="Open Sans">
<Step validated={hasDevice}> <Step validated={hasDevice}>

14
src/components/FeesField/BitcoinKind.js

@ -3,6 +3,9 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import type { Account } from '@ledgerhq/live-common/lib/types' import type { Account } from '@ledgerhq/live-common/lib/types'
import styled from 'styled-components' import styled from 'styled-components'
import { translate } from 'react-i18next'
import type { T } from 'types/common'
import InputCurrency from 'components/base/InputCurrency' import InputCurrency from 'components/base/InputCurrency'
import Select from 'components/base/Select' import Select from 'components/base/Select'
@ -15,6 +18,7 @@ type Props = {
account: Account, account: Account,
feePerByte: number, feePerByte: number,
onChange: number => void, onChange: number => void,
t: T
} }
type FeeItem = { type FeeItem = {
@ -104,14 +108,14 @@ class FeesField extends Component<
} }
render() { render() {
const { account, feePerByte, error, onChange } = this.props const { account, feePerByte, error, onChange, t } = this.props
const { items, selectedItem } = this.state const { items, selectedItem } = this.state
const { units } = account.currency const { units } = account.currency
const satoshi = units[units.length - 1] const satoshi = units[units.length - 1]
return ( return (
<GenericContainer error={error} help="fee per byte"> <GenericContainer error={error} help={t('app:send.steps.amount.unitPerByte')}>
<Select width={156} options={items} value={selectedItem} onChange={this.onSelectChange} /> <Select width={156} options={items} value={selectedItem} onChange={this.onSelectChange} />
<InputCurrency <InputCurrency
defaultUnit={satoshi} defaultUnit={satoshi}
@ -120,18 +124,18 @@ class FeesField extends Component<
value={feePerByte} value={feePerByte}
onChange={onChange} onChange={onChange}
onChangeFocus={this.onChangeFocus} onChangeFocus={this.onChangeFocus}
renderRight={<InputRight>{satoshi.code} per Byte</InputRight>} renderRight={<InputRight>{t('app:send.steps.amount.unitPerByte', { unit: satoshi.code })}</InputRight>}
/> />
</GenericContainer> </GenericContainer>
) )
} }
} }
export default (props: Props) => ( export default translate()((props: Props) => (
<WithFeesAPI <WithFeesAPI
currency={props.account.currency} currency={props.account.currency}
renderError={error => <FeesField {...props} error={error} />} renderError={error => <FeesField {...props} error={error} />}
renderLoading={() => <FeesField {...props} />} renderLoading={() => <FeesField {...props} />}
render={fees => <FeesField {...props} fees={fees} />} render={fees => <FeesField {...props} fees={fees} />}
/> />
) ))

25
src/components/MainSideBar/index.js

@ -92,38 +92,40 @@ class MainSideBar extends PureComponent<Props> {
<SideBarListItem <SideBarListItem
label={t('app:dashboard.title')} label={t('app:dashboard.title')}
icon={IconPieChart} icon={IconPieChart}
iconActiveColor={'wallet'} iconActiveColor="wallet"
onClick={this.handleClickDashboard} onClick={this.handleClickDashboard}
isActive={pathname === '/'} isActive={pathname === '/'} /* eslint-disable-line react/jsx-no-literals */
hasNotif={updateStatus === 'downloaded'} hasNotif={
updateStatus === 'downloaded' /* eslint-disable-line react/jsx-no-literals */
}
/> />
<SideBarListItem <SideBarListItem
label={t('app:send.title')} label={t('app:send.title')}
icon={IconSend} icon={IconSend}
iconActiveColor={'wallet'} iconActiveColor="wallet"
onClick={this.handleOpenSendModal} onClick={this.handleOpenSendModal}
disabled={accounts.length === 0} disabled={accounts.length === 0}
/> />
<SideBarListItem <SideBarListItem
label={t('app:receive.title')} label={t('app:receive.title')}
icon={IconReceive} icon={IconReceive}
iconActiveColor={'wallet'} iconActiveColor="wallet"
onClick={this.handleOpenReceiveModal} onClick={this.handleOpenReceiveModal}
disabled={accounts.length === 0} disabled={accounts.length === 0}
/> />
<SideBarListItem <SideBarListItem
label={t('app:sidebar.manager')} label={t('app:sidebar.manager')}
icon={IconManager} icon={IconManager}
iconActiveColor={'wallet'} iconActiveColor="wallet"
onClick={this.handleClickManager} onClick={this.handleClickManager}
isActive={pathname === '/manager'} isActive={pathname === '/manager'} /* eslint-disable-line react/jsx-no-literals */
/> />
<SideBarListItem <SideBarListItem
label={t('app:sidebar.exchange')} label={t('app:sidebar.exchange')}
icon={IconExchange} icon={IconExchange}
iconActiveColor={'wallet'} iconActiveColor="wallet"
onClick={this.handleClickExchange} onClick={this.handleClickExchange}
isActive={pathname === '/exchange'} isActive={pathname === '/exchange'} /* eslint-disable-line react/jsx-no-literals */
/> />
</SideBarList> </SideBarList>
<Space of={40} /> <Space of={40} />
@ -137,7 +139,10 @@ class MainSideBar extends PureComponent<Props> {
key={account.id} key={account.id}
account={account} account={account}
push={this.push} push={this.push}
isActive={pathname === `/account/${account.id}`} isActive={
pathname ===
`/account/${account.id}` /* eslint-disable-line react/jsx-no-literals */
}
/> />
))} ))}
</SideBarList> </SideBarList>

2
src/components/Onboarding/helperComponents.js

@ -50,7 +50,7 @@ type StepType = {
export function OptionRow({ step }: { step: StepType }) { export function OptionRow({ step }: { step: StepType }) {
const { icon, desc } = step const { icon, desc } = step
return ( return (
<Box horizontal m={'7px'} style={{ minWidth: 420 }}> <Box horizontal m="7px" style={{ minWidth: 420 }}>
<Box justify="center">{icon}</Box> <Box justify="center">{icon}</Box>
<Box justify="center" shrink> <Box justify="center" shrink>
<OptionRowDesc>{desc}</OptionRowDesc> <OptionRowDesc>{desc}</OptionRowDesc>

6
src/components/Onboarding/steps/GenuineCheck.js

@ -128,7 +128,7 @@ class GenuineCheck extends PureComponent<StepProps, State> {
<CardWrapper> <CardWrapper>
<Box justify="center"> <Box justify="center">
<Box horizontal> <Box horizontal>
<IconOptionRow>1.</IconOptionRow> <IconOptionRow>1.</IconOptionRow>{/* eslint-disable-line react/jsx-no-literals */}
<CardTitle>{t('onboarding:genuineCheck.steps.step1.title')}</CardTitle> <CardTitle>{t('onboarding:genuineCheck.steps.step1.title')}</CardTitle>
</Box> </Box>
</Box> </Box>
@ -145,7 +145,7 @@ class GenuineCheck extends PureComponent<StepProps, State> {
<CardWrapper isDisabled={!genuine.pinStepPass}> <CardWrapper isDisabled={!genuine.pinStepPass}>
<Box justify="center"> <Box justify="center">
<Box horizontal> <Box horizontal>
<IconOptionRow>2.</IconOptionRow> <IconOptionRow>2.</IconOptionRow>{/* eslint-disable-line react/jsx-no-literals */}
<CardTitle>{t('onboarding:genuineCheck.steps.step2.title')}</CardTitle> <CardTitle>{t('onboarding:genuineCheck.steps.step2.title')}</CardTitle>
</Box> </Box>
</Box> </Box>
@ -162,7 +162,7 @@ class GenuineCheck extends PureComponent<StepProps, State> {
<CardWrapper isDisabled={!genuine.recoveryStepPass}> <CardWrapper isDisabled={!genuine.recoveryStepPass}>
<Box justify="center"> <Box justify="center">
<Box horizontal> <Box horizontal>
<IconOptionRow>3.</IconOptionRow> <IconOptionRow>3.</IconOptionRow>{/* eslint-disable-line react/jsx-no-literals */}
<CardTitle>{t('onboarding:genuineCheck.steps.step3.title')}</CardTitle> <CardTitle>{t('onboarding:genuineCheck.steps.step3.title')}</CardTitle>
</Box> </Box>
</Box> </Box>

6
src/components/Onboarding/steps/SelectPIN/SelectPINblue.js

@ -23,17 +23,17 @@ class SelectPIN extends PureComponent<Props, *> {
const stepsLedgerBlue = [ const stepsLedgerBlue = [
{ {
key: 'step1', key: 'step1',
icon: <IconOptionRow>1.</IconOptionRow>, icon: <IconOptionRow>1.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:selectPIN.instructions.ledgerBlue.step1'), desc: t('onboarding:selectPIN.instructions.ledgerBlue.step1'),
}, },
{ {
key: 'step2', key: 'step2',
icon: <IconOptionRow>2.</IconOptionRow>, icon: <IconOptionRow>2.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:selectPIN.instructions.ledgerBlue.step2'), desc: t('onboarding:selectPIN.instructions.ledgerBlue.step2'),
}, },
{ {
key: 'step3', key: 'step3',
icon: <IconOptionRow>3.</IconOptionRow>, icon: <IconOptionRow>3.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:selectPIN.instructions.ledgerBlue.step3'), desc: t('onboarding:selectPIN.instructions.ledgerBlue.step3'),
}, },
] ]

8
src/components/Onboarding/steps/SelectPIN/SelectPINnano.js

@ -23,22 +23,22 @@ class SelectPINnano extends PureComponent<Props, *> {
const stepsLedgerNano = [ const stepsLedgerNano = [
{ {
key: 'step1', key: 'step1',
icon: <IconOptionRow>1.</IconOptionRow>, icon: <IconOptionRow>1.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:selectPIN.instructions.ledgerNano.step1'), desc: t('onboarding:selectPIN.instructions.ledgerNano.step1'),
}, },
{ {
key: 'step2', key: 'step2',
icon: <IconOptionRow>2.</IconOptionRow>, icon: <IconOptionRow>2.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:selectPIN.instructions.ledgerNano.step2'), desc: t('onboarding:selectPIN.instructions.ledgerNano.step2'),
}, },
{ {
key: 'step3', key: 'step3',
icon: <IconOptionRow>3.</IconOptionRow>, icon: <IconOptionRow>3.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:selectPIN.instructions.ledgerNano.step3'), desc: t('onboarding:selectPIN.instructions.ledgerNano.step3'),
}, },
{ {
key: 'step4', key: 'step4',
icon: <IconOptionRow>4.</IconOptionRow>, icon: <IconOptionRow>4.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:selectPIN.instructions.ledgerNano.step4'), desc: t('onboarding:selectPIN.instructions.ledgerNano.step4'),
}, },
] ]

6
src/components/Onboarding/steps/WriteSeed/WriteSeedBlue.js

@ -29,17 +29,17 @@ class WriteSeedBlue extends PureComponent<Props, *> {
const steps = [ const steps = [
{ {
key: 'step1', key: 'step1',
icon: <IconOptionRow>1.</IconOptionRow>, icon: <IconOptionRow>1.</IconOptionRow>, /* eslint-disable-line react/jsx-no-literals */
desc: t('onboarding:writeSeed.blue.step1'), desc: t('onboarding:writeSeed.blue.step1'),
}, },
{ {
key: 'step2', key: 'step2',
icon: <IconOptionRow>2.</IconOptionRow>, icon: <IconOptionRow>2.</IconOptionRow>, /* eslint-disable-line react/jsx-no-literals */
desc: t('onboarding:writeSeed.blue.step2'), desc: t('onboarding:writeSeed.blue.step2'),
}, },
{ {
key: 'step3', key: 'step3',
icon: <IconOptionRow>3.</IconOptionRow>, icon: <IconOptionRow>3.</IconOptionRow>, /* eslint-disable-line react/jsx-no-literals */
desc: t('onboarding:writeSeed.blue.step3'), desc: t('onboarding:writeSeed.blue.step3'),
}, },
] ]

6
src/components/Onboarding/steps/WriteSeed/WriteSeedNano.js

@ -29,17 +29,17 @@ class WriteSeedNano extends PureComponent<Props, *> {
const steps = [ const steps = [
{ {
key: 'step1', key: 'step1',
icon: <IconOptionRow>1.</IconOptionRow>, icon: <IconOptionRow>1.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:writeSeed.nano.step1'), desc: t('onboarding:writeSeed.nano.step1'),
}, },
{ {
key: 'step2', key: 'step2',
icon: <IconOptionRow>2.</IconOptionRow>, icon: <IconOptionRow>2.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:writeSeed.nano.step2'), desc: t('onboarding:writeSeed.nano.step2'),
}, },
{ {
key: 'step3', key: 'step3',
icon: <IconOptionRow>3.</IconOptionRow>, icon: <IconOptionRow>3.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:writeSeed.nano.step3'), desc: t('onboarding:writeSeed.nano.step3'),
}, },
] ]

8
src/components/Onboarding/steps/WriteSeed/WriteSeedRestore.js

@ -30,22 +30,22 @@ class WriteSeedRestore extends PureComponent<Props, *> {
const steps = [ const steps = [
{ {
key: 'step1', key: 'step1',
icon: <IconOptionRow>1.</IconOptionRow>, icon: <IconOptionRow>1.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:writeSeed.restore.step1'), desc: t('onboarding:writeSeed.restore.step1'),
}, },
{ {
key: 'step2', key: 'step2',
icon: <IconOptionRow>2.</IconOptionRow>, icon: <IconOptionRow>2.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:writeSeed.restore.step2'), desc: t('onboarding:writeSeed.restore.step2'),
}, },
{ {
key: 'step3', key: 'step3',
icon: <IconOptionRow>3.</IconOptionRow>, icon: <IconOptionRow>3.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:writeSeed.restore.step3'), desc: t('onboarding:writeSeed.restore.step3'),
}, },
{ {
key: 'step4', key: 'step4',
icon: <IconOptionRow>4.</IconOptionRow>, icon: <IconOptionRow>4.</IconOptionRow> /* eslint-disable-line react/jsx-no-literals */,
desc: t('onboarding:writeSeed.restore.step4'), desc: t('onboarding:writeSeed.restore.step4'),
}, },
] ]

2
src/components/RequestAmount/index.js

@ -155,7 +155,7 @@ export class RequestAmount extends PureComponent<Props> {
onChange={this.onLeftChange} onChange={this.onLeftChange}
renderRight={<InputRight>{account.unit.code}</InputRight>} renderRight={<InputRight>{account.unit.code}</InputRight>}
/> />
<InputCenter>=</InputCenter> <InputCenter>=</InputCenter> {/* eslint-disable-line react/jsx-no-literals */}
<InputCurrency <InputCurrency
containerProps={containerProps} containerProps={containerProps}
defaultUnit={rightUnit} defaultUnit={rightUnit}

6
src/components/SettingsPage/index.js

@ -121,7 +121,11 @@ class SettingsPage extends PureComponent<Props, State> {
<Pills mb={4} items={this._items} activeKey={tab.key} onChange={this.handleChangeTab} /> <Pills mb={4} items={this._items} activeKey={tab.key} onChange={this.handleChangeTab} />
<Switch> <Switch>
{this._items.map(i => ( {this._items.map(i => (
<Route key={i.key} path={`${match.url}/${i.key}`} render={i.value && i.value(props)} /> <Route
key={i.key}
path={`${match.url}/${i.key}`} /* eslint-disable-line react/jsx-no-literals */
render={i.value && i.value(props)}
/>
))} ))}
<Route render={defaultItem.value && defaultItem.value(props)} /> <Route render={defaultItem.value && defaultItem.value(props)} />
</Switch> </Switch>

13
src/components/ThrowBlock.js

@ -5,10 +5,13 @@ import React, { PureComponent } from 'react'
import styled from 'styled-components' import styled from 'styled-components'
import { shell, remote } from 'electron' import { shell, remote } from 'electron'
import qs from 'querystring' import qs from 'querystring'
import { translate } from 'react-i18next'
import { rgba } from 'styles/helpers' import { rgba } from 'styles/helpers'
import db from 'helpers/db' import db from 'helpers/db'
import type { T } from 'types/common'
import ExportLogsBtn from 'components/ExportLogsBtn' import ExportLogsBtn from 'components/ExportLogsBtn'
import Box from 'components/base/Box' import Box from 'components/base/Box'
import Button from 'components/base/Button' import Button from 'components/base/Button'
@ -16,6 +19,7 @@ import TranslatedError from './TranslatedError'
type Props = { type Props = {
children: any, children: any,
t: T
} }
type State = { type State = {
@ -79,6 +83,7 @@ ${error.stack}
render() { render() {
const { error } = this.state const { error } = this.state
const { t } = this.props
if (error) { if (error) {
return ( return (
<Container> <Container>
@ -87,14 +92,14 @@ ${error.stack}
</Inner> </Inner>
<Box horizontal flow={2}> <Box horizontal flow={2}>
<Button primary onClick={this.handleRestart}> <Button primary onClick={this.handleRestart}>
{'Restart app'} {t('app:crash.restart')}
</Button> </Button>
<Button danger onClick={this.handleReset}> <Button danger onClick={this.handleReset}>
{'Reset app files'} {t('app:crash.reset')}
</Button> </Button>
<ExportLogsBtn /> <ExportLogsBtn />
<Button primary onClick={this.handleCreateIssue}> <Button primary onClick={this.handleCreateIssue}>
{'Create ticket'} {t('app:crash.createTicket')}
</Button> </Button>
</Box> </Box>
</Container> </Container>
@ -104,4 +109,4 @@ ${error.stack}
} }
} }
export default ThrowBlock export default translate()(ThrowBlock)

6
src/components/base/AccountsList/AccountRow.js

@ -13,6 +13,7 @@ import FormattedVal from 'components/base/FormattedVal'
import Input from 'components/base/Input' import Input from 'components/base/Input'
import IconEdit from 'icons/Edit' import IconEdit from 'icons/Edit'
import IconCheck from 'icons/Check' import IconCheck from 'icons/Check'
import type { T } from 'types/common'
type Props = { type Props = {
account: Account, account: Account,
@ -20,6 +21,7 @@ type Props = {
isDisabled?: boolean, isDisabled?: boolean,
onClick: Account => void, onClick: Account => void,
onAccountUpdate: Account => void, onAccountUpdate: Account => void,
t: T
} }
type State = { type State = {
@ -71,7 +73,7 @@ export default class AccountRow extends PureComponent<Props, State> {
_input = null _input = null
render() { render() {
const { account, isChecked, onClick, isDisabled } = this.props const { account, isChecked, onClick, isDisabled, t } = this.props
const { isEditing, accountNameCopy } = this.state const { isEditing, accountNameCopy } = this.state
return ( return (
@ -100,7 +102,7 @@ export default class AccountRow extends PureComponent<Props, State> {
{!isEditing && ( {!isEditing && (
<Edit onClick={this.handleEditClick}> <Edit onClick={this.handleEditClick}>
<IconEdit size={13} /> <IconEdit size={13} />
<span>{'edit name'}</span> <span>{t('app:addAccounts.editName')}</span>
</Edit> </Edit>
)} )}
<FormattedVal <FormattedVal

1
src/components/base/AccountsList/index.js

@ -67,6 +67,7 @@ const AccountsList = ({
isChecked={checkedIds.find(id => id === account.id) !== undefined} isChecked={checkedIds.find(id => id === account.id) !== undefined}
onClick={onToggleAccount} onClick={onToggleAccount}
onAccountUpdate={onUpdateAccount} onAccountUpdate={onUpdateAccount}
t={t}
/> />
))} ))}
{isLoading && ( {isLoading && (

10
src/components/base/LegacySelect/index.js

@ -4,6 +4,9 @@ import React, { PureComponent } from 'react'
import Downshift from 'downshift' import Downshift from 'downshift'
import styled from 'styled-components' import styled from 'styled-components'
import { space } from 'styled-system' import { space } from 'styled-system'
import { translate } from 'react-i18next'
import type { T } from 'types/common'
import Box from 'components/base/Box' import Box from 'components/base/Box'
import GrowScroll from 'components/base/GrowScroll' import GrowScroll from 'components/base/GrowScroll'
@ -33,6 +36,7 @@ type Props = {
value?: *, value?: *,
disabled: boolean, disabled: boolean,
small?: boolean, small?: boolean,
t: T,
} }
const Container = styled(Box).attrs({ relative: true, color: 'graphite' })`` const Container = styled(Box).attrs({ relative: true, color: 'graphite' })``
@ -163,7 +167,7 @@ class LegacySelect extends PureComponent<Props> {
_children = {} _children = {}
renderItems = (items: Array<Object>, selectedItem: any, downshiftProps: Object) => { renderItems = (items: Array<Object>, selectedItem: any, downshiftProps: Object) => {
const { renderItem, maxHeight, keyProp } = this.props const { renderItem, maxHeight, keyProp, t } = this.props
const { getItemProps, highlightedIndex } = downshiftProps const { getItemProps, highlightedIndex } = downshiftProps
const selectedItemIndex = items.indexOf(selectedItem) const selectedItemIndex = items.indexOf(selectedItem)
@ -228,7 +232,7 @@ class LegacySelect extends PureComponent<Props> {
</GrowScroll> </GrowScroll>
) : ( ) : (
<Box> <Box>
<Item>{'No results'}</Item> <Item>{t('app:error.noResults')}</Item>
</Box> </Box>
)} )}
</Dropdown> </Dropdown>
@ -340,4 +344,4 @@ class LegacySelect extends PureComponent<Props> {
} }
} }
export default LegacySelect export default translate()(LegacySelect)

3
src/components/base/StepperNumber/index.js

@ -140,9 +140,10 @@ class StepperNumber extends PureComponent<Props, State> {
const isMin = this.isMin(value) const isMin = this.isMin(value)
const isMax = this.isMax(value) const isMax = this.isMax(value)
/* eslint-disable react/jsx-no-literals */
return ( return (
<Container> <Container>
<Btn onMouseDown={!isMin ? this.handleMouseDown('decrement') : undefined} disabled={isMin}> <Btn onMouseDown={!isMin ? this.handleMouseDown('decrement') : undefined} disabled={isMin}>
- -
</Btn> </Btn>
<Num>{value}</Num> <Num>{value}</Num>

2
src/components/modals/AddAccounts/index.js

@ -211,7 +211,7 @@ class AddAccounts extends PureComponent<Props, State> {
</ModalContent> </ModalContent>
{!hideFooter && ( {!hideFooter && (
<ModalFooter horizontal align="center" justify="flex-end" style={{ height: 80 }}> <ModalFooter horizontal align="center" justify="flex-end" style={{ height: 80 }}>
{StepFooter ? <StepFooter {...stepProps} /> : <Box>footer</Box>} {StepFooter ? <StepFooter {...stepProps} /> : <Box/>}
</ModalFooter> </ModalFooter>
)} )}
</ModalBody> </ModalBody>

2
src/components/modals/AddAccounts/steps/02-step-connect-device.js

@ -18,6 +18,7 @@ function StepConnectDevice({ t, currency, currentDevice, setState }: StepProps)
<Fragment> <Fragment>
<Box align="center" mb={6}> <Box align="center" mb={6}>
<CurrencyCircleIcon mb={3} size={40} currency={currency} /> <CurrencyCircleIcon mb={3} size={40} currency={currency} />
{/* eslint-disable react/jsx-no-literals */}
<Box ff="Open Sans" fontSize={4} color="dark" textAlign="center" style={{ width: 370 }}> <Box ff="Open Sans" fontSize={4} color="dark" textAlign="center" style={{ width: 370 }}>
<Trans i18nKey="app:addAccounts.connectDevice.desc" parent="div"> <Trans i18nKey="app:addAccounts.connectDevice.desc" parent="div">
{`You're about to import your `} {`You're about to import your `}
@ -27,6 +28,7 @@ function StepConnectDevice({ t, currency, currentDevice, setState }: StepProps)
{` account(s) from your Ledger device. Please follow the steps below:`} {` account(s) from your Ledger device. Please follow the steps below:`}
</Trans> </Trans>
</Box> </Box>
{/* eslint-enable react/jsx-no-literals */}
</Box> </Box>
<ConnectDevice <ConnectDevice
t={t} t={t}

12
src/components/modals/AddAccounts/steps/03-step-import.js

@ -160,18 +160,16 @@ class StepImport extends PureComponent<StepProps> {
onUpdateAccount={this.handleUpdateAccount} onUpdateAccount={this.handleUpdateAccount}
onSelectAll={this.handleSelectAll} onSelectAll={this.handleSelectAll}
onUnselectAll={this.handleUnselectAll} onUnselectAll={this.handleUnselectAll}
isLoading={scanStatus === 'scanning'} isLoading={scanStatus === 'scanning'} /* eslint-disable-line react/jsx-no-literals */
/> />
<AccountsList <AccountsList
title={t('app:addAccounts.createNewAccount')} title={t('app:addAccounts.createNewAccount.title')}
emptyText={ emptyText={t('app:addAccounts.createNewAccount.noOperationOnLastAccount')}
'You cannot create a new account because your last account has no operations'
}
accounts={creatableAccounts} accounts={creatableAccounts}
checkedIds={checkedAccountsIds} checkedIds={checkedAccountsIds}
onToggleAccount={this.handleToggleAccount} onToggleAccount={this.handleToggleAccount}
onUpdateAccount={this.handleUpdateAccount} onUpdateAccount={this.handleUpdateAccount}
isLoading={scanStatus === 'scanning'} isLoading={scanStatus === 'scanning'} /* eslint-disable-line react/jsx-no-literals */
/> />
</Box> </Box>
@ -236,7 +234,7 @@ export const StepImportFooter = ({
return ( return (
<Fragment> <Fragment>
{currency && <CurrencyBadge mr="auto" currency={currency} />} {currency && <CurrencyBadge mr="auto" currency={currency} />}
<Button primary disabled={scanStatus !== 'finished'} onClick={onClick}> <Button primary disabled={scanStatus !== 'finished'} onClick={onClick}> {/* eslint-disable-line react/jsx-no-literals */}
{ctaWording} {ctaWording}
</Button> </Button>
</Fragment> </Fragment>

6
src/components/modals/AddAccounts/steps/04-step-finish.js

@ -8,15 +8,15 @@ import IconCheckCircle from 'icons/CheckCircle'
import type { StepProps } from '../index' import type { StepProps } from '../index'
function StepFinish({ onCloseModal }: StepProps) { function StepFinish({ onCloseModal, t }: StepProps) {
return ( return (
<Box align="center" py={6}> <Box align="center" py={6}>
<Box color="positiveGreen" mb={4}> <Box color="positiveGreen" mb={4}>
<IconCheckCircle size={40} /> <IconCheckCircle size={40} />
</Box> </Box>
<Box mb={4}>{'Great success!'}</Box> <Box mb={4}>{t('app:addAccounts.success')}</Box>
<Button primary onClick={onCloseModal}> <Button primary onClick={onCloseModal}>
{'Close'} {t('app:common.close')}
</Button> </Button>
</Box> </Box>
) )

1
src/components/modals/Debug.js

@ -1,4 +1,5 @@
// @flow // @flow
/* eslint-disable react/jsx-no-literals */
import { getCryptoCurrencyById } from '@ledgerhq/live-common/lib/helpers/currencies' import { getCryptoCurrencyById } from '@ledgerhq/live-common/lib/helpers/currencies'
import last from 'lodash/last' import last from 'lodash/last'
import React, { Component } from 'react' import React, { Component } from 'react'

2
src/components/modals/OperationDetails.js

@ -153,7 +153,7 @@ const OperationDetails = connect(mapStateToProps)((props: Props) => {
? t('app:operationDetails.confirmed') ? t('app:operationDetails.confirmed')
: t('app:operationDetails.notConfirmed')} : t('app:operationDetails.notConfirmed')}
</Box> </Box>
<Box>{`(${confirmations})`}</Box> <Box>{`(${confirmations})`}</Box> {/* eslint-disable-line react/jsx-no-literals */}
</ColRight> </ColRight>
</Line> </Line>
<B /> <B />

4
src/components/modals/Send/Footer.js

@ -76,7 +76,7 @@ class Footer extends PureComponent<
/> />
<Box horizontal align="center"> <Box horizontal align="center">
<Text ff="Rubik" fontSize={3}> <Text ff="Rubik" fontSize={3}>
{'('} {'(' /* eslint-disable-line react/jsx-no-literals */}
</Text> </Text>
<CounterValue <CounterValue
currency={account.currency} currency={account.currency}
@ -88,7 +88,7 @@ class Footer extends PureComponent<
alwaysShowSign={false} alwaysShowSign={false}
/> />
<Text ff="Rubik" fontSize={3}> <Text ff="Rubik" fontSize={3}>
{')'} {')' /* eslint-disable-line react/jsx-no-literals */}
</Text> </Text>
</Box> </Box>
</Box> </Box>

13
static/i18n/en/app.yml

@ -38,6 +38,7 @@ common:
refresh: Refresh refresh: Refresh
error: error:
load: Unable to load load: Unable to load
noResults: No results
operation: operation:
type: type:
IN: Receive funds IN: Receive funds
@ -128,7 +129,11 @@ addAccounts:
accountToImportSubtitle_plural: 'Accounts to import ({{count}})' accountToImportSubtitle_plural: 'Accounts to import ({{count}})'
selectAll: Select all selectAll: Select all
unselectAll: Unselect all unselectAll: Unselect all
createNewAccount: Create new account editName: Edit name
success: Great success!
createNewAccount:
title: Create new account
noOperationOnLastAccount: You cannot create a new account because your last account has no operations
retrySync: Retry sync retrySync: Retry sync
cta: cta:
create: 'Create account' create: 'Create account'
@ -212,6 +217,8 @@ send:
message: Leave a message (140) message: Leave a message (140)
rippleTag: Tag rippleTag: Tag
ethereumGasLimit: Gas limit ethereumGasLimit: Gas limit
unitPerByte: '{{unit}} per byte'
feePerByte: Fee per byte
connectDevice: connectDevice:
title: Connect device title: Connect device
verification: verification:
@ -345,3 +352,7 @@ password:
update: update:
newVersionReady: A new update is available. newVersionReady: A new update is available.
relaunch: Update now relaunch: Update now
crash:
restart: Restart app
reset: Reset app files
createTicket: Create ticket

Loading…
Cancel
Save