aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages/ProfileNavigation.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/demobank-ui/src/pages/ProfileNavigation.tsx')
-rw-r--r--packages/demobank-ui/src/pages/ProfileNavigation.tsx10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/demobank-ui/src/pages/ProfileNavigation.tsx b/packages/demobank-ui/src/pages/ProfileNavigation.tsx
index a6615d578..02f30d8e8 100644
--- a/packages/demobank-ui/src/pages/ProfileNavigation.tsx
+++ b/packages/demobank-ui/src/pages/ProfileNavigation.tsx
@@ -19,6 +19,7 @@ import { privatePages } from "../Routing.js";
import { useBankCoreApiContext } from "../context/config.js";
import { useBackendState } from "../hooks/backend.js";
import { assertUnreachable } from "@gnu-taler/taler-util";
+import { useNavigationContext } from "../context/navigation.js";
export function ProfileNavigation({
current,
@@ -32,6 +33,7 @@ export function ProfileNavigation({
credentials.status !== "loggedIn"
? false
: !credentials.isUserAdministrator;
+ const { navigateTo } = useNavigationContext()
return (
<div>
<div class="sm:hidden">
@@ -46,19 +48,19 @@ export function ProfileNavigation({
const op = e.currentTarget.value as typeof current;
switch (op) {
case "details": {
- window.location.href = privatePages.myAccountDetails.url({});
+ navigateTo(privatePages.myAccountDetails.url({}));
return;
}
case "delete": {
- window.location.href = privatePages.myAccountDelete.url({});
+ navigateTo(privatePages.myAccountDelete.url({}));
return;
}
case "credentials": {
- window.location.href = privatePages.myAccountPassword.url({});
+ navigateTo(privatePages.myAccountPassword.url({}));
return;
}
case "cashouts": {
- window.location.href = privatePages.myAccountCashouts.url({});
+ navigateTo(privatePages.myAccountCashouts.url({}));
return;
}
default: