feat(WEB-131): add loyalty page
This commit is contained in:
40
app/[lang]/(live)/(public)/loyalty-page/page.tsx
Normal file
40
app/[lang]/(live)/(public)/loyalty-page/page.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import Title from "@/components/Title"
|
||||
import MaxWidth from "@/components/MaxWidth"
|
||||
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
import { LangParams, PageArgs, UriParams } from "@/types/params"
|
||||
import { notFound } from "next/navigation"
|
||||
|
||||
import styles from "./page.module.css"
|
||||
|
||||
export default async function LoyaltyPage({
|
||||
params,
|
||||
searchParams,
|
||||
}: PageArgs<LangParams, UriParams>) {
|
||||
try {
|
||||
if (!searchParams.uri) {
|
||||
throw new Error("Bad URI")
|
||||
}
|
||||
|
||||
const loyaltyPage = await serverClient().contentstack.loyaltyPage.get({
|
||||
uri: searchParams.uri,
|
||||
lang: params.lang,
|
||||
})
|
||||
|
||||
return (
|
||||
<main className={styles.content}>
|
||||
<aside>{loyaltyPage.sidebar ? <></> : null}</aside>
|
||||
<MaxWidth>
|
||||
<Title>{loyaltyPage.title}</Title>
|
||||
<Content content={loyaltyPage.content} />
|
||||
</MaxWidth>
|
||||
</main>
|
||||
)
|
||||
} catch (err) {
|
||||
return notFound()
|
||||
}
|
||||
}
|
||||
|
||||
function Content(content: any) {
|
||||
return <></>
|
||||
}
|
||||
Reference in New Issue
Block a user