fix: sync current header with static-pages

This commit is contained in:
Christel Westerberg
2024-05-24 13:22:15 +02:00
parent 19d8b757cd
commit dd930688fc
22 changed files with 612 additions and 148 deletions

View File

@@ -3,20 +3,16 @@ import { useState } from "react"
import Image from "@/components/Image"
import Mobile from "../LanguageSwitcher/Mobile"
import styles from "./mainMenu.module.css"
import type { MainMenuProps } from "@/types/components/current/header/mainMenu"
export default function MainMenu({
currentLanguage,
frontpageLinkText,
homeHref,
links,
logo,
topMenuMobileLinks,
urls,
}: MainMenuProps) {
const [isOpen, setIsOpen] = useState(false)
@@ -69,8 +65,8 @@ export default function MainMenu({
data-collapsable="main-menu"
id="main-menu"
>
{links.map((link) => (
<li className={styles.li} key={link.href}>
{links.map((link, i) => (
<li className={styles.li} key={link.href + i}>
<a className={styles.link} href={link.href}>
{link.title}
</a>
@@ -78,8 +74,8 @@ export default function MainMenu({
))}
<ul className={styles.mobileList}>
{topMenuMobileLinks.map(({ link }) => (
<li className={styles.mobileLi} key={link.href}>
{topMenuMobileLinks.map(({ link }, i) => (
<li className={styles.mobileLi} key={link.href + i}>
<a className={styles.mobileLink} href={link.href}>
{link.title}
</a>
@@ -87,11 +83,9 @@ export default function MainMenu({
))}
</ul>
{urls ? (
<li className={styles.mobileLi}>
<Mobile currentLanguage={currentLanguage} urls={urls} />
</li>
) : null}
{/* {languageSwitcher ? (
<li className={styles.mobileLi}>{languageSwitcher}</li>
) : null} */}
</ul>
</nav>
</div>