More PR fixes
This commit is contained in:
@@ -2,7 +2,7 @@ import { serverClient } from "@/lib/trpc/server"
|
|||||||
|
|
||||||
import MobileMenu from "../MobileMenu"
|
import MobileMenu from "../MobileMenu"
|
||||||
|
|
||||||
export default async function MobileMenuServer() {
|
export default async function MobileMenuWrapper() {
|
||||||
const [languages, headerData] = await Promise.all([
|
const [languages, headerData] = await Promise.all([
|
||||||
serverClient().contentstack.languageSwitcher.get(),
|
serverClient().contentstack.languageSwitcher.get(),
|
||||||
serverClient().contentstack.base.header(),
|
serverClient().contentstack.base.header(),
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import MyPagesMobileMenu from "../MyPagesMobileMenu"
|
|||||||
|
|
||||||
import styles from "../mainMenu.module.css"
|
import styles from "../mainMenu.module.css"
|
||||||
|
|
||||||
export default async function MyPagesMenuServer() {
|
export default async function MyPagesMenuWrapper() {
|
||||||
const lang = getLang()
|
const lang = getLang()
|
||||||
const [intl, myPagesNavigation, user, membership] = await Promise.all([
|
const [intl, myPagesNavigation, user, membership] = await Promise.all([
|
||||||
getIntl(),
|
getIntl(),
|
||||||
|
|||||||
@@ -1,19 +1,15 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { z } from "zod"
|
|
||||||
|
|
||||||
import { getHeaderSchema } from "@/server/routers/contentstack/base/output"
|
|
||||||
|
|
||||||
import NavigationMenuItem from "../NavigationMenuItem"
|
import NavigationMenuItem from "../NavigationMenuItem"
|
||||||
|
|
||||||
import styles from "../navigationMenu.module.css"
|
import styles from "../navigationMenu.module.css"
|
||||||
|
|
||||||
|
import { NavigationMenuListProps } from "@/types/components/header/navigationMenuList"
|
||||||
|
|
||||||
export default function NavigationMenuList({
|
export default function NavigationMenuList({
|
||||||
isMobile,
|
isMobile,
|
||||||
items,
|
items,
|
||||||
}: {
|
}: NavigationMenuListProps) {
|
||||||
isMobile: boolean
|
|
||||||
items: z.infer<typeof getHeaderSchema>["menuItems"]
|
|
||||||
}) {
|
|
||||||
return (
|
return (
|
||||||
<ul
|
<ul
|
||||||
className={`${styles.navigationMenu} ${isMobile ? styles.mobile : styles.desktop}`}
|
className={`${styles.navigationMenu} ${isMobile ? styles.mobile : styles.desktop}`}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import Image from "@/components/Image"
|
|||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
import { getLang } from "@/i18n/serverContext"
|
import { getLang } from "@/i18n/serverContext"
|
||||||
|
|
||||||
import MobileMenuServer from "./MobileMenuWrapper"
|
import MobileMenuWrapper from "./MobileMenuWrapper"
|
||||||
import MyPagesMenuServer from "./MyPagesMenuWrapper"
|
import MyPagesMenuWrapper from "./MyPagesMenuWrapper"
|
||||||
import NavigationMenu from "./NavigationMenu"
|
import NavigationMenu from "./NavigationMenu"
|
||||||
|
|
||||||
import styles from "./mainMenu.module.css"
|
import styles from "./mainMenu.module.css"
|
||||||
@@ -38,10 +38,10 @@ export default async function MainMenu() {
|
|||||||
<NavigationMenu isMobile={false} />
|
<NavigationMenu isMobile={false} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
<Suspense fallback={"Loading profile"}>
|
<Suspense fallback={"Loading profile"}>
|
||||||
<MyPagesMenuServer />
|
<MyPagesMenuWrapper />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
<Suspense fallback={"Loading menu"}>
|
<Suspense fallback={"Loading menu"}>
|
||||||
<MobileMenuServer />
|
<MobileMenuWrapper />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import TopMenu from "./TopMenu"
|
|||||||
|
|
||||||
import styles from "./header.module.css"
|
import styles from "./header.module.css"
|
||||||
|
|
||||||
export default function Header({}) {
|
export default function Header() {
|
||||||
return (
|
return (
|
||||||
<header className={styles.header}>
|
<header className={styles.header}>
|
||||||
<Suspense fallback="Loading top menu">
|
<Suspense fallback="Loading top menu">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Fragment, Suspense } from "react"
|
import { Fragment } from "react"
|
||||||
|
|
||||||
import { logout } from "@/constants/routes/handleAuth"
|
import { logout } from "@/constants/routes/handleAuth"
|
||||||
import { serverClient } from "@/lib/trpc/server"
|
import { serverClient } from "@/lib/trpc/server"
|
||||||
|
|||||||
6
types/components/header/navigationMenuList.ts
Normal file
6
types/components/header/navigationMenuList.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { MenuItems } from "@/types/header"
|
||||||
|
|
||||||
|
export interface NavigationMenuListProps {
|
||||||
|
isMobile: boolean
|
||||||
|
items: MenuItems
|
||||||
|
}
|
||||||
@@ -10,3 +10,4 @@ export type HeaderRefResponse = z.input<typeof getHeaderRefSchema>
|
|||||||
export type HeaderResponse = z.input<typeof getHeaderSchema>
|
export type HeaderResponse = z.input<typeof getHeaderSchema>
|
||||||
export type Header = z.output<typeof getHeaderSchema>
|
export type Header = z.output<typeof getHeaderSchema>
|
||||||
export type MenuItem = z.output<typeof menuItemSchema>
|
export type MenuItem = z.output<typeof menuItemSchema>
|
||||||
|
export type MenuItems = z.infer<typeof getHeaderSchema>["menuItems"]
|
||||||
|
|||||||
Reference in New Issue
Block a user