diff options
i18n redux solution doesn't require importing t() and passing state to each t() call; t is just available on props.
Diffstat (limited to 'ui/app/components/send')
-rw-r--r-- | ui/app/components/send/currency-display.js | 2 | ||||
-rw-r--r-- | ui/app/components/send/gas-fee-display-v2.js | 8 | ||||
-rw-r--r-- | ui/app/components/send/gas-tooltip.js | 6 | ||||
-rw-r--r-- | ui/app/components/send/send-v2-container.js | 1 | ||||
-rw-r--r-- | ui/app/components/send/to-autocomplete.js | 6 |
5 files changed, 12 insertions, 11 deletions
diff --git a/ui/app/components/send/currency-display.js b/ui/app/components/send/currency-display.js index 819fee0a0..a0aaada4d 100644 --- a/ui/app/components/send/currency-display.js +++ b/ui/app/components/send/currency-display.js @@ -10,7 +10,7 @@ inherits(CurrencyDisplay, Component) function CurrencyDisplay () { Component.call(this) } - +// function toHexWei (value) { return conversionUtil(value, { fromNumericBase: 'dec', diff --git a/ui/app/components/send/gas-fee-display-v2.js b/ui/app/components/send/gas-fee-display-v2.js index 04a43df2f..76ed1b5d4 100644 --- a/ui/app/components/send/gas-fee-display-v2.js +++ b/ui/app/components/send/gas-fee-display-v2.js @@ -2,9 +2,9 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits const CurrencyDisplay = require('./currency-display') -const t = require('../../../i18n-helper').getMessage +const connect = require('../../metamask-connect') -module.exports = GasFeeDisplay +module.exports = connect()(GasFeeDisplay) inherits(GasFeeDisplay, Component) function GasFeeDisplay () { @@ -33,8 +33,8 @@ GasFeeDisplay.prototype.render = function () { readOnly: true, }) : gasLoadingError - ? h('div.currency-display.currency-display--message', t(this.props.localeMessages, 'setGasPrice')) - : h('div.currency-display', t(this.props.localeMessages, 'loading')), + ? h('div.currency-display.currency-display--message', this.props.t('setGasPrice')) + : h('div.currency-display', this.props.t('loading')), h('button.sliders-icon-container', { onClick, diff --git a/ui/app/components/send/gas-tooltip.js b/ui/app/components/send/gas-tooltip.js index 7bdb164c7..607394c8b 100644 --- a/ui/app/components/send/gas-tooltip.js +++ b/ui/app/components/send/gas-tooltip.js @@ -2,9 +2,9 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits const InputNumber = require('../input-number.js') -const t = require('../../../i18n-helper').getMessage +const connect = require('../../metamask-connect') -module.exports = GasTooltip +module.exports = connect()(GasTooltip) inherits(GasTooltip, Component) function GasTooltip () { @@ -82,7 +82,7 @@ GasTooltip.prototype.render = function () { 'marginTop': '81px', }, }, [ - h('span.gas-tooltip-label', {}, [t(this.props.localeMessages, 'gasLimit')]), + h('span.gas-tooltip-label', {}, [this.props.t('gasLimit')]), h('i.fa.fa-info-circle'), ]), h(InputNumber, { diff --git a/ui/app/components/send/send-v2-container.js b/ui/app/components/send/send-v2-container.js index 25902cfce..d90a6bf75 100644 --- a/ui/app/components/send/send-v2-container.js +++ b/ui/app/components/send/send-v2-container.js @@ -53,6 +53,7 @@ function mapStateToProps (state) { tokenContract: getSelectedTokenContract(state), unapprovedTxs: state.metamask.unapprovedTxs, network: state.metamask.network, + t: t.bind(null, state.localeMessages), } } diff --git a/ui/app/components/send/to-autocomplete.js b/ui/app/components/send/to-autocomplete.js index ca034d855..4c54701cb 100644 --- a/ui/app/components/send/to-autocomplete.js +++ b/ui/app/components/send/to-autocomplete.js @@ -2,9 +2,9 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits const AccountListItem = require('./account-list-item') -const t = require('../../../i18n-helper').getMessage +const connect = require('../../metamask-connect') -module.exports = ToAutoComplete +module.exports = connect()(ToAutoComplete) inherits(ToAutoComplete, Component) function ToAutoComplete () { @@ -93,7 +93,7 @@ ToAutoComplete.prototype.render = function () { return h('div.send-v2__to-autocomplete', {}, [ h('input.send-v2__to-autocomplete__input', { - placeholder: t(this.props.localeMessages, 'recipientAddress'), + placeholder: this.props.t('recipientAddress'), className: inError ? `send-v2__error-border` : '', value: to, onChange: event => onChange(event.target.value), |