From 6ff28949ed7cfed7f5db145d3e518c4176356c10 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 12 Apr 2024 11:43:26 -0300 Subject: dd53: label balance in history --- .../src/components/BalanceTable.tsx | 65 +++++++++++++--------- .../src/wallet/History.tsx | 4 ++ 2 files changed, 42 insertions(+), 27 deletions(-) (limited to 'packages/taler-wallet-webextension') diff --git a/packages/taler-wallet-webextension/src/components/BalanceTable.tsx b/packages/taler-wallet-webextension/src/components/BalanceTable.tsx index b8bcaa391..b92929ceb 100644 --- a/packages/taler-wallet-webextension/src/components/BalanceTable.tsx +++ b/packages/taler-wallet-webextension/src/components/BalanceTable.tsx @@ -15,8 +15,10 @@ */ import { Amounts, ScopeType, WalletBalance } from "@gnu-taler/taler-util"; -import { VNode, h } from "preact"; -import { TableWithRoundRows as TableWithRoundedRows } from "./styled/index.js"; +import { Fragment, VNode, h } from "preact"; +import { + TableWithRoundRows as TableWithRoundedRows +} from "./styled/index.js"; export function BalanceTable({ balances, @@ -25,33 +27,42 @@ export function BalanceTable({ balances: WalletBalance[]; goToWalletHistory: (currency: string) => void; }): VNode { + // const { i18n } = useTranslationContext(); return ( - - {balances.map((entry, idx) => { - const av = Amounts.parseOrThrow(entry.available); + + {/* + Exchange Entries + */} + + {balances.map((entry, idx) => { + const av = Amounts.parseOrThrow(entry.available); - return ( - goToWalletHistory(av.currency)} - style={{ cursor: "pointer" }} - > - {av.currency} - goToWalletHistory(av.currency)} + style={{ cursor: "pointer" }} > - {Amounts.stringifyValue(av, 2)} -
- {entry.scopeInfo.type === ScopeType.Exchange || entry.scopeInfo.type === ScopeType.Auditor ? entry.scopeInfo.url : undefined} -
- - - ); - })} -
+ {av.currency} + + {Amounts.stringifyValue(av, 2)} +
+ {entry.scopeInfo.type === ScopeType.Exchange || + entry.scopeInfo.type === ScopeType.Auditor + ? entry.scopeInfo.url + : undefined} +
+ + + ); + })} +
+ ); } diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx b/packages/taler-wallet-webextension/src/wallet/History.tsx index 233bd8f28..12a032b51 100644 --- a/packages/taler-wallet-webextension/src/wallet/History.tsx +++ b/packages/taler-wallet-webextension/src/wallet/History.tsx @@ -36,6 +36,7 @@ import { CenteredText, DateSeparator, NiceSelect, + SubTitle, } from "../components/styled/index.js"; import { alertFromError, useAlertContext } from "../context/alert.js"; import { useBackendContext } from "../context/backend.js"; @@ -157,6 +158,9 @@ export function HistoryView({ return (
+ + Balance +