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 --- .../src/components/Transactions/views.tsx | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'packages/demobank-ui/src/components/Transactions/views.tsx') diff --git a/packages/demobank-ui/src/components/Transactions/views.tsx b/packages/demobank-ui/src/components/Transactions/views.tsx index f92c874f3..69f4369a2 100644 --- a/packages/demobank-ui/src/components/Transactions/views.tsx +++ b/packages/demobank-ui/src/components/Transactions/views.tsx @@ -20,6 +20,7 @@ import { State } from "./index.js"; import { format, isToday } from "date-fns"; import { Amounts } from "@gnu-taler/taler-util"; import { useEffect, useRef } from "preact/hooks"; +import { RenderAmount } from "../../pages/PaytoWireTransferForm.js"; export function LoadingUriView({ error }: State.LoadingUriError): VNode { const { i18n } = useTranslationContext(); @@ -72,13 +73,7 @@ export function ReadyView({ transactions, onNext, onPrev }: State.Ready): VNode {txs.map(item => { 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} -- cgit v1.2.3