aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/first-time
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-29 23:00:44 +0800
committerDan <danjm.com@gmail.com>2018-03-29 23:12:38 +0800
commit0a711f0de0e342b24988a5da4ca5c64342153210 (patch)
tree9dd6014e6389cfad02d5380e6810a12fdf747b0a /ui/app/first-time
parent650b716f55fcfa809b22708b9ad43c8a0716f9fc (diff)
downloadtangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.gz
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.zst
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.zip
Removes t from props via metamask-connect and instead places it on context via a provider.
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
}