feat(SW-66, SW-348): search functionality and ui

This commit is contained in:
Simon Emanuelsson
2024-08-28 10:47:57 +02:00
parent b9dbcf7d90
commit af850c90e7
437 changed files with 7663 additions and 9881 deletions

View File

@@ -22,14 +22,14 @@ export default async function Header() {
serverClient().contentstack.myPages.navigation.get(),
])
if (!navigation || !languages || !data) {
if (!navigation || !languages || !data?.header) {
return null
}
const homeHref = homeHrefs[env.NODE_ENV][getLang()]
const { frontpage_link_text, logo, menu, top_menu } = data
const { frontpageLinkText, logo, menu, topMenu } = data.header
const topMenuMobileLinks = top_menu.links
const topMenuMobileLinks = topMenu.links
.filter((link) => link.show_on_mobile)
.sort((a, b) => (a.sort_order_mobile < b.sort_order_mobile ? 1 : -1))
@@ -37,13 +37,13 @@ export default async function Header() {
<header className={styles.header} role="banner">
<OfflineBanner />
<TopMenu
frontpageLinkText={frontpage_link_text}
frontpageLinkText={frontpageLinkText}
homeHref={homeHref}
links={top_menu.links}
links={topMenu.links}
languageSwitcher={<LanguageSwitcher urls={languages.urls} />}
/>
<MainMenu
frontpageLinkText={frontpage_link_text}
frontpageLinkText={frontpageLinkText}
homeHref={homeHref}
links={menu.links}
logo={logo}