feat(WEB-102): language-switcher per page basis

This commit is contained in:
Simon Emanuelsson
2024-02-20 15:58:53 +01:00
parent 9e56ff158d
commit 7417abc814
28 changed files with 355 additions and 1377 deletions

View File

@@ -1,14 +1,10 @@
// import Desktop from "../LanguageSwitcher/Desktop"
import Desktop from "../LanguageSwitcher/Desktop"
import styles from "./topMenu.module.css"
import type { TopMenuProps } from "@/types/components/current/header/topMenu"
/**
* Desktop is commented out as it relates to
* LanguageSwitcher and will be handled in another task
*/
export default function TopMenu({ frontpageLinkText, homeHref, links }: TopMenuProps) {
export default function TopMenu({ currentLanguage, frontpageLinkText, homeHref, links, urls }: TopMenuProps) {
return (
<div className={styles.topMenu}>
<div className={styles.container}>
@@ -20,9 +16,12 @@ export default function TopMenu({ frontpageLinkText, homeHref, links }: TopMenuP
</a>
<ul className={styles.list}>
{/* <li className="nav-secondary__item hidden-xxsmall hidden-xsmall hidden-small">
{links ? <Desktop currentLanguage={currentLanguage} links={links} /> : null}
</li> */}
{urls ? (
<li className="nav-secondary__item hidden-xxsmall hidden-xsmall hidden-small">
<Desktop currentLanguage={currentLanguage} urls={urls} />
</li>
) : null}
{links.map(({ link }) => (
<li key={link.href}>
<a