diff --git a/components/layout/Menu.js b/components/layout/Menu.js index ec46343..aab6f85 100644 --- a/components/layout/Menu.js +++ b/components/layout/Menu.js @@ -2,66 +2,75 @@ import Link from "next/link"; import { usePathname } from "next/navigation"; export default function Menu() { - const pathname = usePathname(); - const isActive = (path) => path === pathname; - const isHomeLinkActive = () => { - return homeLinks.some((link) => link.path === pathname) ? 1 : 0; - }; - const isAboutLinkActive = () => { - return aboutLinks.some((link) => link.path === pathname) ? 1 : 0; - }; - const isServicesLinkActive = () => { - return servicesLinks.some((link) => link.path === pathname) ? 1 : 0; - }; - const isPagesLinkActive = () => { - return pagesLinks.some((link) => link.path === pathname) ? 1 : 0; - }; - const isBlogLinkActive = () => { - return blogLinks.some((link) => link.path === pathname) ? 1 : 0; - }; + const pathname = usePathname(); + const isActive = (path) => path === pathname; + const isHomeLinkActive = () => { + return homeLinks.some((link) => link.path === pathname) ? 1 : 0; + }; + const isAboutLinkActive = () => { + return aboutLinks.some((link) => link.path === pathname) ? 1 : 0; + }; + const isServicesLinkActive = () => { + return servicesLinks.some((link) => link.path === pathname) ? 1 : 0; + }; + const isPagesLinkActive = () => { + return pagesLinks.some((link) => link.path === pathname) ? 1 : 0; + }; + const isBlogLinkActive = () => { + return blogLinks.some((link) => link.path === pathname) ? 1 : 0; + }; - return ( - <> -