From ccb50c636054819f5af8778cc3ebe5258b1c2e87 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 11 Apr 2022 11:36:32 -0300 Subject: new test api to test hooks rendering iteration, testing state of withdraw page --- .../src/wallet/CreateManualWithdraw.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx') diff --git a/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx b/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx index 215aa4378..b9d398915 100644 --- a/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx +++ b/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx @@ -21,6 +21,7 @@ */ import { AmountJson, Amounts } from "@gnu-taler/taler-util"; +import { TalerError } from "@gnu-taler/taler-wallet-core"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { ErrorMessage } from "../components/ErrorMessage.js"; @@ -60,10 +61,17 @@ export interface TextFieldHandler { error?: string; } +export interface ButtonHandler { + onClick: () => Promise; + disabled?: boolean; + error?: TalerError; +} + export interface SelectFieldHandler { onChange: (value: string) => void; error?: string; value: string; + isDirty?: boolean; list: Record; } @@ -139,17 +147,6 @@ export function useComponentState( }; } -export interface InputHandler { - value: string; - onInput: (s: string) => void; -} - -export interface SelectInputHandler { - list: Record; - value: string; - onChange: (s: string) => void; -} - export function CreateManualWithdraw({ initialAmount, exchangeUrlWithCurrency, -- cgit v1.2.3