aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/components/pages/home.js2
-rw-r--r--ui/app/components/tx-view.js37
-rw-r--r--ui/app/i18n-provider.js5
-rw-r--r--ui/app/metamask-connect.js27
4 files changed, 29 insertions, 42 deletions
diff --git a/ui/app/components/pages/home.js b/ui/app/components/pages/home.js
index 86bd32c8a..38aa02dae 100644
--- a/ui/app/components/pages/home.js
+++ b/ui/app/components/pages/home.js
@@ -1,6 +1,6 @@
const { Component } = require('react')
+const { connect } = require('react-redux')
const PropTypes = require('prop-types')
-const connect = require('../../metamask-connect')
const { Redirect, withRouter } = require('react-router-dom')
const { compose } = require('recompose')
const h = require('react-hyperscript')
diff --git a/ui/app/components/tx-view.js b/ui/app/components/tx-view.js
index 014497fcd..654090da6 100644
--- a/ui/app/components/tx-view.js
+++ b/ui/app/components/tx-view.js
@@ -11,6 +11,7 @@ const { SEND_ROUTE } = require('../routes')
const { checksumAddress: toChecksumAddress } = require('../util')
const BalanceComponent = require('./balance-component')
+const Tooltip = require('./tooltip')
const TxList = require('./tx-list')
const SelectedAccount = require('./selected-account')
@@ -103,7 +104,8 @@ TxView.prototype.renderButtons = function () {
}
TxView.prototype.render = function () {
- const { isMascara } = this.props
+ const { hideSidebar, isMascara, showSidebar, sidebarOpen } = this.props
+ const { t } = this.context
return h('div.tx-view.flex-column', {
style: {},
@@ -120,21 +122,30 @@ TxView.prototype.render = function () {
},
}, [
- h('div.fa.fa-bars', {
- style: {
- fontSize: '1.3em',
- cursor: 'pointer',
- padding: '10px',
- },
- onClick: () => this.props.sidebarOpen ? this.props.hideSidebar() : this.props.showSidebar(),
- }),
+ h(Tooltip, {
+ title: t('menu'),
+ position: 'bottom',
+ }, [
+ h('div.fa.fa-bars', {
+ style: {
+ fontSize: '1.3em',
+ cursor: 'pointer',
+ padding: '10px',
+ },
+ onClick: () => sidebarOpen ? hideSidebar() : showSidebar(),
+ }),
+ ]),
h(SelectedAccount),
- !isMascara && h('div.open-in-browser', {
- onClick: () => global.platform.openExtensionInBrowser(),
- }, [h('img', { src: 'images/popout.svg' })]),
-
+ !isMascara && h(Tooltip, {
+ title: t('openInTab'),
+ position: 'bottom',
+ }, [
+ h('div.open-in-browser', {
+ onClick: () => global.platform.openExtensionInBrowser(),
+ }, [h('img', { src: 'images/popout.svg' })]),
+ ]),
]),
this.renderHeroBalance(),
diff --git a/ui/app/i18n-provider.js b/ui/app/i18n-provider.js
index 2856e0ed6..d46911f7c 100644
--- a/ui/app/i18n-provider.js
+++ b/ui/app/i18n-provider.js
@@ -8,8 +8,11 @@ const t = require('../i18n-helper').getMessage
class I18nProvider extends Component {
getChildContext () {
const { localeMessages } = this.props
+ const { current, en } = localeMessages
return {
- t: t.bind(null, localeMessages),
+ t (key, ...args) {
+ return t(current, key, ...args) || t(en, key, ...args) || `[${key}]`
+ },
}
}
diff --git a/ui/app/metamask-connect.js b/ui/app/metamask-connect.js
deleted file mode 100644
index 81fa7e403..000000000
--- a/ui/app/metamask-connect.js
+++ /dev/null
@@ -1,27 +0,0 @@
-const connect = require('react-redux').connect
-const t = require('../i18n-helper').getMessage
-
-const metamaskConnect = (mapStateToProps, mapDispatchToProps) => {
- return connect(
- _higherOrderMapStateToProps(mapStateToProps),
- mapDispatchToProps
- )
-}
-
-const _higherOrderMapStateToProps = (mapStateToProps) => {
- let _t
- let currentLocale
- return (state, ownProps = {}) => {
- const stateProps = mapStateToProps
- ? mapStateToProps(state, ownProps)
- : ownProps
- if (currentLocale !== state.metamask.currentLocale) {
- currentLocale = state.metamask.currentLocale
- _t = t.bind(null, state.localeMessages)
- }
- stateProps.t = _t
- return stateProps
- }
-}
-
-module.exports = metamaskConnect