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/admin/RemoveAccount.tsx | 65 +++------------------- 1 file changed, 9 insertions(+), 56 deletions(-) (limited to 'packages/demobank-ui/src/pages/admin/RemoveAccount.tsx') diff --git a/packages/demobank-ui/src/pages/admin/RemoveAccount.tsx b/packages/demobank-ui/src/pages/admin/RemoveAccount.tsx index 1e5370afc..b323b0d01 100644 --- a/packages/demobank-ui/src/pages/admin/RemoveAccount.tsx +++ b/packages/demobank-ui/src/pages/admin/RemoveAccount.tsx @@ -6,6 +6,8 @@ import { Amounts, HttpStatusCode, TranslatedString } from "@gnu-taler/taler-util import { buildRequestErrorMessage, undefinedIfEmpty } from "../../utils.js"; import { useEffect, useRef, useState } from "preact/hooks"; import { ShowInputErrorLabel } from "../../components/ShowInputErrorLabel.js"; +import { Attention } from "../../components/Attention.js"; +import { doAutoFocus } from "../PaytoWireTransferForm.js"; export function RemoveAccount({ account, @@ -36,47 +38,15 @@ export function RemoveAccount({ } return onLoadNotOk(result); } - const ref = useRef(null); - useEffect(() => { - if (focus) ref.current?.focus(); - }, [focus]); - const balance = Amounts.parse(result.data.balance.amount); if (!balance) { return
there was an error reading the balance
; } const isBalanceEmpty = Amounts.isZero(balance); if (!isBalanceEmpty) { - return
-
-
-
- -
-
-

- Can't delete the account -

-
-

- The account can't be delete while still holding some balance. First make sure that the owner make a complete cashout. -

-
-
- -
-
-
- -
-
+ return + The account can't be delete while still holding some balance. First make sure that the owner make a complete cashout. + } async function doRemove() { @@ -117,26 +87,9 @@ export function RemoveAccount({ return (
-
-
-
- -
-
-

- You are going to remove the account -

-
-

- This step can't be undone. -

-
-
- -
-
+ + This step can't be undone. +
@@ -164,7 +117,7 @@ export function RemoveAccount({