diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-03-31 07:18:48 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-03-31 07:18:48 +0800 |
commit | ba23843f91ca5046400cea14cea4c0d256578fec (patch) | |
tree | e29ef2a930930d4256bd7f59aa3d0274563bc4cf /ui/app/components/account-menu | |
parent | bdc4a6964ae83faa8229c50870e3bcc9b9074989 (diff) | |
parent | 8e0f39353dd47c4a201aaf2ee160912846f2e68b (diff) | |
download | tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar.gz tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar.bz2 tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar.lz tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar.xz tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar.zst tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.zip |
Fix merge conflicts
Diffstat (limited to 'ui/app/components/account-menu')
-rw-r--r-- | ui/app/components/account-menu/index.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/ui/app/components/account-menu/index.js b/ui/app/components/account-menu/index.js index 7927b80d5..7638995ea 100644 --- a/ui/app/components/account-menu/index.js +++ b/ui/app/components/account-menu/index.js @@ -1,8 +1,9 @@ const inherits = require('util').inherits const Component = require('react').Component -const connect = require('../../metamask-connect') +const connect = require('react-redux').connect const { compose } = require('recompose') const { withRouter } = require('react-router-dom') +const PropTypes = require('prop-types') const h = require('react-hyperscript') const actions = require('../../actions') const { Menu, Item, Divider, CloseArea } = require('../dropdowns/components/menu') @@ -21,6 +22,10 @@ module.exports = compose( connect(mapStateToProps, mapDispatchToProps) )(AccountMenu) +AccountMenu.contextTypes = { + t: PropTypes.func, +} + inherits(AccountMenu, Component) function AccountMenu () { Component.call(this) } @@ -74,13 +79,13 @@ AccountMenu.prototype.render = function () { h(Item, { className: 'account-menu__header', }, [ - this.props.t('myAccounts'), + this.context.t('myAccounts'), h('button.account-menu__logout-button', { onClick: () => { lockMetamask() history.push(DEFAULT_ROUTE) }, - }, this.props.t('logout')), + }, this.context.t('logout')), ]), h(Divider), h('div.account-menu__accounts', this.renderAccounts()), @@ -91,7 +96,7 @@ AccountMenu.prototype.render = function () { history.push(NEW_ACCOUNT_ROUTE) }, icon: h('img.account-menu__item-icon', { src: 'images/plus-btn-white.svg' }), - text: this.props.t('createAccount'), + text: this.context.t('createAccount'), }), h(Item, { onClick: () => { @@ -99,7 +104,7 @@ AccountMenu.prototype.render = function () { history.push(IMPORT_ACCOUNT_ROUTE) }, icon: h('img.account-menu__item-icon', { src: 'images/import-account.svg' }), - text: this.props.t('importAccount'), + text: this.context.t('importAccount'), }), h(Divider), h(Item, { @@ -108,7 +113,7 @@ AccountMenu.prototype.render = function () { history.push(INFO_ROUTE) }, icon: h('img', { src: 'images/mm-info-icon.svg' }), - text: this.props.t('infoHelp'), + text: this.context.t('infoHelp'), }), h(Item, { onClick: () => { @@ -116,7 +121,7 @@ AccountMenu.prototype.render = function () { history.push(SETTINGS_ROUTE) }, icon: h('img.account-menu__item-icon', { src: 'images/settings.svg' }), - text: this.props.t('settings'), + text: this.context.t('settings'), }), ]) } @@ -174,6 +179,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', this.props.t('imported')) : null + return isLoose ? h('.keyring-label.allcaps', this.context.t('imported')) : null } catch (e) { return } } |