💄 create navigation in navbar

This commit is contained in:
2025-07-13 00:27:42 +07:00
parent 771cbf9091
commit 564d230250
4 changed files with 32 additions and 25 deletions

View File

@ -0,0 +1,7 @@
import React from "react";
const page = () => {
return <div>Explore Page</div>;
};
export default page;

View File

@ -11,6 +11,7 @@ import {
NavbarMenuItem, NavbarMenuItem,
NavbarMenuToggle, NavbarMenuToggle,
} from "@heroui/react"; } from "@heroui/react";
import { usePathname } from "next/navigation";
import React, { useState } from "react"; import React, { useState } from "react";
export const AcmeLogo = () => { export const AcmeLogo = () => {
@ -27,6 +28,7 @@ export const AcmeLogo = () => {
}; };
const NavbarUI = () => { const NavbarUI = () => {
const pathNameNow = usePathname();
const [isMenuOpen, setIsMenuOpen] = useState(false); const [isMenuOpen, setIsMenuOpen] = useState(false);
const navbarItems = [ const navbarItems = [
@ -35,16 +37,20 @@ const NavbarUI = () => {
route: "/", route: "/",
}, },
{ {
title: "Featured", title: "Explore",
route: "/featured", route: "/explore",
}, },
{ {
title: "Season", title: "Trending",
route: "/season", route: "/trending",
}, },
{ {
title: "Genres", title: "Genres",
route: "/genres", route: "/genre",
},
{
title: "Schedule",
route: "/schedule",
}, },
]; ];
@ -62,26 +68,20 @@ const NavbarUI = () => {
</NavbarContent> </NavbarContent>
<NavbarContent className="hidden sm:flex gap-6" justify="center"> <NavbarContent className="hidden sm:flex gap-6" justify="center">
<NavbarItem> {navbarItems.map((item, index) => {
<Link color="foreground" href="#"> const isActive = item.route === pathNameNow;
Home
</Link> return (
</NavbarItem> <NavbarItem key={index} isActive={isActive}>
<NavbarItem isActive> <Link
<Link aria-current="page" href="#"> color={isActive ? "primary" : "foreground"}
Explore href={isActive ? "" : item.route}
</Link> >
</NavbarItem> {item.title}
<NavbarItem>
<Link color="foreground" href="#">
Trending
</Link>
</NavbarItem>
<NavbarItem>
<Link color="foreground" href="#">
Schedule
</Link> </Link>
</NavbarItem> </NavbarItem>
);
})}
</NavbarContent> </NavbarContent>
<NavbarContent justify="end"> <NavbarContent justify="end">
<NavbarItem className="hidden lg:flex"> <NavbarItem className="hidden lg:flex">

View File

View File