Langswitcher as parallel instead of Header. Using promise.all and added some Suspenses
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { Suspense } from "react"
|
||||
|
||||
import { GiftIcon, SearchIcon } from "@/components/Icons"
|
||||
import LanguageSwitcher from "@/components/LanguageSwitcher"
|
||||
import { getIntl } from "@/i18n"
|
||||
@@ -8,7 +10,10 @@ import styles from "./topMenu.module.css"
|
||||
|
||||
import type { TopMenuProps } from "@/types/components/header/topMenu"
|
||||
|
||||
export default async function TopMenu({ languageUrls, topLink }: TopMenuProps) {
|
||||
export default async function TopMenu({
|
||||
languageSwitcher,
|
||||
topLink,
|
||||
}: TopMenuProps) {
|
||||
const intl = await getIntl()
|
||||
|
||||
return (
|
||||
@@ -21,7 +26,7 @@ export default async function TopMenu({ languageUrls, topLink }: TopMenuProps) {
|
||||
</HeaderLink>
|
||||
) : null}
|
||||
<div className={styles.options}>
|
||||
<LanguageSwitcher type="desktopHeader" urls={languageUrls} />
|
||||
<Suspense>{languageSwitcher}</Suspense>
|
||||
<HeaderLink href="#">
|
||||
<SearchIcon width={20} height={20} color="burgundy" />
|
||||
{intl.formatMessage({ id: "Find booking" })}
|
||||
|
||||
Reference in New Issue
Block a user