Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions admin/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import React from "react";
import React, { useEffect } from "react";
import { Button } from "./ui/button";
import { ArrowRightFromLine, ChevronDown } from "lucide-react";
import { ArrowRightFromLine } from "lucide-react";
import { Link, useLocation } from "react-router-dom";




const Navbar = () => {
const location = useLocation();

useEffect(() => {
// Remove focus/highlight from any active element when location changes
if (document.activeElement) {
document.activeElement.blur();
}
}, [location]);

return (
<div className="px-[5vw] py-2 w-full flex justify-between items-center bg-green-900 text-white text-xl gap-5 z-10 sticky top-0 left-0 h-16">
<div className="px-[5vw] py-2 w-full flex justify-between items-center bg-green-900 text-white text-xl gap-5 z-10 sticky top-0 left-0 h-16">
<div className="flex gap-5">
<Link to="/">
<p>Home</p>
Expand All @@ -24,19 +29,14 @@ const Navbar = () => {
<p>Contact Us</p>
</div>
<div className="flex gap-4">
{location.pathname === "/login" ||
location.pathname === "/userlogin" ? (
<></>
) : (
{location.pathname !== "/login" && location.pathname !== "/userlogin" && (
<Link to="/login">
<Button className="gap-2 px-5 text-xl bg-green-500 hover:bg-white hover:text-black">
LOGIN <ArrowRightFromLine />
</Button>
</Link>
)}
{location.pathname === "/register" ? (
<></>
) : (
{location.pathname !== "/register" && (
<Link to="/register">
<Button className="text-xl bg-transparent hover:bg-white hover:text-black">
REGISTER
Expand Down
23 changes: 13 additions & 10 deletions employee/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import React from "react";
import React, { useEffect } from "react";
import { Button } from "./ui/button";
import { ArrowRightFromLine, ChevronDown } from "lucide-react";
import { ArrowRightFromLine } from "lucide-react";
import { Link, useLocation } from "react-router-dom";

const Navbar = () => {
const location = useLocation();

useEffect(() => {
// Remove focus/highlight from any active element when location changes
if (document.activeElement) {
document.activeElement.blur();
}
}, [location]);

return (
<div className="px-[5vw] py-2 w-full flex justify-between items-center bg-green-900 text-white text-xl gap-5 z-10 sticky top-0 left-0 h-16">
<div className="px-[5vw] py-2 w-full flex justify-between items-center bg-green-900 text-white text-xl gap-5 z-10 sticky top-0 left-0 h-16">
<div className="flex gap-5">
<Link to="/">
<p>Home</p>
Expand All @@ -21,19 +29,14 @@ const Navbar = () => {
<p>Contact Us</p>
</div>
<div className="flex gap-4">
{location.pathname === "/login" ||
location.pathname === "/userlogin" ? (
<></>
) : (
{location.pathname !== "/login" && location.pathname !== "/userlogin" && (
<Link to="/login">
<Button className="gap-2 px-5 text-xl bg-green-500 hover:bg-white hover:text-black">
LOGIN <ArrowRightFromLine />
</Button>
</Link>
)}
{location.pathname === "/register" ? (
<></>
) : (
{location.pathname !== "/register" && (
<Link to="/register">
<Button className="text-xl bg-transparent hover:bg-white hover:text-black">
REGISTER
Expand Down
Loading