From 1708d49a2d5da1f325173a030695223e5a24e75c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 29 Sep 2023 16:02:15 -0300 Subject: more ui --- .../demobank-ui/src/pages/WalletWithdrawForm.tsx | 183 +++++++-------------- 1 file changed, 63 insertions(+), 120 deletions(-) (limited to 'packages/demobank-ui/src/pages/WalletWithdrawForm.tsx') diff --git a/packages/demobank-ui/src/pages/WalletWithdrawForm.tsx b/packages/demobank-ui/src/pages/WalletWithdrawForm.tsx index 3c5ee34fd..7357223b7 100644 --- a/packages/demobank-ui/src/pages/WalletWithdrawForm.tsx +++ b/packages/demobank-ui/src/pages/WalletWithdrawForm.tsx @@ -29,14 +29,15 @@ import { notifyError, useTranslationContext, } from "@gnu-taler/web-util/browser"; -import { VNode, h } from "preact"; +import { Fragment, VNode, h } from "preact"; import { forwardRef } from "preact/compat"; import { useEffect, useRef, useState } from "preact/hooks"; import { useAccessAPI } from "../hooks/access.js"; import { buildRequestErrorMessage, undefinedIfEmpty } from "../utils.js"; -import { Amount } from "./PaytoWireTransferForm.js"; +import { Amount, doAutoFocus } from "./PaytoWireTransferForm.js"; import { useSettings } from "../hooks/settings.js"; import { OperationState } from "./OperationState/index.js"; +import { Attention } from "../components/Attention.js"; const logger = new Logger("WalletWithdrawForm"); const RefAmount = forwardRef(Amount); @@ -53,47 +54,13 @@ function OldWithdrawalForm({ goToConfirmOperation, limit, onCancel, focus }: { const { createWithdrawal } = useAccessAPI(); const [amountStr, setAmountStr] = useState(`${settings.maxWithdrawalAmount}`); - const ref = useRef(null); - useEffect(() => { - if (focus) ref.current?.focus(); - }, [focus]); if (!!settings.currentWithdrawalOperationId) { - return
- -
-
-
- -
-
-

- There is an operation already -

-
-

- - To complete or cancel the operation click here - -

-
- -
-
-
-
- -
-
+ return + + To complete or cancel the operation click here + + } const trimmedAmountStr = amountStr?.trim(); @@ -157,8 +124,8 @@ function OldWithdrawalForm({ goToConfirmOperation, limit, onCancel, focus }: { e.preventDefault() }} > -
-
+
+
-
- - -
+
+
- 25.00 - - - - -
+ + +
+
+ + +
@@ -255,46 +224,20 @@ export function WalletWithdrawForm({

Prepare your wallet

- After using your wallet you will confirm or cancel the operation. + After using your wallet you will need to confirm or cancel the operation on this site.

- {settings.showInstallWallet &&
-
-
- -
-
-

- You need a GNU Taler Wallet -

-
-

- - If you dont have one yet you can follow the instruction here - -

-

- -

- -
-
-
-
} + {settings.showInstallWallet && + { + updateSettings("showInstallWallet", false); + }}> + + If you don't have one yet you can follow the instruction here + + + } {!settings.fastWithdrawal ?