Skip to content

Commit

Permalink
Merge pull request #489 from The-Phoenics/Missing-active-nav-element-…
Browse files Browse the repository at this point in the history
…styling-479

Added styling foor active nav element
  • Loading branch information
subhadeeproy3902 authored Jul 21, 2024
2 parents 7dc5de9 + e2830bd commit 184069b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/shared/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import ThemeTogglebutton from "../ui/ThemeToggle";
import { useState } from "react";
import NavLink from "./NavLink";
import { title } from "process";
import { usePathname } from "next/navigation";

const Header = () => {
const [menuOpen, setMenuOpen] = useState(false);
const handleMenuOpen = () => {
setMenuOpen(!menuOpen);
};
const pathname = usePathname();
const links = [
{
title: "Home",
Expand Down Expand Up @@ -62,7 +64,9 @@ const Header = () => {
{links.map((link, index) => (
<Link
key={index}
className="transition text-foreground hover:text-foreground/75"
className={`transition ${
pathname === link.path ? 'text-primary font-bold' : 'text-foreground hover:text-foreground/75'
}`}
href={link.path}
>
{link.title}
Expand Down

0 comments on commit 184069b

Please sign in to comment.