fix: refactor breadcrumbs to take page type variants to better match margins

This commit is contained in:
Christel Westerberg
2025-01-03 11:39:24 +01:00
parent 053ef4a1c9
commit 5901cab440
46 changed files with 286 additions and 175 deletions

View File

@@ -5,13 +5,14 @@ import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/Bread
import { setLang } from "@/i18n/serverContext"
import type { LangParams, PageArgs } from "@/types/params"
import { PageContentTypeEnum } from "@/types/requests/contentType"
export default function AllBreadcrumbs({ params }: PageArgs<LangParams>) {
setLang(params.lang)
return (
<Suspense fallback={<BreadcrumbsSkeleton />}>
<Breadcrumbs />
<Breadcrumbs variant={PageContentTypeEnum.accountPage} />
</Suspense>
)
}

View File

@@ -1,15 +1,18 @@
.blocks {
display: grid;
gap: var(--Spacing-x5);
padding-left: var(--Spacing-x2);
padding-right: var(--Spacing-x2);
max-width: var(--max-width-page);
align-content: flex-start;
}
@media screen and (min-width: 768px) {
.blocks {
gap: var(--Spacing-x7);
}
}
@media screen and (min-width: 1367px) {
.blocks {
gap: var(--Spacing-x7);
padding-left: var(--Spacing-x0);
padding-right: var(--Spacing-x0);
}
}

View File

@@ -1,11 +1,11 @@
.layout {
display: grid;
font-family: var(--typography-Body-Regular-fontFamily);
gap: var(--Spacing-x3);
grid-template-rows: auto 1fr;
min-height: 100dvh;
max-width: var(--max-width);
max-width: var(--max-width-page);
margin: 0 auto;
width: 100%;
}
.container {
@@ -15,8 +15,6 @@
.content {
display: grid;
padding-bottom: var(--Spacing-x9);
padding-left: var(--Spacing-x0);
padding-right: var(--Spacing-x0);
position: relative;
}
@@ -24,7 +22,5 @@
.content {
gap: var(--Spacing-x5);
grid-template-columns: max(340px) 1fr;
padding-left: var(--Spacing-x5);
padding-right: var(--Spacing-x5);
}
}

View File

@@ -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>
)
}

View File

@@ -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;
}

View File

@@ -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()
}

View File

@@ -5,6 +5,7 @@ import BookingWidget, { preload } from "@/components/BookingWidget"
import { getLang } from "@/i18n/serverContext"
import type { ContentTypeParams, PageArgs } from "@/types/params"
import { PageContentTypeEnum } from "@/types/requests/contentType"
export default async function BookingWidgetPage({
params,
@@ -16,7 +17,7 @@ export default async function BookingWidgetPage({
const urlParams = new URLSearchParams()
if (params.contentType === "hotel-page") {
if (params.contentType === PageContentTypeEnum.hotelPage) {
const hotelPageData = await getHotelPage()
const hotelData = await getHotelData({