From 819f9d0c7354b9066efe24ee6374a04db93803ea Mon Sep 17 00:00:00 2001 From: fadilkun45 Date: Thu, 24 Sep 2026 11:00:12 +0700 Subject: [PATCH] fix: hide menu items based on current pathname in navbar component --- src/components/navbar.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index 332e0f2..0008539 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -6,12 +6,15 @@ import Link from "next/link"; import { useState, useEffect } from "react"; import { usePathname } from "next/navigation"; + export default function Navbar() { const [open, setOpen] = useState(false); const [activeSection, setActiveSection] = useState(""); const pathname = usePathname(); const isContact = pathname === "/contact"; const active = isContact ? "contact" : activeSection; + const hideMenu = ["/perubahan-pricing-waba"].some((path) => pathname.includes(path)); + const menu = [ { label: "About Us", url: "/#about-us", id: "about-us" }, @@ -41,10 +44,10 @@ export default function Navbar() { <>
logo - -
+
{menu?.map((item) => (
{item.label}
@@ -62,7 +65,7 @@ export default function Navbar() {
-
+
{menu?.map((item) => ( setOpen(false)}>
{item.label}