aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/accounts/new-account/create-form.js
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/accounts/new-account/create-form.js
parent650b716f55fcfa809b22708b9ad43c8a0716f9fc (diff)
downloadtangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.gz
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.bz2
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.lz
tangerine-wallet-browser-0a711f0de0e342b24988a5da4ca5c64342153210.tar.xz
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/accounts/new-account/create-form.js')
-rw-r--r--ui/app/accounts/new-account/create-form.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/ui/app/accounts/new-account/create-form.js b/ui/app/accounts/new-account/create-form.js
index 69fbf1e35..48c74192a 100644
--- a/ui/app/accounts/new-account/create-form.js
+++ b/ui/app/accounts/new-account/create-form.js
@@ -1,11 +1,11 @@
const { Component } = require('react')
const PropTypes = require('prop-types')
const h = require('react-hyperscript')
-const connect = require('../../metamask-connect')
+const connect = require('react-redux').connect
const actions = require('../../actions')
class NewAccountCreateForm extends Component {
- constructor (props) {
+ constructor (props, context) {
super(props)
const { numberOfExistingAccounts = 0 } = props
@@ -13,7 +13,7 @@ class NewAccountCreateForm extends Component {
this.state = {
newAccountName: '',
- defaultAccountName: this.props.t('newAccountNumberName', [newAccountNumber]),
+ defaultAccountName: context.t('newAccountNumberName', [newAccountNumber]),
}
}
@@ -24,7 +24,7 @@ class NewAccountCreateForm extends Component {
return h('div.new-account-create-form', [
h('div.new-account-create-form__input-label', {}, [
- this.props.t('accountName'),
+ this.context.t('accountName'),
]),
h('div.new-account-create-form__input-wrapper', {}, [
@@ -40,13 +40,13 @@ class NewAccountCreateForm extends Component {
h('button.btn-secondary--lg.new-account-create-form__button', {
onClick: () => this.props.goHome(),
}, [
- this.props.t('cancel'),
+ this.context.t('cancel'),
]),
h('button.btn-primary--lg.new-account-create-form__button', {
onClick: () => this.props.createAccount(newAccountName || defaultAccountName),
}, [
- this.props.t('create'),
+ this.context.t('create'),
]),
]),
@@ -97,4 +97,9 @@ const mapDispatchToProps = dispatch => {
}
}
+NewAccountCreateForm.contextTypes = {
+ t: PropTypes.func,
+}
+
module.exports = connect(mapStateToProps, mapDispatchToProps)(NewAccountCreateForm)
+