Skip to content

Commit 28e1e09

Browse files
committed
Show navbar only when logged in
1 parent 10b2e64 commit 28e1e09

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

frontend/src/App.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,16 @@ function App() {
117117
const finalRoutes = loggedInRoutes.concat(isAuthenticated && isAdmin ? adminOnlyRoutes : [])
118118

119119
const router = createBrowserRouter([
120-
{
120+
121+
isAuthenticated ? {
121122
Component: NavbarWrapper,
122-
children: isAuthenticated ? finalRoutes : publicRoutes,
123-
},
123+
children: finalRoutes,
124+
} : {
125+
children: publicRoutes
126+
}
127+
128+
129+
,
124130
{ path: "*", Component: PageNotFound },
125131
]);
126132

0 commit comments

Comments
 (0)