support eur in transactions

This commit is contained in:
Anthony 2022-03-29 16:33:09 +02:00 committed by Thomas Zarebczan
parent e9b1a11e44
commit d70c489163
2 changed files with 34 additions and 6 deletions

View file

@ -342,7 +342,7 @@ function TxoList(props: Props) {
className={classnames(`button-toggle`, { className={classnames(`button-toggle`, {
'button-toggle--active': currency === 'fiat', 'button-toggle--active': currency === 'fiat',
})} })}
label={__('USD --[transactions tab]--')} label={__('Currency --[transactions tab]--')}
/> />
</div> </div>
</fieldset-section> </fieldset-section>

View file

@ -24,6 +24,22 @@ const WalletBalance = (props: Props) => {
// accountTransactions.length = 10; // accountTransactions.length = 10;
// } // }
function getSymbol(transaction) {
if (transaction.currency === 'eur') {
return '€';
} else {
return '$';
}
}
function getCurrencyIso(transaction) {
if (transaction.currency === 'eur') {
return 'EUR';
} else {
return 'USD';
}
}
return ( return (
<div className="table__wrapper"> <div className="table__wrapper">
<table className="table table--transactions"> <table className="table table--transactions">
@ -32,7 +48,7 @@ const WalletBalance = (props: Props) => {
<th className="date-header">{__('Date')}</th> <th className="date-header">{__('Date')}</th>
<th className="channelName-header">{<>{__('Receiving Channel Name')}</>}</th> <th className="channelName-header">{<>{__('Receiving Channel Name')}</>}</th>
<th className="location-header">{__('Tip Location')}</th> <th className="location-header">{__('Tip Location')}</th>
<th className="amount-header">{__('Amount (USD)')} </th> <th className="amount-header">{__('Amount')} </th>
<th className="processingFee-header">{__('Processing Fee')}</th> <th className="processingFee-header">{__('Processing Fee')}</th>
<th className="odyseeFee-header">{__('Odysee Fee')}</th> <th className="odyseeFee-header">{__('Odysee Fee')}</th>
<th className="receivedAmount-header">{__('Received Amount')}</th> <th className="receivedAmount-header">{__('Received Amount')}</th>
@ -63,10 +79,22 @@ const WalletBalance = (props: Props) => {
button="link" button="link"
/> />
</td> </td>
<td>${transaction.tipped_amount / 100}</td> <td>
<td>${transaction.transaction_fee / 100}</td> {getSymbol(transaction)}
<td>${transaction.application_fee / 100}</td> {transaction.tipped_amount / 100} {getCurrencyIso(transaction)}
<td>${transaction.received_amount / 100}</td> </td>
<td>
{getSymbol(transaction)}
{transaction.transaction_fee / 100}
</td>
<td>
{getSymbol(transaction)}
{transaction.application_fee / 100}
</td>
<td>
{getSymbol(transaction)}
{transaction.received_amount / 100}
</td>
</tr> </tr>
))} ))}
</tbody> </tbody>