aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/account-export.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/account-export.js')
-rw-r--r--ui/app/components/account-export.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/ui/app/components/account-export.js b/ui/app/components/account-export.js
index 8889f88a7..865207487 100644
--- a/ui/app/components/account-export.js
+++ b/ui/app/components/account-export.js
@@ -1,14 +1,20 @@
const Component = require('react').Component
const h = require('react-hyperscript')
+const PropTypes = require('prop-types')
const inherits = require('util').inherits
const exportAsFile = require('../util').exportAsFile
const copyToClipboard = require('copy-to-clipboard')
const actions = require('../actions')
const ethUtil = require('ethereumjs-util')
-const connect = require('../metamask-connect')
+const connect = require('react-redux').connect
+
+ExportAccountView.contextTypes = {
+ t: PropTypes.func,
+}
module.exports = connect(mapStateToProps)(ExportAccountView)
+
inherits(ExportAccountView, Component)
function ExportAccountView () {
Component.call(this)
@@ -35,7 +41,7 @@ ExportAccountView.prototype.render = function () {
if (notExporting) return h('div')
if (exportRequested) {
- const warning = this.props.t('exportPrivateKeyWarning')
+ const warning = this.context.t('exportPrivateKeyWarning')
return (
h('div', {
style: {
@@ -53,7 +59,7 @@ ExportAccountView.prototype.render = function () {
h('p.error', warning),
h('input#exportAccount.sizing-input', {
type: 'password',
- placeholder: this.props.t('confirmPassword').toLowerCase(),
+ placeholder: this.context.t('confirmPassword').toLowerCase(),
onKeyPress: this.onExportKeyPress.bind(this),
style: {
position: 'relative',
@@ -74,10 +80,10 @@ ExportAccountView.prototype.render = function () {
style: {
marginRight: '10px',
},
- }, this.props.t('submit')),
+ }, this.context.t('submit')),
h('button', {
onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)),
- }, this.props.t('cancel')),
+ }, this.context.t('cancel')),
]),
(this.props.warning) && (
h('span.error', {
@@ -98,7 +104,7 @@ ExportAccountView.prototype.render = function () {
margin: '0 20px',
},
}, [
- h('label', this.props.t('copyPrivateKey') + ':'),
+ h('label', this.context.t('copyPrivateKey') + ':'),
h('p.error.cursor-pointer', {
style: {
textOverflow: 'ellipsis',
@@ -112,13 +118,13 @@ ExportAccountView.prototype.render = function () {
}, plainKey),
h('button', {
onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)),
- }, this.props.t('done')),
+ }, this.context.t('done')),
h('button', {
style: {
marginLeft: '10px',
},
onClick: () => exportAsFile(`MetaMask ${nickname} Private Key`, plainKey),
- }, this.props.t('saveAsFile')),
+ }, this.context.t('saveAsFile')),
])
}
}