From 5901cab440e77adf9fd95e54c092f27927e43d7a Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Fri, 3 Jan 2025 11:39:24 +0100 Subject: [PATCH] fix: refactor breadcrumbs to take page type variants to better match margins --- .../my-pages/@breadcrumbs/[...path]/page.tsx | 3 +- .../my-pages/[...path]/page.module.css | 11 ++++--- .../(protected)/my-pages/layout.module.css | 8 ++--- .../[contentType]/[uid]/@breadcrumbs/page.tsx | 6 ++-- .../[contentType]/[uid]/layout.module.css | 1 - .../(public)/[contentType]/[uid]/page.tsx | 9 +++--- .../[contentType]/[uid]/page.tsx | 3 +- app/globals.css | 2 +- components/Breadcrumbs/index.tsx | 8 +++-- .../PreviewImages/previewImages.module.css | 12 ++++++-- .../TabNavigation/tabNavigation.module.css | 4 ++- .../HotelPage/hotelPage.module.css | 18 +++++++++-- components/ContentType/HotelPage/index.tsx | 3 +- .../LoyaltyPage/loyaltyPage.module.css | 8 ++--- .../StaticPages/staticPage.module.css | 26 +++++++++++++--- .../Current/NotFound/notFound.module.css | 2 +- components/Footer/Details/details.module.css | 9 ++++-- .../Footer/Navigation/navigation.module.css | 6 ++-- .../FormContent/formContent.module.css | 7 +++-- .../Forms/BookingWidget/form.module.css | 23 ++++---------- .../MainMenuButton/menuButton.module.css | 2 +- .../Header/MainMenu/mainMenu.module.css | 7 ++++- components/Header/TopMenu/topMenu.module.css | 4 +-- .../Mobile/BottomSheet/bottomSheet.module.css | 13 ++++++-- .../selectHotelMapContent.module.css | 10 ++++++- .../SelectHotel/SelectHotelSkeleton.tsx | 19 +++++++----- .../HotelReservation/SelectHotel/index.tsx | 20 +++++++------ .../SelectHotel/selectHotel.module.css | 30 +++++++++++-------- .../HotelInfoCard/hotelInfoCard.module.css | 12 ++++++-- .../RateSummary/rateSummary.module.css | 6 ++-- .../Rooms/RoomsContainerSkeleton.module.css | 3 +- .../SelectRate/Rooms/rooms.module.css | 4 +-- .../TempDesignSystem/Alert/alert.module.css | 6 +--- .../Breadcrumbs/breadcrumbs.module.css | 29 ++++++++++++------ .../Breadcrumbs/breadcrumbs.ts | 7 ++++- .../TempDesignSystem/Breadcrumbs/index.tsx | 13 ++++++-- .../TempDesignSystem/Breadcrumbs/variants.ts | 21 +++++++++++++ middlewares/utils.ts | 3 +- .../contentstack/bookingwidget/query.ts | 22 +++++++------- .../routers/contentstack/breadcrumbs/query.ts | 12 ++++---- .../contentstack/languageSwitcher/query.ts | 14 ++++----- server/routers/contentstack/metadata/query.ts | 12 ++++---- types/params.ts | 11 +++---- types/requests/contentType.ts | 2 +- types/requests/pageType.ts | 8 ----- utils/entry.ts | 2 +- 46 files changed, 286 insertions(+), 175 deletions(-) create mode 100644 components/TempDesignSystem/Breadcrumbs/variants.ts delete mode 100644 types/requests/pageType.ts diff --git a/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx b/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx index dde4eb4b7..fd46c04a6 100644 --- a/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx +++ b/app/[lang]/(live)/(protected)/my-pages/@breadcrumbs/[...path]/page.tsx @@ -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) { setLang(params.lang) return ( }> - + ) } diff --git a/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css b/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css index f1ce5c9b5..80c9c8513 100644 --- a/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css +++ b/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css @@ -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); } } diff --git a/app/[lang]/(live)/(protected)/my-pages/layout.module.css b/app/[lang]/(live)/(protected)/my-pages/layout.module.css index fdde0e3af..ebc0f0dc9 100644 --- a/app/[lang]/(live)/(protected)/my-pages/layout.module.css +++ b/app/[lang]/(live)/(protected)/my-pages/layout.module.css @@ -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); } } diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx index 3fd70362d..4c5e7751b 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx @@ -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) { setLang(params.lang) - if (params.contentType === "hotel-page") { + if (params.contentType === PageContentTypeEnum.hotelPage) { return null } + return ( }> - + ) } diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.module.css b/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.module.css index 2ec5fbe51..c83db84f0 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.module.css +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.module.css @@ -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; } diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx index 31fcd6add..476a423a4 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx @@ -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 - 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 } - case "loyalty-page": + case PageContentTypeEnum.loyaltyPage: return - case "hotel-page": + case PageContentTypeEnum.hotelPage: if (env.HIDE_FOR_NEXT_RELEASE) { return notFound() } diff --git a/app/[lang]/(live)/@bookingwidget/[contentType]/[uid]/page.tsx b/app/[lang]/(live)/@bookingwidget/[contentType]/[uid]/page.tsx index fc57012f6..6951d700a 100644 --- a/app/[lang]/(live)/@bookingwidget/[contentType]/[uid]/page.tsx +++ b/app/[lang]/(live)/@bookingwidget/[contentType]/[uid]/page.tsx @@ -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({ diff --git a/app/globals.css b/app/globals.css index 0978d5dd9..84aac2481 100644 --- a/app/globals.css +++ b/app/globals.css @@ -100,7 +100,7 @@ --current-max-width: 113.5rem; --max-width: 94.5rem; - --max-width-content: 74.75rem; + --max-width-content: min(calc(100dvw - var(--max-width-spacing)), 74.75rem); --max-width-text-block: 49.5rem; --current-mobile-site-header-height: 52.41px; --max-width-navigation: 89.5rem; diff --git a/components/Breadcrumbs/index.tsx b/components/Breadcrumbs/index.tsx index 00d3d7985..928074000 100644 --- a/components/Breadcrumbs/index.tsx +++ b/components/Breadcrumbs/index.tsx @@ -3,7 +3,11 @@ import { serverClient } from "@/lib/trpc/server" import BreadcrumbsComp from "@/components/TempDesignSystem/Breadcrumbs" import { generateBreadcrumbsSchema } from "@/utils/jsonSchemas" -export default async function Breadcrumbs() { +import type { BreadcrumbsProps } from "@/components/TempDesignSystem/Breadcrumbs/breadcrumbs" + +export default async function Breadcrumbs({ + variant, +}: Pick) { const breadcrumbs = await serverClient().contentstack.breadcrumbs.get() if (!breadcrumbs?.length) { @@ -19,7 +23,7 @@ export default async function Breadcrumbs() { __html: JSON.stringify(jsonSchema.jsonLd), }} /> - + ) } diff --git a/components/ContentType/HotelPage/PreviewImages/previewImages.module.css b/components/ContentType/HotelPage/PreviewImages/previewImages.module.css index b97213583..a562acd2b 100644 --- a/components/ContentType/HotelPage/PreviewImages/previewImages.module.css +++ b/components/ContentType/HotelPage/PreviewImages/previewImages.module.css @@ -3,7 +3,7 @@ gap: 8px; position: relative; width: 100%; - padding: var(--Spacing-x2) var(--Spacing-x2) 0; + padding: 0 var(--Spacing-x2); z-index: 0; } @@ -14,6 +14,8 @@ height: 100%; max-height: 30vh; cursor: pointer; + max-width: var(--max-width-page); + margin: 0 auto; } .imageWrapper > :nth-child(2), @@ -28,6 +30,12 @@ z-index: 1; } +@media screen and (min-width: 768px) { + .seeAllButton { + right: calc(var(--Spacing-x2) + var(--Layout-Tablet-Margin-Margin-min)); + } +} + @media screen and (min-width: 1367px) { .imageWrapper { grid-template-columns: 70% 30%; @@ -35,7 +43,7 @@ grid-template-areas: "main side1" "main side2"; - padding: var(--Spacing-x2) var(--Spacing-x5) 0; + padding: 0 var(--Spacing-x5); } .image { diff --git a/components/ContentType/HotelPage/TabNavigation/tabNavigation.module.css b/components/ContentType/HotelPage/TabNavigation/tabNavigation.module.css index 31e41abee..ffa95c049 100644 --- a/components/ContentType/HotelPage/TabNavigation/tabNavigation.module.css +++ b/components/ContentType/HotelPage/TabNavigation/tabNavigation.module.css @@ -12,9 +12,10 @@ display: flex; gap: var(--Spacing-x4); justify-content: flex-start; - padding: 0 var(--Spacing-x2); width: 100%; overflow-x: auto; + max-width: var(--max-width-page); + margin: 0 auto; } @media screen and (min-width: 768px) { @@ -28,5 +29,6 @@ padding: 0 var(--Spacing-x5); max-width: calc(100% - var(--hotel-page-map-desktop-width)); overflow-x: visible; + margin: 0; } } diff --git a/components/ContentType/HotelPage/hotelPage.module.css b/components/ContentType/HotelPage/hotelPage.module.css index fd47cf7ea..a4096d7d5 100644 --- a/components/ContentType/HotelPage/hotelPage.module.css +++ b/components/ContentType/HotelPage/hotelPage.module.css @@ -13,7 +13,6 @@ "tabNavigation" "mainSection" "mapContainer"; - margin: 0 auto; max-width: var(--max-width); } @@ -26,7 +25,9 @@ grid-area: mainSection; display: grid; gap: var(--Spacing-x9); - padding: var(--Spacing-x4) var(--Spacing-x2); + padding: var(--Spacing-x4) 0; + max-width: var(--max-width-page); + margin: 0 auto; } .mapContainer { @@ -51,6 +52,17 @@ gap: var(--Spacing-x2); } +@media screen and (min-width: 768px) { + .pageContainer { + margin: 0 auto; + } + + .mainSection { + max-width: 100%; + padding: var(--Spacing-x6) var(--Layout-Tablet-Margin-Margin-min); + } +} + @media screen and (min-width: 1367px) { .pageContainer { grid-template-areas: @@ -61,7 +73,7 @@ } .mainSection { grid-area: mainSection; - padding: var(--Spacing-x6) var(--Spacing-x4); + padding: var(--Spacing-x6) var(--Layout-Desktop-Margin-Margin-min); } .mapContainer { display: flex; diff --git a/components/ContentType/HotelPage/index.tsx b/components/ContentType/HotelPage/index.tsx index 5c10f451d..992cdc2d2 100644 --- a/components/ContentType/HotelPage/index.tsx +++ b/components/ContentType/HotelPage/index.tsx @@ -42,6 +42,7 @@ import { FacilityCardTypeEnum } from "@/types/components/hotelPage/facilities" import type { HotelPageProps } from "@/types/components/hotelPage/hotelPage" import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation" import type { Facility } from "@/types/hotel" +import { PageContentTypeEnum } from "@/types/requests/contentType" export default async function HotelPage({ hotelId }: HotelPageProps) { const lang = getLang() @@ -122,7 +123,7 @@ export default async function HotelPage({ hotelId }: HotelPageProps) { />
}> - + {images?.length ? ( diff --git a/components/ContentType/LoyaltyPage/loyaltyPage.module.css b/components/ContentType/LoyaltyPage/loyaltyPage.module.css index 76ab24efa..0d63965ea 100644 --- a/components/ContentType/LoyaltyPage/loyaltyPage.module.css +++ b/components/ContentType/LoyaltyPage/loyaltyPage.module.css @@ -3,8 +3,8 @@ grid-template-areas: "main"; grid-template-columns: 1fr; gap: var(--Spacing-x5); - padding: 0 var(--Spacing-x2) var(--Spacing-x9); - max-width: var(--max-width); + padding-bottom: var(--Spacing-x9); + max-width: var(--max-width-page); margin: 0 auto; width: 100%; } @@ -27,10 +27,6 @@ } @media screen and (min-width: 1367px) { - .content { - padding: 0 var(--Spacing-x5) var(--Spacing-x9); - } - .content:has(> aside) { grid-template-areas: "sidebar main"; grid-template-columns: 360px 1fr; diff --git a/components/ContentType/StaticPages/staticPage.module.css b/components/ContentType/StaticPages/staticPage.module.css index 849fa8947..775e4a1f3 100644 --- a/components/ContentType/StaticPages/staticPage.module.css +++ b/components/ContentType/StaticPages/staticPage.module.css @@ -4,7 +4,7 @@ .header { background-color: var(--Base-Surface-Subtle-Normal); - padding: var(--Spacing-x4) var(--Spacing-x2); + padding: var(--Spacing-x4) 0; } .headerContent { @@ -32,9 +32,9 @@ } .contentContainer { + padding-top: var(--Spacing-x4); + width: 100%; padding: var(--Spacing-x4) var(--Spacing-x2) 0; - max-width: var(--max-width-content); - margin: 0 auto; } .content .contentContainer { @@ -48,9 +48,10 @@ .mainContent { display: grid; - gap: var(--Spacing-x4); width: 100%; gap: var(--Spacing-x6); + margin: 0 auto; + max-width: var(--max-width-content); } .content .mainContent { @@ -58,9 +59,21 @@ } @media (min-width: 768px) { + .contentContainer { + padding: var(--Spacing-x4) 0; + } + + .heroContainer { + padding: var(--Spacing-x4) 0; + } + .headerIntro { gap: var(--Spacing-x3); } + + .header { + padding: var(--Spacing-x4) 0; + } } @media (min-width: 1367px) { @@ -70,6 +83,8 @@ .contentContainer { padding: var(--Spacing-x4) 0 0; + max-width: var(--max-width-content); + margin: 0 auto; } .content .contentContainer { @@ -80,5 +95,8 @@ .mainContent { gap: var(--Spacing-x9); + padding: 0; + max-width: none; + margin: 0; } } diff --git a/components/Current/NotFound/notFound.module.css b/components/Current/NotFound/notFound.module.css index 9229e0f91..6f2d79e74 100644 --- a/components/Current/NotFound/notFound.module.css +++ b/components/Current/NotFound/notFound.module.css @@ -10,7 +10,7 @@ position: relative; text-align: center; box-sizing: content-box; - max-width: 1200px; + max-width: var(--max-width-page); margin: 0 auto; padding: 70px 30px; } diff --git a/components/Footer/Details/details.module.css b/components/Footer/Details/details.module.css index 2d624e064..f09fe2301 100644 --- a/components/Footer/Details/details.module.css +++ b/components/Footer/Details/details.module.css @@ -1,20 +1,23 @@ .details { background: var(--Base-Text-High-contrast); color: var(--Primary-Dark-On-Surface-Text); - padding: var(--Spacing-x3) var(--Spacing-x2) var(--Spacing-x6); + padding: var(--Spacing-x3) 0 var(--Spacing-x6); } .topContainer { display: flex; justify-content: space-between; padding-bottom: var(--Spacing-x2); - margin-bottom: var(--Spacing-x2); + max-width: var(--max-width-page); + margin: 0 auto var(--Spacing-x2); } .bottomContainer { display: flex; justify-content: space-between; flex-direction: column-reverse; + max-width: var(--max-width-page); + margin: 0 auto; } .socialNav { @@ -55,7 +58,7 @@ @media screen and (min-width: 767px) { .details { - padding: var(--Spacing-x6) var(--Spacing-x5) var(--Spacing-x4); + padding: var(--Spacing-x6) 0 var(--Spacing-x4); } .bottomContainer { diff --git a/components/Footer/Navigation/navigation.module.css b/components/Footer/Navigation/navigation.module.css index 5b4d8ae86..b0fa61947 100644 --- a/components/Footer/Navigation/navigation.module.css +++ b/components/Footer/Navigation/navigation.module.css @@ -1,6 +1,6 @@ .section { background: var(--Base-Surface-Subtle-Normal); - padding: var(--Spacing-x7) var(--Spacing-x2); + padding: var(--Spacing-x7) 0; } .maxWidth { @@ -8,12 +8,12 @@ display: flex; justify-content: space-between; flex-direction: column; - max-width: var(--max-width-content); + max-width: var(--max-width-page); } @media screen and (min-width: 767px) { .section { - padding: var(--Spacing-x9) var(--Spacing-x5); + padding: var(--Spacing-x9) 0; } } diff --git a/components/Forms/BookingWidget/FormContent/formContent.module.css b/components/Forms/BookingWidget/FormContent/formContent.module.css index 06a925ba9..a63d7304e 100644 --- a/components/Forms/BookingWidget/FormContent/formContent.module.css +++ b/components/Forms/BookingWidget/FormContent/formContent.module.css @@ -104,10 +104,11 @@ @media screen and (min-width: 768px) and (max-width: 1366px) { .inputContainer { - padding: var(--Spacing-x2) var(--Spacing-x2); + padding: var(--Spacing-x2) var(--Spacing-x2) var(--Spacing-x2) + var(--Layout-Tablet-Margin-Margin-min); } .buttonContainer { - padding-right: var(--Spacing-x2); + padding-right: var(--Layout-Tablet-Margin-Margin-min); } .input .buttonContainer .button { padding: var(--Spacing-x1); @@ -125,7 +126,7 @@ display: flex; background: var(--Base-Surface-Primary-light-Hover); border-bottom: 1px solid var(--Primary-Light-On-Surface-Divider-subtle); - padding: var(--Spacing-x2); + padding: var(--Spacing-x2) var(--Layout-Tablet-Margin-Margin-min); } .voucherContainer { display: none; diff --git a/components/Forms/BookingWidget/form.module.css b/components/Forms/BookingWidget/form.module.css index 46c53e8b2..baa541be1 100644 --- a/components/Forms/BookingWidget/form.module.css +++ b/components/Forms/BookingWidget/form.module.css @@ -2,15 +2,11 @@ align-items: center; display: grid; margin: 0 auto; - width: min( - calc(100dvw - (var(--Spacing-x2) * 2)), - var(--max-width-navigation) - ); + width: 100dvw; } .form { display: grid; - width: 100%; } @media screen and (max-width: 767px) { @@ -20,11 +16,6 @@ } @media screen and (min-width: 768px) { - .section { - display: flex; - width: 100%; - } - .default { border-radius: var(--Corner-radius-Medium); } @@ -36,14 +27,12 @@ var(--Spacing-x-one-and-half) var(--Spacing-x1); } - .section { - width: min( - calc(100dvw - (var(--Spacing-x2) * 2)), - var(--max-width-navigation) - ); - } - .full { padding: var(--Spacing-x1) 0; } + .form { + width: 100%; + max-width: var(--max-width-page); + margin: 0 auto; + } } diff --git a/components/Header/MainMenu/MainMenuButton/menuButton.module.css b/components/Header/MainMenu/MainMenuButton/menuButton.module.css index 25c640d16..f0b6d0130 100644 --- a/components/Header/MainMenu/MainMenuButton/menuButton.module.css +++ b/components/Header/MainMenu/MainMenuButton/menuButton.module.css @@ -6,7 +6,7 @@ background-color: transparent; color: var(--Base-Text-High-contrast); border-width: 0; - padding: var(--Spacing-x-half) var(--Spacing-x1); + padding: var(--Spacing-x-half) 0; cursor: pointer; font-family: var(--typography-Body-Bold-fontFamily); font-weight: 500; /* Should be fixed when variables starts working: var(--typography-Body-Bold-fontWeight); */ diff --git a/components/Header/MainMenu/mainMenu.module.css b/components/Header/MainMenu/mainMenu.module.css index a4ea15478..49d870531 100644 --- a/components/Header/MainMenu/mainMenu.module.css +++ b/components/Header/MainMenu/mainMenu.module.css @@ -1,6 +1,6 @@ .mainMenu { background-color: var(--Base-Surface-Primary-light-Normal); - padding: var(--Spacing-x2); + padding: var(--Spacing-x2) 0; border-bottom: 1px solid var(--Primary-Light-On-Surface-Divider-subtle); } @@ -12,6 +12,8 @@ grid-template-columns: max-content 1fr; align-items: center; gap: var(--Spacing-x2); + max-width: var(--max-width-page); + margin: 0 auto; } .menus { @@ -31,6 +33,9 @@ } @media screen and (min-width: 768px) { + .mainMenu { + padding: var(--Spacing-x2) 0; + } .nav { display: flex; justify-content: space-between; diff --git a/components/Header/TopMenu/topMenu.module.css b/components/Header/TopMenu/topMenu.module.css index 41c610677..c87c126ad 100644 --- a/components/Header/TopMenu/topMenu.module.css +++ b/components/Header/TopMenu/topMenu.module.css @@ -1,11 +1,11 @@ .topMenu { display: none; background-color: var(--Base-Surface-Subtle-Normal); - padding: var(--Spacing-x2); + padding: var(--Spacing-x2) 0; } .content { - max-width: var(--max-width-navigation); + max-width: var(--max-width-page); margin: 0 auto; } diff --git a/components/HotelReservation/EnterDetails/Summary/Mobile/BottomSheet/bottomSheet.module.css b/components/HotelReservation/EnterDetails/Summary/Mobile/BottomSheet/bottomSheet.module.css index 789362b0c..d586effc7 100644 --- a/components/HotelReservation/EnterDetails/Summary/Mobile/BottomSheet/bottomSheet.module.css +++ b/components/HotelReservation/EnterDetails/Summary/Mobile/BottomSheet/bottomSheet.module.css @@ -11,10 +11,12 @@ .bottomSheet { display: grid; grid-template-columns: 1fr auto; - padding: var(--Spacing-x2) var(--Spacing-x3) var(--Spacing-x5) - var(--Spacing-x3); + padding: var(--Spacing-x2) 0 var(--Spacing-x5); align-items: flex-start; transition: 0.5s ease-in-out; + max-width: var(--max-width-page); + width: 100%; + margin: 0 auto; } .priceDetailsButton { @@ -25,6 +27,7 @@ transition: padding 0.5s ease-in-out; cursor: pointer; white-space: nowrap; + padding: 0; } .wrapper[data-open="true"] { @@ -51,6 +54,12 @@ overflow: hidden; } +@media screen and (min-width: 768px) { + .bottomSheet { + padding: var(--Spacing-x2) 0 var(--Spacing-x7); + } +} + @keyframes fadeIn { from { opacity: 0; diff --git a/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContent/selectHotelMapContent.module.css b/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContent/selectHotelMapContent.module.css index f7b28cf18..f3af6fb87 100644 --- a/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContent/selectHotelMapContent.module.css +++ b/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContent/selectHotelMapContent.module.css @@ -37,7 +37,8 @@ .listingContainer { background-color: var(--Base-Surface-Secondary-light-Normal); - padding: var(--Spacing-x3) var(--Spacing-x4); + padding: var(--Spacing-x3) var(--Spacing-x4) var(--Spacing-x3) + var(--Layout-Tablet-Margin-Margin-min); overflow-y: auto; min-width: 420px; width: 420px; @@ -59,3 +60,10 @@ gap: var(--Spacing-x2); } } + +@media (min-width: 1367px) { + .listingContainer { + padding: var(--Spacing-x3) var(--Spacing-x4) var(--Spacing-x3) + var(--Layout-Desktop-Margin-Margin-min); + } +} diff --git a/components/HotelReservation/SelectHotel/SelectHotelSkeleton.tsx b/components/HotelReservation/SelectHotel/SelectHotelSkeleton.tsx index 8cf5134d1..9a5451714 100644 --- a/components/HotelReservation/SelectHotel/SelectHotelSkeleton.tsx +++ b/components/HotelReservation/SelectHotel/SelectHotelSkeleton.tsx @@ -12,15 +12,18 @@ export function SelectHotelSkeleton({ count = 4 }: Props) { return (
-
- -
-
-
- +
+
+
-
- + +
+
+ +
+
+ +
diff --git a/components/HotelReservation/SelectHotel/index.tsx b/components/HotelReservation/SelectHotel/index.tsx index 376a4e31e..cfc37179b 100644 --- a/components/HotelReservation/SelectHotel/index.tsx +++ b/components/HotelReservation/SelectHotel/index.tsx @@ -133,17 +133,19 @@ export default async function SelectHotel({ return ( <>
- -
-
- {city.name} - -
-
- +
+ +
+
+ {city.name} + +
+
+ +
+
-
diff --git a/components/HotelReservation/SelectHotel/selectHotel.module.css b/components/HotelReservation/SelectHotel/selectHotel.module.css index a51fc9bd3..a56b73e03 100644 --- a/components/HotelReservation/SelectHotel/selectHotel.module.css +++ b/components/HotelReservation/SelectHotel/selectHotel.module.css @@ -1,21 +1,25 @@ .main { display: flex; - padding: 0 var(--Spacing-x2) var(--Spacing-x3) var(--Spacing-x2); background-color: var(--Scandic-Brand-Warm-White); min-height: 100dvh; flex-direction: column; - max-width: var(--max-width); + max-width: var(--max-width-page); margin: 0 auto; } .header { + padding: var(--Spacing-x3) 0 var(--Spacing-x2); +} + +.headerContent { + max-width: var(--max-width-page); + margin: 0 auto; display: flex; flex-direction: column; gap: var(--Spacing-x2); - padding: var(--Spacing-x3) var(--Spacing-x2) 0 var(--Spacing-x2); } -.header nav { +.headerContent nav { display: none; } @@ -70,16 +74,18 @@ @media (min-width: 768px) { .main { - padding: var(--Spacing-x5); - } - .header { - display: block; - background-color: var(--Base-Surface-Subtle-Normal); - padding: var(--Spacing-x4) var(--Spacing-x5) var(--Spacing-x3) - var(--Spacing-x5); + padding: var(--Spacing-x5) 0; } - .header nav { + .headerContent { + display: block; + } + .header { + background-color: var(--Base-Surface-Subtle-Normal); + padding: var(--Spacing-x4) 0 var(--Spacing-x3); + } + + .headerContent nav { display: block; max-width: var(--max-width-navigation); padding: 0; diff --git a/components/HotelReservation/SelectRate/HotelInfoCard/hotelInfoCard.module.css b/components/HotelReservation/SelectRate/HotelInfoCard/hotelInfoCard.module.css index a6ef23b5e..d2c6808c2 100644 --- a/components/HotelReservation/SelectRate/HotelInfoCard/hotelInfoCard.module.css +++ b/components/HotelReservation/SelectRate/HotelInfoCard/hotelInfoCard.module.css @@ -1,12 +1,12 @@ .container { background-color: var(--Base-Surface-Subtle-Normal); - padding: var(--Spacing-x3) var(--Spacing-x2); + padding: var(--Spacing-x3) 0; } .wrapper { display: flex; margin: 0 auto; - max-width: var(--max-width-navigation); + max-width: var(--max-width-page); position: relative; flex-direction: column; gap: var(--Spacing-x2); @@ -62,11 +62,17 @@ } .hotelAlert { - max-width: var(--max-width-navigation); + max-width: var(--max-width-page); margin: 0 auto; padding-top: var(--Spacing-x-one-and-half); } +@media screen and (min-width: 768px) { + .container { + padding: var(--Spacing-x4) 0; + } +} + @media screen and (min-width: 1367px) { .container { padding: var(--Spacing-x4) var(--Spacing-x5); diff --git a/components/HotelReservation/SelectRate/RoomSelection/RateSummary/rateSummary.module.css b/components/HotelReservation/SelectRate/RoomSelection/RateSummary/rateSummary.module.css index ed90225b6..9f910233b 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/RateSummary/rateSummary.module.css +++ b/components/HotelReservation/SelectRate/RoomSelection/RateSummary/rateSummary.module.css @@ -13,7 +13,7 @@ .content { width: 100%; - max-width: var(--max-width-navigation); + max-width: var(--max-width-page); margin: 0 auto; display: flex; flex-direction: column; @@ -29,7 +29,7 @@ display: flex; flex-direction: row; gap: var(--Spacing-x4); - padding: var(--Spacing-x2) var(--Spacing-x3) 0; + padding-top: var(--Spacing-x2); width: 100%; } @@ -72,7 +72,7 @@ @media (min-width: 768px) { .summary { - padding: var(--Spacing-x3) var(--Spacing-x7) var(--Spacing-x5); + padding: var(--Spacing-x3) 0 var(--Spacing-x5); } .content { flex-direction: row; diff --git a/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton.module.css b/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton.module.css index 8274a06e5..4e9a9d583 100644 --- a/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton.module.css +++ b/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton.module.css @@ -1,7 +1,6 @@ .container { - padding: var(--Spacing-x2); margin: 0 auto; - max-width: var(--max-width); + max-width: var(--max-width-page); } .filterContainer { diff --git a/components/HotelReservation/SelectRate/Rooms/rooms.module.css b/components/HotelReservation/SelectRate/Rooms/rooms.module.css index 5e2bca00b..994a098fb 100644 --- a/components/HotelReservation/SelectRate/Rooms/rooms.module.css +++ b/components/HotelReservation/SelectRate/Rooms/rooms.module.css @@ -1,8 +1,8 @@ .content { - max-width: var(--max-width); + max-width: var(--max-width-page); margin: 0 auto; display: flex; flex-direction: column; gap: var(--Spacing-x2); - padding: var(--Spacing-x2); + padding: var(--Spacing-x2) 0; } diff --git a/components/TempDesignSystem/Alert/alert.module.css b/components/TempDesignSystem/Alert/alert.module.css index 728f7d22d..d7758be96 100644 --- a/components/TempDesignSystem/Alert/alert.module.css +++ b/components/TempDesignSystem/Alert/alert.module.css @@ -11,7 +11,7 @@ .content { width: 100%; - max-width: var(--max-width-navigation); + max-width: var(--max-width-page); margin: 0 auto; display: flex; gap: var(--Spacing-x2); @@ -60,7 +60,6 @@ /* Intent: banner */ .banner { - padding: 0 var(--Spacing-x3); border-left-width: 6px; border-left-style: solid; } @@ -90,9 +89,6 @@ } @media screen and (min-width: 768px) { - .banner { - padding: 0 var(--Spacing-x5); - } .innerContent { flex-direction: row; align-items: center; diff --git a/components/TempDesignSystem/Breadcrumbs/breadcrumbs.module.css b/components/TempDesignSystem/Breadcrumbs/breadcrumbs.module.css index 8a535c4f8..77585eebb 100644 --- a/components/TempDesignSystem/Breadcrumbs/breadcrumbs.module.css +++ b/components/TempDesignSystem/Breadcrumbs/breadcrumbs.module.css @@ -1,17 +1,35 @@ .breadcrumbs { display: block; - padding: var(--Spacing-x2) var(--Spacing-x2) 0; - max-width: var(--max-width); + padding: var(--Spacing-x4) 0 var(--Spacing-x3); margin: 0 auto; width: 100%; } +.contentWidth.breadcrumbs { + background-color: var(--Base-Surface-Subtle-Normal); + padding-bottom: 0; +} + +.hotelHeaderWidth.breadcrumbs { + max-width: min(var(--max-width-page), calc(100% - var(--max-width-spacing))); +} + +.fullWidth .list { + max-width: var(--max-width-navigation); +} + +.contentWidth .list { + max-width: var(--max-width-content); +} + .list { align-items: center; display: flex; gap: var(--Spacing-x-quarter); justify-content: flex-start; list-style: none; + margin: 0 auto; + max-width: var(--max-width-page); } .listItem { @@ -23,10 +41,3 @@ .homeLink { display: flex; } - -@media screen and (min-width: 1367px) { - .breadcrumbs { - padding-left: var(--Spacing-x5); - padding-right: var(--Spacing-x5); - } -} diff --git a/components/TempDesignSystem/Breadcrumbs/breadcrumbs.ts b/components/TempDesignSystem/Breadcrumbs/breadcrumbs.ts index 6a5a7468b..5999ce00a 100644 --- a/components/TempDesignSystem/Breadcrumbs/breadcrumbs.ts +++ b/components/TempDesignSystem/Breadcrumbs/breadcrumbs.ts @@ -1,9 +1,14 @@ +import type { VariantProps } from "class-variance-authority" + +import type { breadcrumbsVariants } from "./variants" + type Breadcrumb = { title: string uid: string href?: string } -export interface BreadcrumbsProps { +export interface BreadcrumbsProps + extends VariantProps { breadcrumbs: Breadcrumb[] } diff --git a/components/TempDesignSystem/Breadcrumbs/index.tsx b/components/TempDesignSystem/Breadcrumbs/index.tsx index ed40cd519..f17b0c85d 100644 --- a/components/TempDesignSystem/Breadcrumbs/index.tsx +++ b/components/TempDesignSystem/Breadcrumbs/index.tsx @@ -3,18 +3,27 @@ import ChevronRightSmallIcon from "@/components/Icons/ChevronRightSmall" import Link from "@/components/TempDesignSystem/Link" import Footnote from "@/components/TempDesignSystem/Text/Footnote" +import { breadcrumbsVariants } from "./variants" + import styles from "./breadcrumbs.module.css" import type { BreadcrumbsProps } from "@/components/TempDesignSystem/Breadcrumbs/breadcrumbs" -export default function Breadcrumbs({ breadcrumbs }: BreadcrumbsProps) { +export default function Breadcrumbs({ + breadcrumbs, + variant, +}: BreadcrumbsProps) { if (!breadcrumbs?.length) { return null } + const classNames = breadcrumbsVariants({ + variant, + }) + const homeBreadcrumb = breadcrumbs.shift() return ( -