From a994009d2f094c4d9c12da68dac3abb28bdef4b3 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 16 Nov 2021 13:59:53 -0300 Subject: reserveCreated new design --- .../src/wallet/Transaction.tsx | 92 +++++++++------------- 1 file changed, 38 insertions(+), 54 deletions(-) (limited to 'packages/taler-wallet-webextension/src/wallet/Transaction.tsx') diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index 7de6982e7..1472efb40 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -21,28 +21,27 @@ import { Transaction, TransactionType, } from "@gnu-taler/taler-util"; -import { format } from "date-fns"; -import { JSX, VNode, h } from "preact"; +import { h, VNode } from "preact"; import { route } from "preact-router"; import { useEffect, useState } from "preact/hooks"; import emptyImg from "../../static/img/empty.png"; import { ErrorMessage } from "../components/ErrorMessage"; import { Part } from "../components/Part"; import { - ButtonBox, - ButtonBoxDestructive, + Button, + ButtonDestructive, ButtonPrimary, - FontIcon, ListOfProducts, RowBorderGray, SmallLightText, WalletBox, WarningBox, } from "../components/styled"; +import { Time } from "../components/Time"; import { Pages } from "../NavigationBar"; import * as wxApi from "../wxApi"; -export function TransactionPage({ tid }: { tid: string }): JSX.Element { +export function TransactionPage({ tid }: { tid: string }): VNode { const [transaction, setTransaction] = useState( undefined, ); @@ -70,8 +69,8 @@ export function TransactionPage({ tid }: { tid: string }): JSX.Element { return ( wxApi.deleteTransaction(tid).then((_) => history.go(-1))} - onRetry={() => wxApi.retryTransaction(tid).then((_) => history.go(-1))} + onDelete={() => wxApi.deleteTransaction(tid).then(() => history.go(-1))} + onRetry={() => wxApi.retryTransaction(tid).then(() => history.go(-1))} onBack={() => { route(Pages.history); }} @@ -91,42 +90,42 @@ export function TransactionView({ onDelete, onRetry, onBack, -}: WalletTransactionProps) { - function TransactionTemplate({ children }: { children: VNode[] }) { +}: WalletTransactionProps): VNode { + function TransactionTemplate({ children }: { children: VNode[] }): VNode { return (
{transaction.pending && ( - This transaction is not completed + + This transaction is not completed + more info... + )}
{children}
- - - {" "} - {" "} - - +
{transaction?.error ? ( retry ) : null} - - 🗑 - + + Forget +
); } - function amountToString(text: AmountLike) { + function amountToString(text: AmountLike): string { const aj = Amounts.jsonifyAmount(text); const amount = Amounts.stringifyValue(aj); return `${amount} ${aj.currency}`; @@ -140,23 +139,26 @@ export function TransactionView({ return (

Withdrawal

-
- {transaction.timestamp.t_ms === "never" - ? "never" - : format(transaction.timestamp.t_ms, "dd MMMM yyyy, HH:mm")} -
+