From c5f484d18a89bd6cda0c7a89eea5ee9d7fe4ba09 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 22 Apr 2022 16:10:21 -0300
Subject: deposit test case

---
 .../src/wallet/CreateManualWithdraw.tsx            | 26 ++++------------------
 1 file changed, 4 insertions(+), 22 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 0440c50a9..11bade6f5 100644
--- a/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx
@@ -37,6 +37,7 @@ import {
   SubTitle,
 } from "../components/styled/index.js";
 import { useTranslationContext } from "../context/translation.js";
+import { SelectFieldHandler, TextFieldHandler } from "../mui/handlers.js";
 import { Pages } from "../NavigationBar.js";
 
 export interface Props {
@@ -55,25 +56,6 @@ export interface State {
   exchange: SelectFieldHandler;
 }
 
-export interface TextFieldHandler {
-  onInput: (value: string) => void;
-  value: string;
-  error?: string;
-}
-
-export interface ButtonHandler {
-  onClick?: () => Promise<void>;
-  error?: TalerError;
-}
-
-export interface SelectFieldHandler {
-  onChange: (value: string) => void;
-  error?: string;
-  value: string;
-  isDirty?: boolean;
-  list: Record<string, string>;
-}
-
 export function useComponentState(
   exchangeUrlWithCurrency: Record<string, string>,
   initialAmount: string | undefined,
@@ -109,12 +91,12 @@ export function useComponentState(
   const [amount, setAmount] = useState(initialAmount || "");
   const parsedAmount = Amounts.parse(`${currency}:${amount}`);
 
-  function changeExchange(exchange: string): void {
+  async function changeExchange(exchange: string): Promise<void> {
     setExchange(exchange);
     setCurrency(exchangeUrlWithCurrency[exchange]);
   }
 
-  function changeCurrency(currency: string): void {
+  async function changeCurrency(currency: string): Promise<void> {
     setCurrency(currency);
     const found = Object.entries(exchangeUrlWithCurrency).find(
       (e) => e[1] === currency,
@@ -140,7 +122,7 @@ export function useComponentState(
     },
     amount: {
       value: amount,
-      onInput: (e: string) => setAmount(e),
+      onInput: async (e: string) => setAmount(e),
     },
     parsedAmount,
   };
-- 
cgit v1.2.3

