diff --git a/frontend/src/Component/Navbar/NavbarLeft.js b/frontend/src/Component/Navbar/NavbarLeft.js index 996df69f..741cb4a8 100644 --- a/frontend/src/Component/Navbar/NavbarLeft.js +++ b/frontend/src/Component/Navbar/NavbarLeft.js @@ -1,5 +1,5 @@ import React, { useEffect } from "react"; -import "../../style/Navbar.css"; +import "../../style/Navbar.css" import logo from "../../image/logo1.png"; function NavbarLeft(props, showSideNav) { useEffect(() => { @@ -12,6 +12,7 @@ function NavbarLeft(props, showSideNav) { document.body.addEventListener('click', handleDocumentClick); return () => { + // Removed event listener on component unmount document.body.removeEventListener('click', handleDocumentClick); }; }, [props]); @@ -39,7 +40,7 @@ function NavbarLeft(props, showSideNav) { - + {/* Added onClick handler */} this