diff options
author | Dan <danjm.com@gmail.com> | 2017-09-13 04:40:28 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-14 05:22:58 +0800 |
commit | 55d62190e3ec06b1b21ed3ba24b2f2a9bc137568 (patch) | |
tree | dc530ddb875efe1bc1c7e13858f8b22c25974606 /ui/app/components/tx-list-item.js | |
parent | 6fa1cd62258ba96d1a55bee140f2d1f10f091ed2 (diff) | |
download | tangerine-wallet-browser-55d62190e3ec06b1b21ed3ba24b2f2a9bc137568.tar.gz tangerine-wallet-browser-55d62190e3ec06b1b21ed3ba24b2f2a9bc137568.tar.zst tangerine-wallet-browser-55d62190e3ec06b1b21ed3ba24b2f2a9bc137568.zip |
Fixes the saving of transactions in send and display in tx-list with conversion utility.
Diffstat (limited to 'ui/app/components/tx-list-item.js')
-rw-r--r-- | ui/app/components/tx-list-item.js | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/ui/app/components/tx-list-item.js b/ui/app/components/tx-list-item.js index 9c681644e..4be8dfcb3 100644 --- a/ui/app/components/tx-list-item.js +++ b/ui/app/components/tx-list-item.js @@ -5,6 +5,8 @@ const classnames = require('classnames') const prefixForNetwork = require('../../lib/etherscan-prefix-for-network') const Identicon = require('./identicon') +const { conversionUtil } = require('../conversion-util') + module.exports = TxListItem inherits(TxListItem, Component) @@ -27,8 +29,26 @@ TxListItem.prototype.render = function () { address, transactionAmount, className, + conversionRate, } = this.props + const totalInUSD = conversionUtil(transactionAmount, { + fromNumericBase: 'hex', + toNumericBase: 'dec', + fromCurrency: 'ETH', + toCurrency: 'USD', + numberOfDecimals: 2, + conversionRate, + }) + const totalInETH = conversionUtil(transactionAmount, { + fromNumericBase: 'hex', + toNumericBase: 'dec', + fromCurrency: 'ETH', + toCurrency: 'ETH', + conversionRate, + numberOfDecimals: 6, + }) + return h(`div${className || ''}`, { key: transActionId, onClick: () => onClick && onClick(transActionId), @@ -87,11 +107,11 @@ TxListItem.prototype.render = function () { 'tx-list-value--confirmed': transactionStatus === 'confirmed' }) }, - transactionAmount + `${totalInETH} ETH`, ), h('span.tx-list-fiat-value', {}, [ - '+ $300 USD', + `${totalInUSD} USD`, ]), ]), |