aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/bn-as-decimal-input.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/bn-as-decimal-input.js')
-rw-r--r--ui/app/components/bn-as-decimal-input.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/ui/app/components/bn-as-decimal-input.js b/ui/app/components/bn-as-decimal-input.js
index 70701b039..9a033f893 100644
--- a/ui/app/components/bn-as-decimal-input.js
+++ b/ui/app/components/bn-as-decimal-input.js
@@ -1,12 +1,18 @@
const Component = require('react').Component
+const PropTypes = require('prop-types')
const h = require('react-hyperscript')
const inherits = require('util').inherits
const ethUtil = require('ethereumjs-util')
const BN = ethUtil.BN
const extend = require('xtend')
-const t = require('../../i18n')
+const connect = require('react-redux').connect
+
+BnAsDecimalInput.contextTypes = {
+ t: PropTypes.func,
+}
+
+module.exports = connect()(BnAsDecimalInput)
-module.exports = BnAsDecimalInput
inherits(BnAsDecimalInput, Component)
function BnAsDecimalInput () {
@@ -137,13 +143,13 @@ BnAsDecimalInput.prototype.constructWarning = function () {
let message = name ? name + ' ' : ''
if (min && max) {
- message += t('betweenMinAndMax', [`${newMin} ${suffix}`, `${newMax} ${suffix}`])
+ message += this.context.t('betweenMinAndMax', [`${newMin} ${suffix}`, `${newMax} ${suffix}`])
} else if (min) {
- message += t('greaterThanMin', [`${newMin} ${suffix}`])
+ message += this.context.t('greaterThanMin', [`${newMin} ${suffix}`])
} else if (max) {
- message += t('lessThanMax', [`${newMax} ${suffix}`])
+ message += this.context.t('lessThanMax', [`${newMax} ${suffix}`])
} else {
- message += t('invalidInput')
+ message += this.context.t('invalidInput')
}
return message