From f8d12f7b0d4af1b1769b89e80c87f9c169678564 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 18 Mar 2022 15:32:41 +0100 Subject: wallet: t_s/d_us migration --- .../src/components/PendingTransactions.stories.tsx | 62 +++++++--------------- .../src/components/PendingTransactions.tsx | 13 ++++- .../src/components/Time.tsx | 4 +- .../src/components/TransactionItem.tsx | 16 +++--- 4 files changed, 40 insertions(+), 55 deletions(-) (limited to 'packages/taler-wallet-webextension/src/components') diff --git a/packages/taler-wallet-webextension/src/components/PendingTransactions.stories.tsx b/packages/taler-wallet-webextension/src/components/PendingTransactions.stories.tsx index 658a41aa8..ea29d4a78 100644 --- a/packages/taler-wallet-webextension/src/components/PendingTransactions.stories.tsx +++ b/packages/taler-wallet-webextension/src/components/PendingTransactions.stories.tsx @@ -22,7 +22,11 @@ import { PendingTransactionsView as TestedComponent } from "./PendingTransactions"; import { Fragment, h, VNode } from "preact"; import { createExample } from "../test-utils"; -import { Transaction, TransactionType } from "@gnu-taler/taler-util"; +import { + TalerProtocolTimestamp, + Transaction, + TransactionType, +} from "@gnu-taler/taler-util"; export default { title: "component/PendingTransactions", @@ -34,9 +38,7 @@ export const OnePendingTransaction = createExample(TestedComponent, { { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, ], }); @@ -46,23 +48,17 @@ export const ThreePendingTransactions = createExample(TestedComponent, { { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, ], }); @@ -72,72 +68,52 @@ export const TenPendingTransactions = createExample(TestedComponent, { { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1) } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, { amountEffective: "USD:10", type: TransactionType.Withdrawal, - timestamp: { - t_ms: 1, - }, + timestamp: TalerProtocolTimestamp.fromSeconds(1), } as Transaction, ], }); diff --git a/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx b/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx index eed31beb4..7923eb6ad 100644 --- a/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx +++ b/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx @@ -1,4 +1,9 @@ -import { Amounts, NotificationType, Transaction } from "@gnu-taler/taler-util"; +import { + AbsoluteTime, + Amounts, + NotificationType, + Transaction, +} from "@gnu-taler/taler-util"; import { PendingTaskInfo } from "@gnu-taler/taler-wallet-core"; import { Fragment, h, JSX } from "preact"; import { useAsyncAsHook } from "../hooks/useAsyncAsHook"; @@ -70,7 +75,11 @@ export function PendingTransactionsView({ {amount.currency} {Amounts.stringifyValue(amount)} {" "} - -