aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/send-v2.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/send-v2.js')
-rw-r--r--ui/app/send-v2.js33
1 files changed, 19 insertions, 14 deletions
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js
index 011d99d31..e483008c6 100644
--- a/ui/app/send-v2.js
+++ b/ui/app/send-v2.js
@@ -1,4 +1,5 @@
const { inherits } = require('util')
+const PropTypes = require('prop-types')
const PersistentForm = require('../lib/persistent-form')
const h = require('react-hyperscript')
@@ -30,6 +31,10 @@ const {
const { isValidAddress } = require('./util')
const { CONFIRM_TRANSACTION_ROUTE } = require('./routes')
+SendTransactionScreen.contextTypes = {
+ t: PropTypes.func,
+}
+
module.exports = SendTransactionScreen
inherits(SendTransactionScreen, PersistentForm)
@@ -189,9 +194,9 @@ SendTransactionScreen.prototype.renderHeader = function () {
return h('div.page-container__header', [
- h('div.page-container__title', selectedToken ? this.props.t('sendTokens') : this.props.t('sendETH')),
+ h('div.page-container__title', selectedToken ? this.context.t('sendTokens') : this.context.t('sendETH')),
- h('div.page-container__subtitle', this.props.t('onlySendToEtherAddress')),
+ h('div.page-container__subtitle', this.context.t('onlySendToEtherAddress')),
h('div.page-container__header-close', {
onClick: () => {
@@ -262,11 +267,11 @@ SendTransactionScreen.prototype.handleToChange = function (to, nickname = '') {
let toError = null
if (!to) {
- toError = this.props.t('required')
+ toError = this.context.t('required')
} else if (!isValidAddress(to)) {
- toError = this.props.t('invalidAddressRecipient')
+ toError = this.context.t('invalidAddressRecipient')
} else if (to === from) {
- toError = this.props.t('fromToSame')
+ toError = this.context.t('fromToSame')
}
updateSendTo(to, nickname)
@@ -282,9 +287,9 @@ SendTransactionScreen.prototype.renderToRow = function () {
h('div.send-v2__form-label', [
- this.props.t('to'),
+ this.context.t('to'),
- this.renderErrorMessage(this.props.t('to')),
+ this.renderErrorMessage(this.context.t('to')),
]),
@@ -385,11 +390,11 @@ SendTransactionScreen.prototype.validateAmount = function (value) {
)
if (conversionRate && !sufficientBalance) {
- amountError = this.props.t('insufficientFunds')
+ amountError = this.context.t('insufficientFunds')
} else if (verifyTokenBalance && !sufficientTokens) {
- amountError = this.props.t('insufficientTokens')
+ amountError = this.context.t('insufficientTokens')
} else if (amountLessThanZero) {
- amountError = this.props.t('negativeETH')
+ amountError = this.context.t('negativeETH')
}
updateSendErrors({ amount: amountError })
@@ -419,7 +424,7 @@ SendTransactionScreen.prototype.renderAmountRow = function () {
setMaxModeTo(true)
this.setAmountToMax()
},
- }, [ !maxModeOn ? this.props.t('max') : '' ]),
+ }, [ !maxModeOn ? this.context.t('max') : '' ]),
]),
h('div.send-v2__form-field', [
@@ -448,7 +453,7 @@ SendTransactionScreen.prototype.renderGasRow = function () {
return h('div.send-v2__form-row', [
- h('div.send-v2__form-label', h('gasFee')),
+ h('div.send-v2__form-label', this.context.t('gasFee')),
h('div.send-v2__form-field', [
@@ -518,11 +523,11 @@ SendTransactionScreen.prototype.renderFooter = function () {
clearSend()
history.goBack()
},
- }, this.props.t('cancel')),
+ }, this.context.t('cancel')),
h('button.btn-primary--lg.page-container__footer-button', {
disabled: !noErrors || !gasTotal || missingTokenBalance,
onClick: event => this.onSubmit(event),
- }, this.props.t('next')),
+ }, this.context.t('next')),
])
}