From 28e1e09bfb105b54bc974abe063234723f877933 Mon Sep 17 00:00:00 2001 From: Wong Chee Hong Date: Wed, 15 Nov 2023 15:36:18 +0800 Subject: [PATCH] Show navbar only when logged in --- frontend/src/App.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 1c18ff8..dc1129b 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -117,10 +117,16 @@ function App() { const finalRoutes = loggedInRoutes.concat(isAuthenticated && isAdmin ? adminOnlyRoutes : []) const router = createBrowserRouter([ - { + + isAuthenticated ? { Component: NavbarWrapper, - children: isAuthenticated ? finalRoutes : publicRoutes, - }, + children: finalRoutes, + } : { + children: publicRoutes + } + + + , { path: "*", Component: PageNotFound }, ]);