diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/components/BalanceTable.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/components/BalanceTable.tsx | 61 |
1 files changed, 34 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..6dd577b88 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, @@ -26,32 +28,37 @@ export function BalanceTable({ goToWalletHistory: (currency: string) => void; }): VNode { return ( - <TableWithRoundedRows> - {balances.map((entry, idx) => { - const av = Amounts.parseOrThrow(entry.available); + <Fragment> + <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> ); } |