aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-04-12 11:43:26 -0300
committerSebastian <sebasjm@gmail.com>2024-04-12 11:43:26 -0300
commit6ff28949ed7cfed7f5db145d3e518c4176356c10 (patch)
tree0242045e7b5c9f1e79aa375cb46b4aa3a1c28aa2 /packages/taler-wallet-webextension
parent5d0ad07def92410663c54dcba5693090fbb19385 (diff)
downloadwallet-core-6ff28949ed7cfed7f5db145d3e518c4176356c10.tar.xz
dd53: label balance in history
Diffstat (limited to 'packages/taler-wallet-webextension')
-rw-r--r--packages/taler-wallet-webextension/src/components/BalanceTable.tsx65
-rw-r--r--packages/taler-wallet-webextension/src/wallet/History.tsx4
2 files changed, 42 insertions, 27 deletions
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 (
- <TableWithRoundedRows>
- {balances.map((entry, idx) => {
- const av = Amounts.parseOrThrow(entry.available);
+ <Fragment>
+ {/* <SubTitle>
+ <i18n.Translate>Exchange Entries</i18n.Translate>
+ </SubTitle> */}
+ <TableWithRoundedRows>
+ {balances.map((entry, idx) => {
+ const av = Amounts.parseOrThrow(entry.available);
- return (
- <tr
- key={idx}
- onClick={() => goToWalletHistory(av.currency)}
- style={{ cursor: "pointer" }}
- >
- <td>{av.currency}</td>
- <td
- style={{
- fontSize: "2em",
- textAlign: "right",
- width: "100%",
- }}
+ return (
+ <tr
+ key={idx}
+ onClick={() => goToWalletHistory(av.currency)}
+ style={{ cursor: "pointer" }}
>
- {Amounts.stringifyValue(av, 2)}
- <div style={{ fontSize: "small", color: "grey" }}>
- {entry.scopeInfo.type === ScopeType.Exchange || entry.scopeInfo.type === ScopeType.Auditor ? entry.scopeInfo.url : undefined}
- </div>
- </td>
- </tr>
- );
- })}
- </TableWithRoundedRows>
+ <td>{av.currency}</td>
+ <td
+ style={{
+ fontSize: "2em",
+ textAlign: "right",
+ width: "100%",
+ }}
+ >
+ {Amounts.stringifyValue(av, 2)}
+ <div style={{ fontSize: "small", color: "grey" }}>
+ {entry.scopeInfo.type === ScopeType.Exchange ||
+ entry.scopeInfo.type === ScopeType.Auditor
+ ? entry.scopeInfo.url
+ : undefined}
+ </div>
+ </td>
+ </tr>
+ );
+ })}
+ </TableWithRoundedRows>
+ </Fragment>
);
}
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 (
<Fragment>
<section>
+ <SubTitle style={{marginBottom: 0}}>
+ <i18n.Translate>Balance</i18n.Translate>
+ </SubTitle>
<div
style={{
display: "flex",