Skip to content

Commit a9c8686

Browse files
Merge pull request #87 from codexsit/codex-6-Navbar
add home link
2 parents 5dd3e04 + 01063fe commit a9c8686

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/App.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Loader from "@/components/Loader";
1111
import ScrollToTop from "@/components/ScrollToTop";
1212

1313
const navLinks = [
14+
{ name: "Home", path: "/" },
1415
{ name: "About Us", path: "/about-us" },
1516
{ name: "Our Team", path: "/teams" },
1617
{ name: "Gallery", path: "/gallery" },

src/components/Navbar/index.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ function Navbar({ links }) {
1919

2020
return (
2121
<nav
22-
className={`shadow-md w-full flex xs:flex-col md:flex-row ${isOpen ? "xs:h-screen" : ""} md:h-full justify-between items-center pr-6 bg-secondary-dark relative z-50`}
22+
className={`shadow-md w-full flex xs:flex-col md:flex-row ${
23+
isOpen ? "xs:h-screen" : ""
24+
} md:h-full justify-between items-center pr-6 bg-secondary-dark relative z-50`}
2325
>
2426
<div className="flex flex-row justify-between xs:w-full md:w-auto items-center">
2527
<Link
@@ -62,11 +64,7 @@ function Navbar({ links }) {
6264
</Link>
6365
<span
6466
className={`block group-hover:max-w-full transition-all duration-500 h-0.5 bg-primary rounded ${
65-
location.pathname
66-
.toLowerCase()
67-
.includes(link.path.toLowerCase())
68-
? "w-full"
69-
: "max-w-0"
67+
location.pathname === link.path ? "w-full" : "max-w-0"
7068
}`}
7169
/>
7270
</li>

0 commit comments

Comments
 (0)