diff --git a/package.json b/package.json index df17e253..90066221 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "react": "^16.2.0", "react-dom": "^16.2.0", "react-i18next": "^7.3.4", - "react-mortal": "^3.0.1", + "react-mortal": "^3.1.0", "react-motion": "^0.5.2", "react-qr-reader": "^2.0.1", "react-redux": "^5.0.6", diff --git a/src/components/AccountPage.js b/src/components/AccountPage.js index 649c9fbf..a17a0e1c 100644 --- a/src/components/AccountPage.js +++ b/src/components/AccountPage.js @@ -82,18 +82,23 @@ class AccountPage extends PureComponent { - + {formatBTC(accountData.balance)} - + - + diff --git a/src/components/IsUnlocked/index.js b/src/components/IsUnlocked/index.js index 12ddc0fd..75b96995 100644 --- a/src/components/IsUnlocked/index.js +++ b/src/components/IsUnlocked/index.js @@ -2,10 +2,12 @@ import React, { PureComponent } from 'react' import { connect } from 'react-redux' +import { compose } from 'redux' +import { translate } from 'react-i18next' import bcrypt from 'bcryptjs' import type { MapStateToProps } from 'react-redux' -import type { Settings, Accounts } from 'types/common' +import type { Settings, Accounts, T } from 'types/common' import get from 'lodash/get' @@ -24,6 +26,7 @@ type InputValue = { } type Props = { + t: T, accounts: Accounts, fetchAccounts: Function, isLocked: boolean, @@ -108,7 +111,7 @@ class IsUnlocked extends PureComponent { render() { const { inputValue } = this.state - const { isLocked, render } = this.props + const { isLocked, render, t } = this.props if (isLocked) { return ( @@ -118,7 +121,7 @@ class IsUnlocked extends PureComponent { (this._input = n)} - placeholder="Password" + placeholder={t('IsUnlocked.password')} type="password" onChange={this.handleChangeInput('password')} value={inputValue.password} @@ -133,6 +136,9 @@ class IsUnlocked extends PureComponent { } } -export default connect(mapStateToProps, mapDispatchToProps, null, { - pure: false, -})(IsUnlocked) +export default compose( + connect(mapStateToProps, mapDispatchToProps, null, { + pure: false, + }), + translate(), +)(IsUnlocked) diff --git a/src/components/UpdateNotifier.js b/src/components/UpdateNotifier.js index 45721e49..a0e659e1 100644 --- a/src/components/UpdateNotifier.js +++ b/src/components/UpdateNotifier.js @@ -1,6 +1,8 @@ // @flow import React, { PureComponent } from 'react' +import { translate } from 'react-i18next' +import { compose } from 'redux' import { Motion, spring } from 'react-motion' import { connect } from 'react-redux' import type { MapStateToProps } from 'react-redux' @@ -14,7 +16,10 @@ import type { UpdateStatus } from 'reducers/update' import Box from 'components/base/Box' import Text from 'components/base/Text' +import type { T } from 'types/common' + type Props = { + t: T, updateStatus: UpdateStatus, } @@ -40,7 +45,7 @@ const Container = styled(Box).attrs({ class UpdateNotifier extends PureComponent { renderStatus() { - const { updateStatus } = this.props + const { updateStatus, t } = this.props switch (updateStatus) { case 'idle': case 'checking': @@ -52,12 +57,12 @@ class UpdateNotifier extends PureComponent { case 'downloaded': return ( - {'A new version is ready to be installed.'} + {t('update.newVersionReady')} sendEvent('msg', 'updater.quitAndInstall')} > - {'Re-launch app now'} + {t('update.relaunch')} ) @@ -82,4 +87,4 @@ class UpdateNotifier extends PureComponent { } } -export default connect(mapStateToProps, null)(UpdateNotifier) +export default compose(connect(mapStateToProps, null), translate())(UpdateNotifier) diff --git a/src/components/Wrapper.js b/src/components/Wrapper.js index 0f330bbf..85ecf759 100644 --- a/src/components/Wrapper.js +++ b/src/components/Wrapper.js @@ -36,7 +36,7 @@ class Wrapper extends Component<{}> { - {__PROD__ && } + diff --git a/src/components/base/Modal/index.js b/src/components/base/Modal/index.js index 7a4dbc8d..f6f1aad8 100644 --- a/src/components/base/Modal/index.js +++ b/src/components/base/Modal/index.js @@ -20,6 +20,7 @@ import Icon from 'components/base/Icon' type Props = { isOpened?: boolean, onClose: Function, + onHide?: Function, preventBackdropClick?: boolean, render: Function, data?: any, @@ -109,11 +110,12 @@ export class Modal extends PureComponent { } render() { - const { preventBackdropClick, isOpened, onClose, render, data } = this.props + const { preventBackdropClick, isOpened, onClose, onHide, render, data } = this.props return ( ({ opacity: spring(isVisible ? 1 : 0, springConfig), y: spring(isVisible ? 0 : 20, springConfig), diff --git a/src/components/modals/AddAccount/index.js b/src/components/modals/AddAccount/index.js index 6c210bf8..8a855f6d 100644 --- a/src/components/modals/AddAccount/index.js +++ b/src/components/modals/AddAccount/index.js @@ -2,12 +2,14 @@ import React, { PureComponent } from 'react' import { connect } from 'react-redux' +import { compose } from 'redux' +import { translate } from 'react-i18next' import { ipcRenderer } from 'electron' import { MODAL_ADD_ACCOUNT } from 'constants' import type { MapStateToProps } from 'react-redux' -import type { Accounts, Device } from 'types/common' +import type { Accounts, Device, T } from 'types/common' import { closeModal } from 'reducers/modals' import { canCreateAccount, getAccounts } from 'reducers/accounts' @@ -38,9 +40,9 @@ const Steps = {
- +