From 372ddff91798cf9247eaf045f0d0ce33694fd880 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 1 Oct 2023 12:50:43 -0300 Subject: render amount and limit input --- .../demobank-ui/src/components/Cashouts/views.tsx | 5 +++-- .../src/components/Transactions/views.tsx | 23 +++++++++++----------- packages/demobank-ui/src/components/app.tsx | 7 ++++--- 3 files changed, 19 insertions(+), 16 deletions(-) (limited to 'packages/demobank-ui/src/components') diff --git a/packages/demobank-ui/src/components/Cashouts/views.tsx b/packages/demobank-ui/src/components/Cashouts/views.tsx index 4b7649fb6..a32deb266 100644 --- a/packages/demobank-ui/src/components/Cashouts/views.tsx +++ b/packages/demobank-ui/src/components/Cashouts/views.tsx @@ -19,6 +19,7 @@ import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { State } from "./index.js"; import { format } from "date-fns"; import { Amounts } from "@gnu-taler/taler-util"; +import { RenderAmount } from "../../pages/PaytoWireTransferForm.js"; export function LoadingUriView({ error }: State.LoadingUriError): VNode { const { i18n } = useTranslationContext(); @@ -62,8 +63,8 @@ export function ReadyView({ cashouts, onSelected }: State.Ready): VNode { ? format(item.confirmation_time, "dd/MM/yyyy HH:mm:ss") : "-"} - {Amounts.stringifyValue(item.amount_debit)} - {Amounts.stringifyValue(item.amount_credit)} + + {item.status} { const time = item.when.t_ms === "never" ? "" : format(item.when.t_ms, "HH:mm:ss") const amount = - {item.negative ? "-" : ""} - {item.amount ? ( - `${Amounts.stringifyValue(item.amount)} ${item.amount.currency - }` - ) : ( - <{i18n.str`invalid value`}> - )} + { } return ( @@ -86,20 +81,26 @@ export function ReadyView({ transactions, onNext, onPrev }: State.Ready): VNode
Amount
- {item.negative ? i18n.str`sent` : i18n.str`received`} {item.amount ? ( - `${Amounts.stringifyValue(item.amount)}` + {item.negative ? i18n.str`sent` : i18n.str`received`} + + {item.amount ? ( + ) : ( <{i18n.str`invalid value`}> )}
+
Counterpart
- {item.negative ? i18n.str`to` : i18n.str`from`} {item.counterpart} + {item.negative ? i18n.str`to` : i18n.str`from`} {item.counterpart}
- {amount} + {item.amount ? ( + ) : ( + <{i18n.str`invalid value`}> + )} {item.counterpart} {item.subject} diff --git a/packages/demobank-ui/src/components/app.tsx b/packages/demobank-ui/src/components/app.tsx index f15a9ee6a..7cf658681 100644 --- a/packages/demobank-ui/src/components/app.tsx +++ b/packages/demobank-ui/src/components/app.tsx @@ -31,6 +31,7 @@ import { getInitialBackendBaseURL } from "../hooks/backend.js"; import { BANK_INTEGRATION_PROTOCOL_VERSION, useConfigState } from "../hooks/config.js"; import { ErrorLoading } from "./ErrorLoading.js"; import { BankFrame } from "../pages/BankFrame.js"; +import { ConfigStateProvider } from "../context/config.js"; const WITH_LOCAL_STORAGE_CACHE = false; /** @@ -84,11 +85,11 @@ function VersionCheck({ children }: { children: ComponentChildren }): VNode { } if (checked.type === "ok") { - return {children} + return {children} } - + return - + } -- cgit v1.2.3