From 37c85bbd0aa0abd41484a637ae41db3fdb890ccd Mon Sep 17 00:00:00 2001 From: Gabriel Thompson Date: Sat, 2 Nov 2024 18:11:39 -0400 Subject: [PATCH] Made navbar change appropriately to whether user is logged in --- frontend/src/app/components/Navbar.tsx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/components/Navbar.tsx b/frontend/src/app/components/Navbar.tsx index 6c8ab19..ebd907e 100644 --- a/frontend/src/app/components/Navbar.tsx +++ b/frontend/src/app/components/Navbar.tsx @@ -6,11 +6,11 @@ import { useRouter } from "next/navigation"; import { User } from "firebase/auth"; const navBarLinks = [ - { name: "Home", link: "/" }, - { name: "About", link: "/about" }, - { name: "Carbon Dashboard", link: "/dashboard" }, - { name: "Transactions", link: "/transactions" }, - { name: "Map", link: "/map" }, + { name: "Home", link: "/", access_restricted: false }, + { name: "About", link: "/about", access_restricted: false }, + { name: "Carbon Dashboard", link: "/dashboard", access_restricted: true }, + { name: "Transactions", link: "/transactions", access_restricted: true }, + { name: "Map", link: "/map", access_restricted: true }, ]; const Navbar = () => { @@ -53,13 +53,15 @@ const Navbar = () => {