diff options
author | Sebastian <sebasjm@gmail.com> | 2021-11-16 13:59:53 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-11-16 14:01:38 -0300 |
commit | a994009d2f094c4d9c12da68dac3abb28bdef4b3 (patch) | |
tree | e403a58663f81889982635ffb324f9739e6976b3 /packages/taler-wallet-webextension/src/popup/BalancePage.tsx | |
parent | c33ed919719845f518d6491ef37df6ae16820dd0 (diff) | |
download | wallet-core-a994009d2f094c4d9c12da68dac3abb28bdef4b3.tar.xz |
reserveCreated new design
Diffstat (limited to 'packages/taler-wallet-webextension/src/popup/BalancePage.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/popup/BalancePage.tsx | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx index 2913f60e0..a23c81cd1 100644 --- a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx +++ b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx @@ -18,17 +18,14 @@ import { amountFractionalBase, Amounts, Balance, - BalancesResponse, i18n, } from "@gnu-taler/taler-util"; -import { JSX, h, Fragment } from "preact"; -import { ErrorMessage } from "../components/ErrorMessage"; +import { h, VNode } from "preact"; import { - PopupBox, - Centered, ButtonPrimary, ErrorBox, Middle, + PopupBox, } from "../components/styled/index"; import { BalancesHook, useBalances } from "../hooks/useBalances"; import { PageLink, renderAmount } from "../renderHtml"; @@ -37,7 +34,7 @@ export function BalancePage({ goToWalletManualWithdraw, }: { goToWalletManualWithdraw: () => void; -}) { +}): VNode { const balance = useBalances(); return ( <BalanceView @@ -53,11 +50,11 @@ export interface BalanceViewProps { goToWalletManualWithdraw: () => void; } -function formatPending(entry: Balance): JSX.Element { - let incoming: JSX.Element | undefined; - let payment: JSX.Element | undefined; +function formatPending(entry: Balance): VNode { + let incoming: VNode | undefined; + let payment: VNode | undefined; - const available = Amounts.parseOrThrow(entry.available); + // const available = Amounts.parseOrThrow(entry.available); const pendingIncoming = Amounts.parseOrThrow(entry.pendingIncoming); const pendingOutgoing = Amounts.parseOrThrow(entry.pendingOutgoing); @@ -105,8 +102,8 @@ export function BalanceView({ balance, Linker, goToWalletManualWithdraw, -}: BalanceViewProps) { - function Content() { +}: BalanceViewProps): VNode { + function Content(): VNode { if (!balance) { return <span />; } @@ -139,7 +136,7 @@ export function BalanceView({ return ( <section data-expanded data-centered> <table style={{ width: "100%" }}> - {balance.response.balances.map((entry) => { + {balance.response.balances.map((entry, idx) => { const av = Amounts.parseOrThrow(entry.available); // Create our number formatter. let formatter; @@ -168,7 +165,7 @@ export function BalanceView({ const fontSize = v.length < 8 ? "3em" : v.length < 13 ? "2em" : "1em"; return ( - <tr> + <tr key={idx}> <td style={{ height: 50, |