From abafae8a1bf5b8b22b09438eac1d2292b6f836f2 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 20 May 2024 12:48:44 -0300 Subject: fix #8856 #8840 --- .../src/cta/Withdraw/views.tsx | 152 ++++++++++++++++----- 1 file changed, 120 insertions(+), 32 deletions(-) (limited to 'packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx') diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx index aade67835..cdddd9bbc 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/views.tsx @@ -23,7 +23,12 @@ import { Part } from "../../components/Part.js"; import { QR } from "../../components/QR.js"; import { SelectList } from "../../components/SelectList.js"; import { TermsOfService } from "../../components/TermsOfService/index.js"; -import { Input, LinkSuccess, SvgIcon, WarningBox } from "../../components/styled/index.js"; +import { + Input, + LinkSuccess, + SvgIcon, + WarningBox, +} from "../../components/styled/index.js"; import { Button } from "../../mui/Button.js"; import { Grid } from "../../mui/Grid.js"; import editIcon from "../../svg/edit_24px.inline.svg"; @@ -37,28 +42,102 @@ import { EnabledBySettings } from "../../components/EnabledBySettings.js"; export function FinalStateOperation(state: State.AlreadyCompleted): VNode { const { i18n } = useTranslationContext(); + // document.location.href = res.confirmTransferUrl + if (state.thisWallet) { + switch (state.operationState) { + case "confirmed": { + state.redirectToTx(); + return ( + +
+ + This operation has already been completed. + +
+
+ ); + } + case "aborted": { + state.redirectToTx(); + return ( + +
+ + This operation has already been aborted + +
+
+ ); + } + case "selected": { + if (state.confirmTransferUrl) { + document.location.href = state.confirmTransferUrl; + } + return ( + +
+ + This operation has started and should be completed in the bank. + +
+ {state.confirmTransferUrl && ( +
+ + You can confirm the operation in + +   + + this page + +
+ )} +
+ ); + } + } + } switch (state.operationState) { - case "confirmed": return -
- This operation has already been completed by another wallet. -
-
- case "aborted": return -
- This operation has already been aborted -
-
- case "selected": return -
- This operation has already been used by another wallet. -
-
- It can be confirmed in  - this page - -
-
+ case "confirmed": + return ( + +
+ + This operation has already been completed by another wallet. + +
+
+ ); + case "aborted": + return ( + +
+ + This operation has already been aborted + +
+
+ ); + case "selected": + return ( + +
+ + This operation has already been used by another wallet. + +
+
+ It can be confirmed in  + + this page + +
+
+ ); } } @@ -95,21 +174,31 @@ export function SuccessView(state: State.Success): VNode { kind="neutral" big /> - {state.chooseCurrencies.length > 0 ? + {state.chooseCurrencies.length > 0 ? (

- {state.chooseCurrencies.map(currency => { - return + {state.chooseCurrencies.map((currency) => { + return ( + + ); })}

- : } + ) : ( + + )}