From ec7280645147f6f4c9823a09e4ada4d13fe67d47 Mon Sep 17 00:00:00 2001 From: Akos Komuves Date: Tue, 26 Dec 2023 20:03:13 +0100 Subject: [PATCH] hide navigation item if not logged in --- app/components/Navigation/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/components/Navigation/index.tsx b/app/components/Navigation/index.tsx index ca5b5d4..e6e0fe6 100644 --- a/app/components/Navigation/index.tsx +++ b/app/components/Navigation/index.tsx @@ -21,6 +21,12 @@ export default function Navigation({ loginId?: string | null; defaultTenant: boolean; }) { + function getNavigationItems() { + if (!loginId) return []; + + return navigation; + } + function renderTeamLink() { if (!isAdmin) return null; @@ -135,7 +141,7 @@ export default function Navigation({
- {navigation.map((item) => { + {getNavigationItems().map((item) => { if (item.name === "Team" && defaultTenant) return null; return ( @@ -201,7 +207,7 @@ export default function Navigation({
- {navigation.map((item) => ( + {getNavigationItems().map((item) => (