aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-22 08:41:47 +0800
committerDan <danjm.com@gmail.com>2018-03-22 08:41:47 +0800
commitd24a0590d363dbe88d383c8faec8eb28809242f0 (patch)
tree189e54ca9ea117804c96afa551cfca8158f36974 /ui/app/components/send
parent29cc2f8ab9628d21cc32962666879c71be4e69d1 (diff)
downloadtangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.gz
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.bz2
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.lz
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.xz
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.zst
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.zip
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.js2
-rw-r--r--ui/app/components/send/gas-fee-display-v2.js8
-rw-r--r--ui/app/components/send/gas-tooltip.js6
-rw-r--r--ui/app/components/send/send-v2-container.js1
-rw-r--r--ui/app/components/send/to-autocomplete.js6
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),