chore: add breadcrumbs to loyalty page
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
import { Blocks } from "@/components/Loyalty/Blocks"
|
||||
import Sidebar from "@/components/Loyalty/Sidebar"
|
||||
import MaxWidth from "@/components/MaxWidth"
|
||||
|
||||
import Breadcrumbs from "../MyPages/Breadcrumbs"
|
||||
|
||||
import styles from "./loyaltyPage.module.css"
|
||||
|
||||
export default async function LoyaltyPage() {
|
||||
const loyaltyPage = await serverClient().contentstack.loyaltyPage.get()
|
||||
const session = await auth()
|
||||
|
||||
return (
|
||||
<section className={styles.content}>
|
||||
{session && <Breadcrumbs b={true} />}
|
||||
{loyaltyPage.sidebar.length ? (
|
||||
<Sidebar blocks={loyaltyPage.sidebar} />
|
||||
) : null}
|
||||
|
||||
@@ -6,9 +6,13 @@ import BreadcrumbsWithLink from "./BreadcrumbWithLink"
|
||||
|
||||
import styles from "./breadcrumbs.module.css"
|
||||
|
||||
export default async function Breadcrumbs() {
|
||||
const breadcrumbs = await serverClient().contentstack.breadcrumbs.get()
|
||||
|
||||
type bool = {
|
||||
b?: Boolean
|
||||
}
|
||||
export default async function Breadcrumbs({ b = false }: bool) {
|
||||
let breadcrumbs
|
||||
if (!b) breadcrumbs = await serverClient().contentstack.breadcrumbs.get()
|
||||
else breadcrumbs = await serverClient().contentstack.breadcrumbs.loyalty()
|
||||
return (
|
||||
<nav className={styles.breadcrumbs}>
|
||||
<ul className={styles.list}>
|
||||
|
||||
Reference in New Issue
Block a user