aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/account-menu/index.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-22 08:41:47 +0800
committerDan <danjm.com@gmail.com>2018-03-22 08:41:47 +0800
commitd24a0590d363dbe88d383c8faec8eb28809242f0 (patch)
tree189e54ca9ea117804c96afa551cfca8158f36974 /ui/app/components/account-menu/index.js
parent29cc2f8ab9628d21cc32962666879c71be4e69d1 (diff)
downloadtangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.gz
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.bz2
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.lz
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.xz
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.zst
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.zip
i18n redux solution doesn't require importing t() and passing state to each t() call; t is just available on props.
Diffstat (limited to 'ui/app/components/account-menu/index.js')
-rw-r--r--ui/app/components/account-menu/index.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/ui/app/components/account-menu/index.js b/ui/app/components/account-menu/index.js
index dc9c36c40..a9120f9db 100644
--- a/ui/app/components/account-menu/index.js
+++ b/ui/app/components/account-menu/index.js
@@ -6,7 +6,6 @@ const actions = require('../../actions')
const { Menu, Item, Divider, CloseArea } = require('../dropdowns/components/menu')
const Identicon = require('../identicon')
const { formatBalance } = require('../../util')
-const t = require('../../../i18n-helper').getMessage
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountMenu)
@@ -71,10 +70,10 @@ AccountMenu.prototype.render = function () {
h(Item, {
className: 'account-menu__header',
}, [
- t(this.props.localeMessages, 'myAccounts'),
+ this.props.t('myAccounts'),
h('button.account-menu__logout-button', {
onClick: lockMetamask,
- }, t(this.props.localeMessages, 'logout')),
+ }, this.props.t('logout')),
]),
h(Divider),
h('div.account-menu__accounts', this.renderAccounts()),
@@ -82,23 +81,23 @@ AccountMenu.prototype.render = function () {
h(Item, {
onClick: () => showNewAccountPage('CREATE'),
icon: h('img.account-menu__item-icon', { src: 'images/plus-btn-white.svg' }),
- text: t(this.props.localeMessages, 'createAccount'),
+ text: this.props.t('createAccount'),
}),
h(Item, {
onClick: () => showNewAccountPage('IMPORT'),
icon: h('img.account-menu__item-icon', { src: 'images/import-account.svg' }),
- text: t(this.props.localeMessages, 'importAccount'),
+ text: this.props.t('importAccount'),
}),
h(Divider),
h(Item, {
onClick: showInfoPage,
icon: h('img', { src: 'images/mm-info-icon.svg' }),
- text: t(this.props.localeMessages, 'infoHelp'),
+ text: this.props.t('infoHelp'),
}),
h(Item, {
onClick: showConfigPage,
icon: h('img.account-menu__item-icon', { src: 'images/settings.svg' }),
- text: t(this.props.localeMessages, 'settings'),
+ text: this.props.t('settings'),
}),
])
}
@@ -156,6 +155,6 @@ AccountMenu.prototype.indicateIfLoose = function (keyring) {
try { // Sometimes keyrings aren't loaded yet:
const type = keyring.type
const isLoose = type !== 'HD Key Tree'
- return isLoose ? h('.keyring-label.allcaps', t(this.props.localeMessages, 'imported')) : null
+ return isLoose ? h('.keyring-label.allcaps', this.props.t('imported')) : null
} catch (e) { return }
}