Merged in feature/hardcoded-mypages-links (pull request #1325)

Feature/hardcoded mypages links

* feat: wip use hardcoded links

* Merge branch 'master' of bitbucket.org:scandic-swap/web into feature/hardcoded-mypages-links

* feat: use hardcoded links for my pages to support dynamic links

* cleanup

* code fixes

* refactor: restructure MyPagesMobileDropdown component for improved readability

* use util timeout function


Approved-by: Christian Andolf
Approved-by: Linus Flood
This commit is contained in:
Joakim Jäderberg
2025-02-13 09:28:30 +00:00
parent eabe45b73c
commit 6f51130e48
30 changed files with 500 additions and 556 deletions

View File

@@ -3,10 +3,13 @@ import { env } from "@/env/server"
import {
getCurrentHeader,
getLanguageSwitcher,
getMyPagesNavigation,
getName,
} from "@/lib/trpc/memoizedRequests"
import {
getPrimaryLinks,
getSecondaryLinks,
} from "@/components/MyPages/menuItems"
import { getLang } from "@/i18n/serverContext"
import LanguageSwitcher from "./LanguageSwitcher"
@@ -18,14 +21,17 @@ import TopMenu from "./TopMenu"
import styles from "./header.module.css"
export default async function Header() {
const [data, user, languages, navigation] = await Promise.all([
getCurrentHeader(getLang()),
getName(),
getLanguageSwitcher(),
getMyPagesNavigation(),
])
const lang = getLang()
const [data, user, languages, primaryLinks, secondaryLinks] =
await Promise.all([
getCurrentHeader(lang),
getName(),
getLanguageSwitcher(),
getPrimaryLinks({ lang }),
getSecondaryLinks({ lang }),
])
if (!navigation || !languages || !data?.header) {
if (!languages || !data?.header) {
return null
}
@@ -53,7 +59,10 @@ export default async function Header() {
topMenuMobileLinks={topMenuMobileLinks}
languageSwitcher={<LanguageSwitcher urls={languages.urls} />}
myPagesMobileDropdown={
<MyPagesMobileDropdown navigation={navigation} />
<MyPagesMobileDropdown
primaryLinks={primaryLinks}
secondaryLinks={secondaryLinks}
/>
}
bookingHref={homeHref}
user={user}