From b9b6ac0cdac6796139e604f9300879a2cb57ec44 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 8 Jun 2021 09:17:12 -0300 Subject: better label for the fields --- .../src/pages/popup.stories.tsx | 1 + .../taler-wallet-webextension/src/pages/popup.tsx | 150 ++++++++++++++++----- 2 files changed, 118 insertions(+), 33 deletions(-) diff --git a/packages/taler-wallet-webextension/src/pages/popup.stories.tsx b/packages/taler-wallet-webextension/src/pages/popup.stories.tsx index 5e1d0c3a2..1aec771a2 100644 --- a/packages/taler-wallet-webextension/src/pages/popup.stories.tsx +++ b/packages/taler-wallet-webextension/src/pages/popup.stories.tsx @@ -61,6 +61,7 @@ const exampleData = { } as TransactionWithdrawal, payment: { ...commonTransaction, + amountEffective: 'USD:11', type: TransactionType.Payment, info: { contractTermsHash: 'ASDZXCASD', diff --git a/packages/taler-wallet-webextension/src/pages/popup.tsx b/packages/taler-wallet-webextension/src/pages/popup.tsx index ea496ac0a..5fb08b77e 100644 --- a/packages/taler-wallet-webextension/src/pages/popup.tsx +++ b/packages/taler-wallet-webextension/src/pages/popup.tsx @@ -455,33 +455,6 @@ export function WalletTransactionView({ transaction, onDelete, onBack }: WalletT return (pending...) } - function CommonFields() { - if (!transaction) return null; - return - - Amount deduce - {transaction.amountRaw} - - - Amount received - {transaction.amountEffective} - - - Exchange fee - {Amounts.stringify( - Amounts.sub( - Amounts.parseOrThrow(transaction.amountRaw), - Amounts.parseOrThrow(transaction.amountEffective), - ).amount - )} - - - When - {transaction.timestamp.t_ms === "never" ? "never" : format(transaction.timestamp.t_ms, 'dd/MM/yyyy HH:mm:ss')} - - - } - if (transaction.type === TransactionType.Withdrawal) { return (
@@ -491,7 +464,27 @@ export function WalletTransactionView({ transaction, onDelete, onBack }: WalletT From {transaction.exchangeBaseUrl}

- + + + + + + + + + + + + + + + +
Amount subtracted{transaction.amountRaw}
Amount received{transaction.amountEffective}
Exchange fee{Amounts.stringify( + Amounts.sub( + Amounts.parseOrThrow(transaction.amountRaw), + Amounts.parseOrThrow(transaction.amountEffective), + ).amount + )}
When{transaction.timestamp.t_ms === "never" ? "never" : format(transaction.timestamp.t_ms, 'dd/MM/yyyy HH:mm:ss')}