Fixed build errors

This commit is contained in:
Linus Flood
2024-09-25 09:54:21 +02:00
parent 7874a47bf4
commit ac5e48357c

View File

@@ -15,14 +15,14 @@ export default async function HeaderFallback() {
lang: getLang(), lang: getLang(),
}) })
if (!data) { if (!data?.header) {
return null return null
} }
const homeHref = homeHrefs[env.NODE_ENV][getLang()] 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) .filter((link) => link.show_on_mobile)
.sort((a, b) => (a.sort_order_mobile < b.sort_order_mobile ? 1 : -1)) .sort((a, b) => (a.sort_order_mobile < b.sort_order_mobile ? 1 : -1))
@@ -30,13 +30,13 @@ export default async function HeaderFallback() {
<header className={styles.header} role="banner"> <header className={styles.header} role="banner">
<OfflineBanner /> <OfflineBanner />
<TopMenu <TopMenu
frontpageLinkText={frontpage_link_text} frontpageLinkText={frontpageLinkText}
homeHref={homeHref} homeHref={homeHref}
links={top_menu.links} links={topMenu.links}
languageSwitcher={null} languageSwitcher={null}
/> />
<MainMenu <MainMenu
frontpageLinkText={frontpage_link_text} frontpageLinkText={frontpageLinkText}
homeHref={homeHref} homeHref={homeHref}
links={menu.links} links={menu.links}
logo={logo} logo={logo}