From c8caa1458c1978165303d377d2e398cd08c8c97c Mon Sep 17 00:00:00 2001 From: meet Date: Sun, 16 Jun 2024 13:55:00 +0530 Subject: [PATCH 1/2] New PR for navbar with all issues fixed --- frontend/src/components/Navbar.tsx | 93 +++++++++--------------------- 1 file changed, 26 insertions(+), 67 deletions(-) diff --git a/frontend/src/components/Navbar.tsx b/frontend/src/components/Navbar.tsx index 1890c61d..9e3a632d 100644 --- a/frontend/src/components/Navbar.tsx +++ b/frontend/src/components/Navbar.tsx @@ -3,7 +3,7 @@ import { useRecoilValue, useSetRecoilState } from "recoil"; import { loggedInState, tokenState } from "../store/atoms/auth"; import { Link, useLocation } from "react-router-dom"; import toast from "react-hot-toast"; -import logo from "../assets/favicon.png"; +import logo from '../assets/favicon.png'; import { useTranslation } from "react-i18next"; const Navbar = () => { @@ -25,23 +25,19 @@ const Navbar = () => { localStorage.removeItem("token"); setTokenState(""); closeMenu(); - toast.success("Logged out successfully"); + toast.success('Logged out successfully'); }; - const getNavLinkClass = (path: string) => { + const getNavLinkClass = (path:string) => { return location.pathname === path - ? "block py-2 px-3 bg-blue-600 rounded md:bg-transparent md:p-0 text-white md:text-blue-300" - : "block py-2 px-3 rounded md:border-0 md:p-0 text-white md:hover:text-blue-300 hover:bg-blue-400 hover:text-white md:hover:bg-transparent"; + ? "block py-2 px-3 bg-blue-600 rounded lg:bg-transparent lg:p-0 text-white lg:text-blue-300" + : "block py-2 px-3 rounded lg:border-0 lg:p-0 text-white lg:hover:text-blue-300 hover:bg-blue-400 hover:text-white lg:hover:bg-transparent"; }; return ( -