fix: reset initial active section state in navbar component
This commit is contained in:
parent
a0c70bb02e
commit
f8d1f92952
@ -1,26 +0,0 @@
|
||||
import { Metadata } from "next";
|
||||
import "@/style/globals.css";
|
||||
import Logo from "@/image/Logo.svg";
|
||||
import Image from "next/image";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Mulia Informasi Teknologi",
|
||||
description: "Build Fast, Scale Smart",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en" className={`scroll-smooth`}>
|
||||
<body className="min-h-screen w-full flex flex-col">
|
||||
<div className="bg-white px-4 h-19.5 md:h-18.5 flex items-center w-full justify-between md:py-5.5 md:px-16 sticky top-0 left-0 right-0 z-50">
|
||||
<Image src={Logo} width={118} className="w-fit h-7.5" alt="logo" />
|
||||
</div>
|
||||
<div>{children}</div>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@ -8,7 +8,7 @@ import { usePathname } from "next/navigation";
|
||||
|
||||
export default function Navbar() {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [activeSection, setActiveSection] = useState("about-us");
|
||||
const [activeSection, setActiveSection] = useState("");
|
||||
const pathname = usePathname();
|
||||
const isContact = pathname === "/contact";
|
||||
const active = isContact ? "contact" : activeSection;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user