diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-03-31 07:18:48 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-03-31 07:18:48 +0800 |
commit | ba23843f91ca5046400cea14cea4c0d256578fec (patch) | |
tree | e29ef2a930930d4256bd7f59aa3d0274563bc4cf /ui/app/components/signature-request.js | |
parent | bdc4a6964ae83faa8229c50870e3bcc9b9074989 (diff) | |
parent | 8e0f39353dd47c4a201aaf2ee160912846f2e68b (diff) | |
download | tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar.gz tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar.bz2 tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar.lz tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar.xz tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.tar.zst tangerine-wallet-browser-ba23843f91ca5046400cea14cea4c0d256578fec.zip |
Fix merge conflicts
Diffstat (limited to 'ui/app/components/signature-request.js')
-rw-r--r-- | ui/app/components/signature-request.js | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/ui/app/components/signature-request.js b/ui/app/components/signature-request.js index 92feb70ba..b958a2d2d 100644 --- a/ui/app/components/signature-request.js +++ b/ui/app/components/signature-request.js @@ -1,8 +1,9 @@ const Component = require('react').Component +const PropTypes = require('prop-types') const h = require('react-hyperscript') const inherits = require('util').inherits const Identicon = require('./identicon') -const connect = require('../metamask-connect') +const connect = require('react-redux').connect const ethUtil = require('ethereumjs-util') const classnames = require('classnames') const { compose } = require('recompose') @@ -41,11 +42,16 @@ function mapDispatchToProps (dispatch) { } } +SignatureRequest.contextTypes = { + t: PropTypes.func, +} + module.exports = compose( withRouter, connect(mapStateToProps, mapDispatchToProps) )(SignatureRequest) + inherits(SignatureRequest, Component) function SignatureRequest (props) { Component.call(this) @@ -61,7 +67,7 @@ SignatureRequest.prototype.renderHeader = function () { h('div.request-signature__header-background'), - h('div.request-signature__header__text', this.props.t('sigRequest')), + h('div.request-signature__header__text', this.context.t('sigRequest')), h('div.request-signature__header__tip-container', [ h('div.request-signature__header__tip'), @@ -82,7 +88,7 @@ SignatureRequest.prototype.renderAccountDropdown = function () { return h('div.request-signature__account', [ - h('div.request-signature__account-text', [this.props.t('account') + ':']), + h('div.request-signature__account-text', [this.context.t('account') + ':']), h(AccountDropdownMini, { selectedAccount, @@ -109,7 +115,7 @@ SignatureRequest.prototype.renderBalance = function () { return h('div.request-signature__balance', [ - h('div.request-signature__balance-text', [this.props.t('balance')]), + h('div.request-signature__balance-text', [this.context.t('balance')]), h('div.request-signature__balance-value', `${balanceInEther} ETH`), @@ -143,7 +149,7 @@ SignatureRequest.prototype.renderRequestInfo = function () { return h('div.request-signature__request-info', [ h('div.request-signature__headline', [ - this.props.t('yourSigRequested'), + this.context.t('yourSigRequested'), ]), ]) @@ -161,18 +167,18 @@ SignatureRequest.prototype.msgHexToText = function (hex) { SignatureRequest.prototype.renderBody = function () { let rows - let notice = this.props.t('youSign') + ':' + let notice = this.context.t('youSign') + ':' const { txData } = this.props const { type, msgParams: { data } } = txData if (type === 'personal_sign') { - rows = [{ name: this.props.t('message'), value: this.msgHexToText(data) }] + rows = [{ name: this.context.t('message'), value: this.msgHexToText(data) }] } else if (type === 'eth_signTypedData') { rows = data } else if (type === 'eth_sign') { - rows = [{ name: this.props.t('message'), value: data }] - notice = this.props.t('signNotice') + rows = [{ name: this.context.t('message'), value: data }] + notice = this.context.t('signNotice') } return h('div.request-signature__body', {}, [ @@ -233,12 +239,12 @@ SignatureRequest.prototype.renderFooter = function () { onClick: event => { cancel(event).then(() => this.props.history.push(DEFAULT_ROUTE)) }, - }, this.props.t('cancel')), + }, this.context.t('cancel')), h('button.btn-primary--lg', { onClick: event => { sign(event).then(() => this.props.history.push(DEFAULT_ROUTE)) }, - }, this.props.t('sign')), + }, this.context.t('sign')), ]) } |