aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/first-time
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-03-30 07:52:52 +0800
committerGitHub <noreply@github.com>2018-03-30 07:52:52 +0800
commit9d4be1842e7c56e3bfde529ff555dcae8dec3dbd (patch)
tree6d52709412f407389b58ec15923fe0794f093dcf /ui/app/first-time
parent5a0523cdfd50dcd4e5680134346ccfcb4bb7cbf4 (diff)
parent74f13c0a34494ab9c96db8772ea2b443ede0835b (diff)
downloadtangerine-wallet-browser-9d4be1842e7c56e3bfde529ff555dcae8dec3dbd.tar.gz
tangerine-wallet-browser-9d4be1842e7c56e3bfde529ff555dcae8dec3dbd.tar.zst
tangerine-wallet-browser-9d4be1842e7c56e3bfde529ff555dcae8dec3dbd.zip
Merge pull request #3788 from danjm/i3787-make-t-available-via-context
i18n - Removes t from props via metamask-connect; put t on context
Diffstat (limited to 'ui/app/first-time')
-rw-r--r--ui/app/first-time/init-menu.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/ui/app/first-time/init-menu.js b/ui/app/first-time/init-menu.js
index c0c2d3ed0..4ab5f06c0 100644
--- a/ui/app/first-time/init-menu.js
+++ b/ui/app/first-time/init-menu.js
@@ -1,7 +1,8 @@
const inherits = require('util').inherits
const EventEmitter = require('events').EventEmitter
const Component = require('react').Component
-const connect = require('../metamask-connect')
+const PropTypes = require('prop-types')
+const connect = require('react-redux').connect
const h = require('react-hyperscript')
const Mascot = require('../components/mascot')
const actions = require('../actions')
@@ -12,8 +13,13 @@ const { OLD_UI_NETWORK_TYPE } = require('../../../app/scripts/config').enums
let isSubmitting = false
+InitializeMenuScreen.contextTypes = {
+ t: PropTypes.func,
+}
+
module.exports = connect(mapStateToProps)(InitializeMenuScreen)
+
inherits(InitializeMenuScreen, Component)
function InitializeMenuScreen () {
Component.call(this)
@@ -59,7 +65,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
color: '#7F8082',
marginBottom: 10,
},
- }, this.props.t('appName')),
+ }, this.context.t('appName')),
h('div', [
@@ -69,10 +75,10 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
color: '#7F8082',
display: 'inline',
},
- }, this.props.t('encryptNewDen')),
+ }, this.context.t('encryptNewDen')),
h(Tooltip, {
- title: this.props.t('denExplainer'),
+ title: this.context.t('denExplainer'),
}, [
h('i.fa.fa-question-circle.pointer', {
style: {
@@ -92,7 +98,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
h('input.large-input.letter-spacey', {
type: 'password',
id: 'password-box',
- placeholder: this.props.t('newPassword'),
+ placeholder: this.context.t('newPassword'),
onInput: this.inputChanged.bind(this),
style: {
width: 260,
@@ -104,7 +110,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
h('input.large-input.letter-spacey', {
type: 'password',
id: 'password-box-confirm',
- placeholder: this.props.t('confirmPassword'),
+ placeholder: this.context.t('confirmPassword'),
onKeyPress: this.createVaultOnEnter.bind(this),
onInput: this.inputChanged.bind(this),
style: {
@@ -119,7 +125,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
style: {
margin: 12,
},
- }, this.props.t('createDen')),
+ }, this.context.t('createDen')),
h('.flex-row.flex-center.flex-grow', [
h('p.pointer', {
@@ -129,7 +135,7 @@ InitializeMenuScreen.prototype.renderMenu = function (state) {
color: 'rgb(247, 134, 28)',
textDecoration: 'underline',
},
- }, this.props.t('importDen')),
+ }, this.context.t('importDen')),
]),
h('.flex-row.flex-center.flex-grow', [
@@ -178,12 +184,12 @@ InitializeMenuScreen.prototype.createNewVaultAndKeychain = function () {
var passwordConfirm = passwordConfirmBox.value
if (password.length < 8) {
- this.warning = this.props.t('passwordShort')
+ this.warning = this.context.t('passwordShort')
this.props.dispatch(actions.displayWarning(this.warning))
return
}
if (password !== passwordConfirm) {
- this.warning = this.props.t('passwordMismatch')
+ this.warning = this.context.t('passwordMismatch')
this.props.dispatch(actions.displayWarning(this.warning))
return
}