aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/tx-list-item.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-10-19 10:09:26 +0800
committerDan <danjm.com@gmail.com>2017-10-20 03:00:54 +0800
commit332c7441b656ec82ebfba863e3feb4dbf365d67b (patch)
tree2ea0aece624fe6df97924c38a739efb302fffe79 /ui/app/components/tx-list-item.js
parent59015cccef72210f828b344aaedde9b8dd31be3b (diff)
downloadtangerine-wallet-browser-332c7441b656ec82ebfba863e3feb4dbf365d67b.tar
tangerine-wallet-browser-332c7441b656ec82ebfba863e3feb4dbf365d67b.tar.gz
tangerine-wallet-browser-332c7441b656ec82ebfba863e3feb4dbf365d67b.tar.bz2
tangerine-wallet-browser-332c7441b656ec82ebfba863e3feb4dbf365d67b.tar.lz
tangerine-wallet-browser-332c7441b656ec82ebfba863e3feb4dbf365d67b.tar.xz
tangerine-wallet-browser-332c7441b656ec82ebfba863e3feb4dbf365d67b.tar.zst
tangerine-wallet-browser-332c7441b656ec82ebfba863e3feb4dbf365d67b.zip
Get currency from state in account details, send and confirm screens.
Diffstat (limited to 'ui/app/components/tx-list-item.js')
-rw-r--r--ui/app/components/tx-list-item.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js
index 8422c02b9..3bb9a2eda 100644
--- a/ui/app/components/tx-list-item.js
+++ b/ui/app/components/tx-list-item.js
@@ -11,11 +11,14 @@ const Identicon = require('./identicon')
const { conversionUtil } = require('../conversion-util')
+const { getCurrentCurrency } = require('../selectors')
+
module.exports = connect(mapStateToProps)(TxListItem)
function mapStateToProps (state) {
return {
tokens: state.metamask.tokens,
+ currentCurrency: getCurrentCurrency(state),
}
}
@@ -49,17 +52,18 @@ TxListItem.prototype.getSendEtherTotal = function () {
transactionAmount,
conversionRate,
address,
+ currentCurrency,
} = this.props
if (!address) {
return {}
}
- const totalInUSD = conversionUtil(transactionAmount, {
+ const totalInFiat = conversionUtil(transactionAmount, {
fromNumericBase: 'hex',
toNumericBase: 'dec',
fromCurrency: 'ETH',
- toCurrency: 'USD',
+ toCurrency: currentCurrency,
fromDenomination: 'WEI',
numberOfDecimals: 2,
conversionRate,
@@ -76,7 +80,7 @@ TxListItem.prototype.getSendEtherTotal = function () {
return {
total: `${totalInETH} ETH`,
- fiatTotal: `$${totalInUSD} USD`,
+ fiatTotal: `${totalInFiat} ${currentCurrency.toUpperCase()}`,
}
}