From 3694cc3e509f6943a08abfc7813adc590d256f1b Mon Sep 17 00:00:00 2001 From: RohithChitrada Date: Mon, 8 Jul 2024 18:39:09 +0530 Subject: [PATCH] Hamburger added --- src/components/Navbar.js | 95 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 90 insertions(+), 5 deletions(-) diff --git a/src/components/Navbar.js b/src/components/Navbar.js index 0364560..22b3ed2 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.js @@ -1,13 +1,18 @@ -import React from "react"; +import React, { useState } from "react"; import { Link } from "react-router-dom"; const Navbar = () => { + const [isOpen, setIsOpen] = useState(false); const isLoggedIn = localStorage.getItem("isLoggedIn") === "true"; const currentUser = JSON.parse(localStorage.getItem("currentUser")); const userRole = currentUser?.role; + const toggleMenu = () => { + setIsOpen(!isOpen); + }; + return ( -