From 79809b22f0f395c6a2324e059e82e94a1b0e1955 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 6 Dec 2023 15:27:08 -0300 Subject: allows deletion from owner --- packages/demobank-ui/src/Routing.tsx | 14 ++++++++++++++ packages/demobank-ui/src/pages/ProfileNavigation.tsx | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/demobank-ui/src/Routing.tsx b/packages/demobank-ui/src/Routing.tsx index aa46f2b7d..f8a625621 100644 --- a/packages/demobank-ui/src/Routing.tsx +++ b/packages/demobank-ui/src/Routing.tsx @@ -192,6 +192,20 @@ export function Routing(): VNode { )} /> + ( + { + route("/") + }} + onCancel={() => { + route("/account") + }} + /> + )} + /> ( diff --git a/packages/demobank-ui/src/pages/ProfileNavigation.tsx b/packages/demobank-ui/src/pages/ProfileNavigation.tsx index 5b0f09360..3596d0f11 100644 --- a/packages/demobank-ui/src/pages/ProfileNavigation.tsx +++ b/packages/demobank-ui/src/pages/ProfileNavigation.tsx @@ -4,7 +4,7 @@ import { useBankCoreApiContext } from "../context/config.js"; import { assertUnreachable } from "./WithdrawalOperationPage.js"; import { useBackendState } from "../hooks/backend.js"; -export function ProfileNavigation({ current }: { current: "details" | "credentials" | "cashouts" }): VNode { +export function ProfileNavigation({ current }: { current: "details" | "delete" | "credentials" | "cashouts" }): VNode { const { i18n } = useTranslationContext() const { config } = useBankCoreApiContext() const { state: credentials } = useBackendState(); @@ -19,6 +19,10 @@ export function ProfileNavigation({ current }: { current: "details" | "credentia window.location.href = "#/my-profile"; return; } + case "delete": { + window.location.href = "#/delete-my-account"; + return; + } case "credentials": { window.location.href = "#/my-password"; return; @@ -31,6 +35,9 @@ export function ProfileNavigation({ current }: { current: "details" | "credentia } }}> + {!config.allow_deletions ? undefined : + + } {config.allow_conversion ? @@ -43,6 +50,12 @@ export function ProfileNavigation({ current }: { current: "details" | "credentia Details + {!config.allow_deletions ? undefined : + + Delete + + + } Credentials -- cgit v1.2.3