diff options
Diffstat (limited to 'ui/app/app.js')
-rw-r--r-- | ui/app/app.js | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/ui/app/app.js b/ui/app/app.js index d1b17ab5d..0b7a7a1e0 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -2,9 +2,9 @@ const inherits = require('util').inherits const Component = require('react').Component const connect = require('react-redux').connect const h = require('react-hyperscript') +const PropTypes = require('prop-types') const actions = require('./actions') const classnames = require('classnames') -const t = require('../i18n') // mascara const MascaraFirstTime = require('../../mascara/src/app/first-time').default @@ -46,8 +46,13 @@ const QrView = require('./components/qr-code') // Global Modals const Modal = require('./components/modals/index').Modal +App.contextTypes = { + t: PropTypes.func, +} + module.exports = connect(mapStateToProps, mapDispatchToProps)(App) + inherits(App, Component) function App () { Component.call(this) } @@ -289,13 +294,13 @@ App.prototype.renderAppBar = function () { h('img.metafox-icon', { height: 42, width: 42, - src: '/images/metamask-fox.svg', + src: './images/metamask-fox.svg', }), // metamask name h('.flex-row', [ - h('h1', t('appName')), - h('div.beta-label', t('beta')), + h('h1', this.context.t('appName')), + h('div.beta-label', this.context.t('beta')), ]), ]), @@ -557,15 +562,15 @@ App.prototype.getConnectingLabel = function () { let name if (providerName === 'mainnet') { - name = t('connectingToMainnet') + name = this.context.t('connectingToMainnet') } else if (providerName === 'ropsten') { - name = t('connectingToRopsten') + name = this.context.t('connectingToRopsten') } else if (providerName === 'kovan') { - name = t('connectingToRopsten') + name = this.context.t('connectingToRopsten') } else if (providerName === 'rinkeby') { - name = t('connectingToRinkeby') + name = this.context.t('connectingToRinkeby') } else { - name = t('connectingToUnknown') + name = this.context.t('connectingToUnknown') } return name @@ -578,15 +583,15 @@ App.prototype.getNetworkName = function () { let name if (providerName === 'mainnet') { - name = t('mainnet') + name = this.context.t('mainnet') } else if (providerName === 'ropsten') { - name = t('ropsten') + name = this.context.t('ropsten') } else if (providerName === 'kovan') { - name = t('kovan') + name = this.context.t('kovan') } else if (providerName === 'rinkeby') { - name = t('rinkeby') + name = this.context.t('rinkeby') } else { - name = t('unknownNetwork') + name = this.context.t('unknownNetwork') } return name |