fix: refactor breadcrumbs to take page type variants to better match margins
This commit is contained in:
@@ -5,18 +5,20 @@ import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/Bread
|
||||
import { setLang } from "@/i18n/serverContext"
|
||||
|
||||
import type { ContentTypeParams, LangParams, PageArgs } from "@/types/params"
|
||||
import { PageContentTypeEnum } from "@/types/requests/contentType"
|
||||
|
||||
export default function PageBreadcrumbs({
|
||||
params,
|
||||
}: PageArgs<LangParams & ContentTypeParams>) {
|
||||
setLang(params.lang)
|
||||
|
||||
if (params.contentType === "hotel-page") {
|
||||
if (params.contentType === PageContentTypeEnum.hotelPage) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<Suspense fallback={<BreadcrumbsSkeleton />}>
|
||||
<Breadcrumbs />
|
||||
<Breadcrumbs variant={params.contentType} />
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
.layout {
|
||||
display: grid;
|
||||
font-family: var(--typography-Body-Regular-fontFamily);
|
||||
gap: var(--Spacing-x3);
|
||||
grid-template-rows: auto 1fr;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import type {
|
||||
PageArgs,
|
||||
UIDParams,
|
||||
} from "@/types/params"
|
||||
import { PageContentTypeEnum } from "@/types/requests/contentType"
|
||||
|
||||
export { generateMetadata } from "@/utils/generateMetadata"
|
||||
|
||||
@@ -28,12 +29,12 @@ export default async function ContentTypePage({
|
||||
const pathname = headers().get("x-pathname") || ""
|
||||
|
||||
switch (params.contentType) {
|
||||
case "collection-page":
|
||||
case PageContentTypeEnum.collectionPage:
|
||||
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||
return notFound()
|
||||
}
|
||||
return <CollectionPage />
|
||||
case "content-page": {
|
||||
case PageContentTypeEnum.contentPage: {
|
||||
const isSignupRoute = isSignupPage(pathname)
|
||||
|
||||
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||
@@ -52,9 +53,9 @@ export default async function ContentTypePage({
|
||||
|
||||
return <ContentPage />
|
||||
}
|
||||
case "loyalty-page":
|
||||
case PageContentTypeEnum.loyaltyPage:
|
||||
return <LoyaltyPage />
|
||||
case "hotel-page":
|
||||
case PageContentTypeEnum.hotelPage:
|
||||
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||
return notFound()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user