From 2b895bea57ae486004d8173354ccd5af52cf042e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 14 Jun 2024 12:33:17 -0300 Subject: new payto form --- .../src/components/modal/index.tsx | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) (limited to 'packages/merchant-backoffice-ui/src/components/modal') diff --git a/packages/merchant-backoffice-ui/src/components/modal/index.tsx b/packages/merchant-backoffice-ui/src/components/modal/index.tsx index 43062d13e..518583a9c 100644 --- a/packages/merchant-backoffice-ui/src/components/modal/index.tsx +++ b/packages/merchant-backoffice-ui/src/components/modal/index.tsx @@ -31,6 +31,8 @@ import { AccountLetter, codecForAccountLetter, PaytoString, + PaytoUri, + stringifyPaytoUri, } from "@gnu-taler/taler-util"; interface Props { @@ -288,6 +290,107 @@ export function ImportingAccountModal({ ); } +interface CompareAccountsModalProps { + onCancel: () => void; + onConfirm: (account: PaytoString) => void; + formPayto: PaytoUri | undefined; + testPayto: PaytoUri; +} + +export function CompareAccountsModal({ + onCancel, + onConfirm, + formPayto, + testPayto, +}: CompareAccountsModalProps): VNode { + const { i18n } = useTranslationContext(); + return ( + onConfirm(stringifyPaytoUri(testPayto))} + > +

+ + Testing agaisnt the account info URL succedded but the account + information reported is different with the account details form. + +

+
+ + + + + + + + + + + + + + + {testPayto.targetType === "iban" && ( + + + + + + )} + {testPayto.targetType === "bitcoin" && ( + + + + + + )} + {testPayto.targetType === "x-taler-bank" && ( + + + + + + + + + + + + + )} + + + + + + +
+ Field + + In the form + + Reported +
+ Type + {formPayto?.targetType ?? "--"}{testPayto.targetType}
+ IBAN + {formPayto?.targetPath ?? "--"}{testPayto.targetPath}
+ Address + {formPayto?.targetPath ?? "--"}{testPayto.targetPath}
+ Host + {formPayto?.targetPath ?? "--"}{testPayto.targetPath}
+ Account id + {formPayto?.targetPath ?? "--"}{testPayto.targetPath}
+ Owner's name + {formPayto?.params["receiver-name"] ?? "--"}{testPayto.params["receiver-name"]}
+
+
+ ); +} + interface DeleteModalProps { element: { id: string; name: string }; onCancel: () => void; -- cgit v1.2.3