Langswitcher as parallel instead of Header. Using promise.all and added some Suspenses

This commit is contained in:
Linus Flood
2024-09-11 19:59:25 +02:00
parent 12178279d3
commit 33ffd781bb
15 changed files with 144 additions and 87 deletions

View File

@@ -23,13 +23,14 @@ export default async function MainMenu({
menuItems,
topLink,
}: MainMenuProps) {
const intl = await getIntl()
const lang = getLang()
const myPagesNavigation =
await serverClient().contentstack.myPages.navigation.get()
const user = await serverClient().user.name()
const membership = await serverClient().user.safeMembershipLevel()
const [intl, myPagesNavigation, user, membership] = await Promise.all([
getIntl(),
serverClient().contentstack.myPages.navigation.get(),
serverClient().user.name(),
serverClient().user.safeMembershipLevel(),
])
return (
<div className={styles.mainMenu}>