diff options
Diffstat (limited to 'ui/app/components/hex-as-decimal-input.js')
-rw-r--r-- | ui/app/components/hex-as-decimal-input.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ui/app/components/hex-as-decimal-input.js b/ui/app/components/hex-as-decimal-input.js index be7ba4c9e..75303a34a 100644 --- a/ui/app/components/hex-as-decimal-input.js +++ b/ui/app/components/hex-as-decimal-input.js @@ -1,13 +1,19 @@ 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 connect = require('../metamask-connect') +const connect = require('react-redux').connect + +HexAsDecimalInput.contextTypes = { + t: PropTypes.func, +} module.exports = connect()(HexAsDecimalInput) + inherits(HexAsDecimalInput, Component) function HexAsDecimalInput () { this.state = { invalid: null } @@ -127,13 +133,13 @@ HexAsDecimalInput.prototype.constructWarning = function () { let message = name ? name + ' ' : '' if (min && max) { - message += this.props.t('betweenMinAndMax', [min, max]) + message += this.context.t('betweenMinAndMax', [min, max]) } else if (min) { - message += this.props.t('greaterThanMin', [min]) + message += this.context.t('greaterThanMin', [min]) } else if (max) { - message += this.props.t('lessThanMax', [max]) + message += this.context.t('lessThanMax', [max]) } else { - message += this.props.t('invalidInput') + message += this.context.t('invalidInput') } return message |