feat: Add hotel page component

This commit is contained in:
Chuma McPhoy
2024-06-26 15:48:35 +02:00
parent 0d8c29bd01
commit 0f0bd7361e
3 changed files with 57 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import { notFound } from "next/navigation"
import ContentPage from "@/components/ContentType/ContentPage"
import HotelPage from "@/components/ContentType/HotelPage"
import LoyaltyPage from "@/components/ContentType/LoyaltyPage"
import {
@@ -18,6 +19,8 @@ export default async function ContentTypePage({
return <ContentPage />
case "loyalty-page":
return <LoyaltyPage lang={params.lang} />
case "hotel-page":
return <HotelPage lang={params.lang} />
default:
const type: never = params.contentType
console.error(`Unsupported content type given: ${type}`)

View File

@@ -0,0 +1,23 @@
import { serverClient } from "@/lib/trpc/server"
import MaxWidth from "@/components/MaxWidth"
import Title from "../TempDesignSystem/Text/Title"
import styles from "./loyaltyPage.module.css"
import type { LangParams } from "@/types/params"
export default async function HotelPage({ lang }: LangParams) {
const hotelPage = await serverClient().contentstack.hotelPage.get()
if (!hotelPage) {
return null
}
return (
<section className={styles.content}>
<MaxWidth className={styles.blocks} tag="main">
<Title>ID: {hotelPage.hotel_page_id}</Title>
</MaxWidth>
</section>
)
}

View File

@@ -0,0 +1,31 @@
.content {
display: grid;
padding-bottom: var(--Spacing-x9);
padding-left: var(--Spacing-x0);
padding-right: var(--Spacing-x0);
position: relative;
}
.blocks {
display: grid;
gap: var(--Spacing-x5);
padding-left: var(--Spacing-x2);
padding-right: var(--Spacing-x2);
}
@media screen and (min-width: 1367px) {
.content {
gap: var(--Spacing-x3);
padding-left: var(--Spacing-x3);
padding-right: var(--Spacing-x3);
}
.blocks {
padding-left: var(--Spacing-x0);
padding-right: var(--Spacing-x0);
}
.blocks > section:first-of-type > header {
gap: var(--Spacing-x2);
}
}