aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-09-14 01:57:15 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-09-14 05:25:20 +0800
commitca46bd200b24456d692cf1ede47506be5fdcc76d (patch)
treed3e24c1d9641c825e3e60960ccfa4c36afade44f /ui/app/components/send
parenta5ab91e572eec05450a760d4a65e3a28df67c0d1 (diff)
downloadtangerine-wallet-browser-ca46bd200b24456d692cf1ede47506be5fdcc76d.tar
tangerine-wallet-browser-ca46bd200b24456d692cf1ede47506be5fdcc76d.tar.gz
tangerine-wallet-browser-ca46bd200b24456d692cf1ede47506be5fdcc76d.tar.bz2
tangerine-wallet-browser-ca46bd200b24456d692cf1ede47506be5fdcc76d.tar.lz
tangerine-wallet-browser-ca46bd200b24456d692cf1ede47506be5fdcc76d.tar.xz
tangerine-wallet-browser-ca46bd200b24456d692cf1ede47506be5fdcc76d.tar.zst
tangerine-wallet-browser-ca46bd200b24456d692cf1ede47506be5fdcc76d.zip
Stop setting 'currentCurrency' and use local state for active currency in send.js
Diffstat (limited to 'ui/app/components/send')
-rw-r--r--ui/app/components/send/currency-toggle.js6
-rw-r--r--ui/app/components/send/eth-fee-display.js4
-rw-r--r--ui/app/components/send/gas-fee-display.js10
-rw-r--r--ui/app/components/send/usd-fee-display.js4
4 files changed, 12 insertions, 12 deletions
diff --git a/ui/app/components/send/currency-toggle.js b/ui/app/components/send/currency-toggle.js
index d777f0aea..7aaccd490 100644
--- a/ui/app/components/send/currency-toggle.js
+++ b/ui/app/components/send/currency-toggle.js
@@ -13,20 +13,20 @@ function CurrencyToggle () {
const defaultCurrencies = [ 'ETH', 'USD' ]
CurrencyToggle.prototype.renderToggles = function () {
- const { onClick, currentCurrency } = this.props
+ const { onClick, activeCurrency } = this.props
const [currencyA, currencyB] = this.props.currencies || defaultCurrencies
return [
h('span', {
className: classnames('currency-toggle__item', {
- 'currency-toggle__item--selected': currencyA === currentCurrency,
+ 'currency-toggle__item--selected': currencyA === activeCurrency,
}),
onClick: () => onClick(currencyA),
}, [ currencyA ]),
'<>',
h('span', {
className: classnames('currency-toggle__item', {
- 'currency-toggle__item--selected': currencyB === currentCurrency,
+ 'currency-toggle__item--selected': currencyB === activeCurrency,
}),
onClick: () => onClick(currencyB),
}, [ currencyB ]),
diff --git a/ui/app/components/send/eth-fee-display.js b/ui/app/components/send/eth-fee-display.js
index 3dcb711ce..8b4cec16c 100644
--- a/ui/app/components/send/eth-fee-display.js
+++ b/ui/app/components/send/eth-fee-display.js
@@ -13,7 +13,7 @@ function EthFeeDisplay () {
EthFeeDisplay.prototype.render = function () {
const {
- currentCurrency,
+ activeCurrency,
conversionRate,
gas,
gasPrice,
@@ -22,7 +22,7 @@ EthFeeDisplay.prototype.render = function () {
return h(EthBalance, {
value: getTxFeeBn(gas, gasPrice, blockGasLimit),
- currentCurrency,
+ currentCurrency: activeCurrency,
conversionRate,
showFiat: false,
hideTooltip: true,
diff --git a/ui/app/components/send/gas-fee-display.js b/ui/app/components/send/gas-fee-display.js
index 979062882..a9a3f3f49 100644
--- a/ui/app/components/send/gas-fee-display.js
+++ b/ui/app/components/send/gas-fee-display.js
@@ -28,17 +28,17 @@ GasFeeDisplay.prototype.getTokenValue = function () {
GasFeeDisplay.prototype.render = function () {
const {
- currentCurrency,
+ activeCurrency,
conversionRate,
gas,
gasPrice,
blockGasLimit,
} = this.props
- switch (currentCurrency) {
+ switch (activeCurrency) {
case 'USD':
return h(USDFeeDisplay, {
- currentCurrency,
+ activeCurrency,
conversionRate,
gas,
gasPrice,
@@ -46,7 +46,7 @@ GasFeeDisplay.prototype.render = function () {
})
case 'ETH':
return h(EthFeeDisplay, {
- currentCurrency,
+ activeCurrency,
conversionRate,
gas,
gasPrice,
@@ -55,7 +55,7 @@ GasFeeDisplay.prototype.render = function () {
default:
return h('div.token-gas', [
h('div.token-gas__amount', this.getTokenValue()),
- h('div.token-gas__symbol', currentCurrency),
+ h('div.token-gas__symbol', activeCurrency),
])
}
}
diff --git a/ui/app/components/send/usd-fee-display.js b/ui/app/components/send/usd-fee-display.js
index 012bda550..6ee38f1b5 100644
--- a/ui/app/components/send/usd-fee-display.js
+++ b/ui/app/components/send/usd-fee-display.js
@@ -13,7 +13,7 @@ function USDFeeDisplay () {
USDFeeDisplay.prototype.render = function () {
const {
- currentCurrency,
+ activeCurrency,
conversionRate,
gas,
gasPrice,
@@ -23,7 +23,7 @@ USDFeeDisplay.prototype.render = function () {
return h(FiatValue, {
value: getTxFeeBn(gas, gasPrice, blockGasLimit),
conversionRate,
- currentCurrency,
+ currentCurrency: activeCurrency,
style: {
color: '#5d5d5d',
fontSize: '16px',