aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/accounts/import/json.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/import/json.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/import/json.js')
-rw-r--r--ui/app/accounts/import/json.js25
1 files changed, 15 insertions, 10 deletions
diff --git a/ui/app/accounts/import/json.js b/ui/app/accounts/import/json.js
index 02b64858d..e53c1c9ca 100644
--- a/ui/app/accounts/import/json.js
+++ b/ui/app/accounts/import/json.js
@@ -1,7 +1,7 @@
const Component = require('react').Component
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')
const FileInput = require('react-simple-file-input').default
@@ -24,11 +24,11 @@ class JsonImportSubview extends Component {
return (
h('div.new-account-import-form__json', [
- h('p', this.props.t('usedByClients')),
+ h('p', this.context.t('usedByClients')),
h('a.warning', {
href: HELP_LINK,
target: '_blank',
- }, this.props.t('fileImportFail')),
+ }, this.context.t('fileImportFail')),
h(FileInput, {
readAs: 'text',
@@ -43,7 +43,7 @@ class JsonImportSubview extends Component {
h('input.new-account-import-form__input-password', {
type: 'password',
- placeholder: this.props.t('enterPassword'),
+ placeholder: this.context.t('enterPassword'),
id: 'json-password-box',
onKeyPress: this.createKeyringOnEnter.bind(this),
}),
@@ -53,13 +53,13 @@ class JsonImportSubview extends Component {
h('button.btn-secondary.new-account-create-form__button', {
onClick: () => this.props.goHome(),
}, [
- this.props.t('cancel'),
+ this.context.t('cancel'),
]),
h('button.btn-primary.new-account-create-form__button', {
onClick: () => this.createNewKeychain(),
}, [
- this.props.t('import'),
+ this.context.t('import'),
]),
]),
@@ -84,14 +84,14 @@ class JsonImportSubview extends Component {
const state = this.state
if (!state) {
- const message = this.props.t('validFileImport')
+ const message = this.context.t('validFileImport')
return this.props.displayWarning(message)
}
const { fileContents } = state
if (!fileContents) {
- const message = this.props.t('needImportFile')
+ const message = this.context.t('needImportFile')
return this.props.displayWarning(message)
}
@@ -99,7 +99,7 @@ class JsonImportSubview extends Component {
const password = passwordInput.value
if (!password) {
- const message = this.props.t('needImportPassword')
+ const message = this.context.t('needImportPassword')
return this.props.displayWarning(message)
}
@@ -112,7 +112,7 @@ JsonImportSubview.propTypes = {
goHome: PropTypes.func,
displayWarning: PropTypes.func,
importNewJsonAccount: PropTypes.func,
- t: PropTypes.func,
+ t: PropTypes.func,
}
const mapStateToProps = state => {
@@ -129,4 +129,9 @@ const mapDispatchToProps = dispatch => {
}
}
+JsonImportSubview.contextTypes = {
+ t: PropTypes.func,
+}
+
module.exports = connect(mapStateToProps, mapDispatchToProps)(JsonImportSubview)
+