diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/layout.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/layout.tsx index b2723b81c..1dab820d4 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/layout.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/layout.tsx @@ -1,7 +1,22 @@ +import { Suspense } from "react" + +import ChildrenWrapper from "@/components/ChildrenWrapper" + import styles from "./layout.module.css" -export default function HotelReservationLayout({ +export default function AlternativeHotelsLayout({ children, }: React.PropsWithChildren) { - return
{children}
+ return ( +
+ {/* + This Suspense is only needed to prevent useSearchParams from + making everything rendered client-side + https://nextjs.org/docs/14/app/api-reference/functions/use-search-params#static-rendering + */} + + {children} + +
+ ) } diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/loading.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/loading.tsx new file mode 100644 index 000000000..d1dafb91b --- /dev/null +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/loading.tsx @@ -0,0 +1,5 @@ +import { SelectHotelSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelSkeleton" + +export default function AlternativeHotelsLoading() { + return +} diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx index ecc8dd0f6..8f416be53 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/page.tsx @@ -1,30 +1,131 @@ +import stringify from "json-stable-stringify-without-jsonify" +import { cookies } from "next/headers" +import { notFound } from "next/navigation" import { Suspense } from "react" -import SelectHotel from "@/components/HotelReservation/SelectHotel" -import { SelectHotelSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelSkeleton" +import { FamilyAndFriendsCodes } from "@/constants/booking" +import { alternativeHotelsMap } from "@/constants/routes/hotelReservation" -import type { AlternativeHotelsSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams" +import FnFNotAllowedAlert from "@/components/HotelReservation/FnFNotAllowedAlert/FnFNotAllowedAlert" +import SelectHotel from "@/components/HotelReservation/SelectHotel" +import { getHotels } from "@/components/HotelReservation/SelectHotel/helpers" +import { getTracking } from "@/components/HotelReservation/SelectHotel/tracking" +import TrackingSDK from "@/components/TrackingSDK" +import { getIntl } from "@/i18n" +import { setLang } from "@/i18n/serverContext" +import { getHotelSearchDetails } from "@/utils/hotelSearchDetails" + +import type { + AlternativeHotelsSearchParams, + SelectHotelSearchParams, +} from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams" import type { LangParams, PageArgs } from "@/types/params" export default async function AlternativeHotelsPage({ params, searchParams, }: PageArgs) { - const roomKey = Object.keys(searchParams) - .filter((key) => key.startsWith("room[")) - .map((key) => searchParams[key]) - .join("-") + setLang(params.lang) + const searchDetails = await getHotelSearchDetails({ searchParams }, true) + if (!searchDetails || !searchDetails.hotel || !searchDetails.city) { + return notFound() + } + + const { + adultsInRoom, + bookingCode, + childrenInRoom, + city, + hotel: isAlternativeFor, + noOfRooms, + redemption, + selectHotelParams, + } = searchDetails + + if (bookingCode && FamilyAndFriendsCodes.includes(bookingCode)) { + const cookieStore = cookies() + const isInvalidFNF = cookieStore.get("sc")?.value !== "1" + + if (isInvalidFNF) { + return + } + } + + // TODO: This needs to be refactored into its + // own functions + const hotels = await getHotels( + selectHotelParams as SelectHotelSearchParams, + isAlternativeFor, + bookingCode, + city, + !!redemption + ) + + const arrivalDate = new Date(selectHotelParams.fromDate) + const departureDate = new Date(selectHotelParams.toDate) + + const isRedemptionAvailability = redemption + ? hotels.some( + (hotel) => hotel.availability.productType?.redemptions?.length + ) + : false + + const isBookingCodeRateAvailable = bookingCode + ? hotels.some( + (hotel) => + hotel.availability.bookingCode && + hotel.availability.status === "Available" + ) + : false + + const { hotelsTrackingData, pageTrackingData } = getTracking( + params.lang, + !!isAlternativeFor, + arrivalDate, + departureDate, + adultsInRoom, + childrenInRoom, + hotels?.length ?? 0, + selectHotelParams.hotelId, + noOfRooms, + hotels?.[0]?.hotel.address.country, + hotels?.[0]?.hotel.address.city, + selectHotelParams.city, + bookingCode, + isBookingCodeRateAvailable, + redemption, + isRedemptionAvailability + ) + + const mapHref = alternativeHotelsMap(params.lang) + + const intl = await getIntl() + const title = intl.formatMessage( + { + defaultMessage: "Alternatives for {value}", + }, + { + value: isAlternativeFor.name, + } + ) + const suspenseKey = stringify(searchParams) return ( - } - > + <> - + + + + ) } diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx index 2db943cea..a6215efec 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx @@ -4,7 +4,7 @@ import styles from "./layout.module.css" import type { LangParams, LayoutArgs } from "@/types/params" -export default function HotelReservationLayout({ +export default function StandardHotelReservationLayout({ children, }: React.PropsWithChildren>) { return ( diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/layout.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/layout.tsx index 7b1b1bbd4..212e4d298 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/layout.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/layout.tsx @@ -1,9 +1,22 @@ +import { Suspense } from "react" + +import ChildrenWrapper from "@/components/ChildrenWrapper" + import styles from "./layout.module.css" -import type { LangParams, LayoutArgs } from "@/types/params" - -export default function HotelReservationLayout({ +export default function SelectHotelLayout({ children, -}: React.PropsWithChildren>) { - return
{children}
+}: React.PropsWithChildren) { + return ( +
+ {/* + This Suspense is only needed to prevent useSearchParams from + making everything rendered client-side + https://nextjs.org/docs/14/app/api-reference/functions/use-search-params#static-rendering + */} + + {children} + +
+ ) } diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/loading.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/loading.tsx new file mode 100644 index 000000000..5a17cab56 --- /dev/null +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/loading.tsx @@ -0,0 +1,5 @@ +import { SelectHotelSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelSkeleton" + +export default function SelectHotelLoading() { + return +} diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx index 0ebfc686f..ad5d55f7c 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/page.tsx @@ -1,8 +1,18 @@ import stringify from "json-stable-stringify-without-jsonify" +import { cookies } from "next/headers" +import { notFound } from "next/navigation" import { Suspense } from "react" +import { FamilyAndFriendsCodes } from "@/constants/booking" +import { selectHotelMap } from "@/constants/routes/hotelReservation" + +import FnFNotAllowedAlert from "@/components/HotelReservation/FnFNotAllowedAlert/FnFNotAllowedAlert" import SelectHotel from "@/components/HotelReservation/SelectHotel" -import { SelectHotelSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelSkeleton" +import { getHotels } from "@/components/HotelReservation/SelectHotel/helpers" +import { getTracking } from "@/components/HotelReservation/SelectHotel/tracking" +import TrackingSDK from "@/components/TrackingSDK" +import { setLang } from "@/i18n/serverContext" +import { getHotelSearchDetails } from "@/utils/hotelSearchDetails" import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams" import type { LangParams, PageArgs } from "@/types/params" @@ -11,11 +21,91 @@ export default async function SelectHotelPage({ params, searchParams, }: PageArgs) { - const suspenseKey = stringify(searchParams) + setLang(params.lang) + const searchDetails = await getHotelSearchDetails({ searchParams }) + if (!searchDetails || !searchDetails.city) return notFound() + + const { + adultsInRoom, + bookingCode, + childrenInRoom, + city, + noOfRooms, + redemption, + selectHotelParams, + } = searchDetails + + if (bookingCode && FamilyAndFriendsCodes.includes(bookingCode)) { + const cookieStore = cookies() + const isInvalidFNF = cookieStore.get("sc")?.value !== "1" + + if (isInvalidFNF) { + return + } + } + + const hotels = await getHotels( + selectHotelParams, + null, + bookingCode, + city, + !!redemption + ) + + const arrivalDate = new Date(selectHotelParams.fromDate) + const departureDate = new Date(selectHotelParams.toDate) + + const isRedemptionAvailability = redemption + ? hotels.some( + (hotel) => hotel.availability.productType?.redemptions?.length + ) + : false + + const isBookingCodeRateAvailable = bookingCode + ? hotels.some( + (hotel) => + hotel.availability.bookingCode && + hotel.availability.status === "Available" + ) + : false + + const { hotelsTrackingData, pageTrackingData } = getTracking( + params.lang, + false, + arrivalDate, + departureDate, + adultsInRoom, + childrenInRoom, + hotels?.length ?? 0, + selectHotelParams.hotelId, + noOfRooms, + hotels?.[0]?.hotel.address.country, + hotels?.[0]?.hotel.address.city, + selectHotelParams.city, + bookingCode, + isBookingCodeRateAvailable, + redemption, + isRedemptionAvailability + ) + + const mapHref = selectHotelMap(params.lang) + const suspenseKey = stringify(searchParams) return ( - }> - - + <> + + + + + ) } diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/loading.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/loading.tsx new file mode 100644 index 000000000..8bb921599 --- /dev/null +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/loading.tsx @@ -0,0 +1,16 @@ +import { HotelInfoCardSkeleton } from "@/components/HotelReservation/SelectRate/HotelInfoCard" +import { RoomsContainerSkeleton } from "@/components/HotelReservation/SelectRate/RoomsContainer/RoomsContainerSkeleton" + +// Select Rate loading doesn't need a layout and wrapper +// to force loading.tsx to show again since refetch of +// availability happens client-side and only the RoomCards +// display a loading state since we already have the hotel +// data +export default function LoadingSelectRate() { + return ( + <> + + + + ) +} diff --git a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx index 4736130f7..41bdbf733 100644 --- a/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx +++ b/apps/scandic-web/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx @@ -1,12 +1,8 @@ -import stringify from "json-stable-stringify-without-jsonify" import { notFound } from "next/navigation" -import { Suspense } from "react" import { combineRegExps, rateTypeRegex, REDEMPTION } from "@/constants/booking" import SelectRate from "@/components/HotelReservation/SelectRate" -import { HotelInfoCardSkeleton } from "@/components/HotelReservation/SelectRate/HotelInfoCard" -import { RoomsContainerSkeleton } from "@/components/HotelReservation/SelectRate/RoomsContainer/RoomsContainerSkeleton" import { convertSearchParamsToObj } from "@/utils/url" import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate" @@ -21,7 +17,6 @@ export default async function SelectRatePage({ params, searchParams, }: PageArgs) { - const suspenseKey = stringify(searchParams) const booking = convertSearchParamsToObj(searchParams) const isMultiRoom = booking.rooms.length > 1 @@ -40,17 +35,5 @@ export default async function SelectRatePage({ delete searchParams.bookingCode } - return ( - - - - - } - > - - - ) + return } diff --git a/apps/scandic-web/app/[lang]/(live)/@bookingwidget/hotelreservation/[...paths]/loading.tsx b/apps/scandic-web/app/[lang]/(live)/@bookingwidget/hotelreservation/[...paths]/loading.tsx new file mode 100644 index 000000000..e49aa6721 --- /dev/null +++ b/apps/scandic-web/app/[lang]/(live)/@bookingwidget/hotelreservation/[...paths]/loading.tsx @@ -0,0 +1,11 @@ +import { BookingWidgetSkeleton } from "@/components/BookingWidget/Client" + +// This file is crucial for displaying a loading +// state immediately in the booking flow. +// Next doesn't recognize manually added Suspense +// boundaries during page navigation (Server->Client) +// thus making it seem as the page is frozen during +// the time it takes for `BookingWidget` to resolve. +export default function BookingWidgetLoading() { + return +} diff --git a/apps/scandic-web/components/BookingWidget/Client.tsx b/apps/scandic-web/components/BookingWidget/Client.tsx index 9c6383c61..b7c83a723 100644 --- a/apps/scandic-web/components/BookingWidget/Client.tsx +++ b/apps/scandic-web/components/BookingWidget/Client.tsx @@ -186,14 +186,6 @@ export default function BookingWidgetClient({ } }, [methods, selectedBookingCode]) - useEffect(() => { - if (!selectedLocation) { - return - } - - methods.setValue("search", selectedLocation.name) - }, [selectedLocation, methods]) - if (shouldShowSkeleton) { return } diff --git a/apps/scandic-web/components/ChildrenWrapper.tsx b/apps/scandic-web/components/ChildrenWrapper.tsx new file mode 100644 index 000000000..33cd01c13 --- /dev/null +++ b/apps/scandic-web/components/ChildrenWrapper.tsx @@ -0,0 +1,11 @@ +"use client" +import { useSearchParams } from "next/navigation" +import { Fragment } from "react" + +// Solution derived from leerobs example +// https://github.com/vercel/next.js/issues/53543#issuecomment-2327883526 +// Ensure children are re-rendered when the search query changes +export default function ChildrenWrapper({ children }: React.PropsWithChildren) { + const searchParams = useSearchParams() + return {children} +} diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/helpers.ts b/apps/scandic-web/components/HotelReservation/SelectHotel/helpers.ts index 55859ca9b..c990fc21e 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/helpers.ts +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/helpers.ts @@ -11,7 +11,10 @@ import type { } from "@/types/components/hotelReservation/selectHotel/availabilityInput" import type { CategorizedFilters } from "@/types/components/hotelReservation/selectHotel/hotelFilters" import { AvailabilityEnum } from "@/types/components/hotelReservation/selectHotel/selectHotel" -import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams" +import type { + AlternativeHotelsSearchParams, + SelectHotelSearchParams, +} from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams" import type { AdditionalData, DetailedFacility, Hotel } from "@/types/hotel" import type { HotelsAvailabilityItem } from "@/types/trpc/routers/hotel/availability" import type { @@ -155,7 +158,7 @@ function sortAndFilterHotelsByAvailability( } export async function getHotels( - booking: SelectHotelSearchParams, + booking: SelectHotelSearchParams | AlternativeHotelsSearchParams, isAlternativeFor: HotelLocation | null, bookingCode: string | undefined, city: Location, diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx b/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx index 40d084c62..4fcc454e2 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx @@ -1,163 +1,82 @@ -import stringify from "json-stable-stringify-without-jsonify" -import { cookies } from "next/headers" -import { notFound } from "next/navigation" -import { Suspense } from "react" - import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" -import { FamilyAndFriendsCodes } from "@/constants/booking" -import { - alternativeHotelsMap, - selectHotelMap, -} from "@/constants/routes/hotelReservation" - +import HotelCardListing from "@/components/HotelReservation/HotelCardListing" +import BookingCodeFilter from "@/components/HotelReservation/SelectHotel/BookingCodeFilter" +import HotelCount from "@/components/HotelReservation/SelectHotel/HotelCount" +import HotelFilter from "@/components/HotelReservation/SelectHotel/HotelFilter" +import HotelSorter from "@/components/HotelReservation/SelectHotel/HotelSorter" +import MobileMapButtonContainer from "@/components/HotelReservation/SelectHotel/MobileMapButtonContainer" +import NoAvailabilityAlert from "@/components/HotelReservation/SelectHotel/NoAvailabilityAlert" import StaticMap from "@/components/Maps/StaticMap" import Link from "@/components/TempDesignSystem/Link" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import TrackingSDK from "@/components/TrackingSDK" import { getIntl } from "@/i18n" -import { getHotelSearchDetails } from "@/utils/hotelSearchDetails" -import FnFNotAllowedAlert from "../FnFNotAllowedAlert/FnFNotAllowedAlert" -import HotelCardListing from "../HotelCardListing" -import BookingCodeFilter from "./BookingCodeFilter" -import { getFiltersFromHotels, getHotels } from "./helpers" -import HotelCount from "./HotelCount" -import HotelFilter from "./HotelFilter" -import HotelSorter from "./HotelSorter" -import MobileMapButtonContainer from "./MobileMapButtonContainer" -import NoAvailabilityAlert from "./NoAvailabilityAlert" -import { getTracking } from "./tracking" +import { getFiltersFromHotels, type HotelResponse } from "./helpers" import styles from "./selectHotel.module.css" -import type { SelectHotelProps } from "@/types/components/hotelReservation/selectHotel/selectHotel" -import type { SelectHotelSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams" +import type { Location } from "@/types/trpc/routers/hotel/locations" + +interface SelectHotelProps { + isAlternative?: boolean + bookingCode?: string + city: Location + hotels: HotelResponse[] + mapHref: string + title: string +} export default async function SelectHotel({ - params, - searchParams, - isAlternativeHotels, + bookingCode, + city, + hotels, + isAlternative = false, + mapHref, + title, }: SelectHotelProps) { const intl = await getIntl() - const searchDetails = await getHotelSearchDetails( - { - searchParams: searchParams as SelectHotelSearchParams & { - [key: string]: string - }, - }, - isAlternativeHotels - ) - - if (!searchDetails) return notFound() - - const { - adultsInRoom, - bookingCode, - childrenInRoom, - city, - hotel: isAlternativeFor, - noOfRooms, - redemption, - selectHotelParams, - } = searchDetails - - if (!city) return notFound() - - if (bookingCode && FamilyAndFriendsCodes.includes(bookingCode)) { - const cookieStore = cookies() - const isInValidFNF = cookieStore.get("sc")?.value !== "1" - - if (isInValidFNF) { - return - } - } - - const hotels = await getHotels( - selectHotelParams, - isAlternativeFor, - bookingCode, - city, - !!redemption - ) - - const arrivalDate = new Date(selectHotelParams.fromDate) - const departureDate = new Date(selectHotelParams.toDate) - + const isAllUnavailable = !hotels.length const isCityWithCountry = (city: any): city is { country: string } => "country" in city - const filterList = getFiltersFromHotels(hotels) - const isAllUnavailable = !hotels.length - const isRedemptionAvailability = redemption + const isBookingCodeRateAvailable = bookingCode ? hotels.some( - (hotel) => hotel.availability.productType?.redemptions?.length - ) + (hotel) => + hotel.availability.bookingCode && + hotel.availability.status === "Available" + ) : false - const suspenseKey = stringify(searchParams) - const isFullPriceHotelAvailable = bookingCode ? hotels?.some( - (hotel) => - !hotel.availability.bookingCode && - hotel.availability.status === "Available" - ) + (hotel) => + !hotel.availability.bookingCode && + hotel.availability.status === "Available" + ) : false - const isBookingCodeRateAvailable = bookingCode - ? hotels?.some( - (hotel) => - hotel.availability.bookingCode && - hotel.availability.status === "Available" - ) - : false - - const { hotelsTrackingData, pageTrackingData } = getTracking( - params.lang, - !!isAlternativeFor, - arrivalDate, - departureDate, - adultsInRoom, - childrenInRoom, - hotels?.length ?? 0, - selectHotelParams.hotelId, - noOfRooms, - hotels?.[0]?.hotel.address.country, - hotels?.[0]?.hotel.address.city, - selectHotelParams.city, - bookingCode, - isBookingCodeRateAvailable ? "true" : "false", - redemption, - isRedemptionAvailability - ) - // Special rates (corporate cheque, voucher and reward nights) will not have regular rate hotels availability - const isSpecialRate = hotels?.some( + const isSpecialRate = hotels.some( (hotel) => hotel.availability.productType?.bonusCheque || hotel.availability.productType?.voucher || hotel.availability.productType?.redemptions ) + + const filterList = getFiltersFromHotels(hotels) + + const showBookingCodeFilter = + isBookingCodeRateAvailable && isFullPriceHotelAvailable && !isSpecialRate + return ( <>
- - {isAlternativeFor - ? intl.formatMessage( - { - defaultMessage: "Alternatives for {value}", - }, - { - value: isAlternativeFor.name, - } - ) - : city.name} - + {title}
@@ -168,21 +87,13 @@ export default async function SelectHotel({
- {isBookingCodeRateAvailable && - isFullPriceHotelAvailable && - !isSpecialRate ? ( - - ) : null} + {showBookingCodeFilter ? : null}
{hotels.length ? (
@@ -224,7 +135,7 @@ export default async function SelectHotel({
- - - ) } diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/selectHotel.module.css b/apps/scandic-web/components/HotelReservation/SelectHotel/selectHotel.module.css index 1a6a825e6..27c85f3f9 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/selectHotel.module.css +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/selectHotel.module.css @@ -86,6 +86,7 @@ .headerContent { display: block; } + .header { background-color: var(--Base-Surface-Subtle-Normal); padding: var(--Spacing-x4) 0 var(--Spacing-x3); @@ -107,9 +108,11 @@ .sideBar { max-width: 340px; } + .sideBarItem { display: block; } + .filter { display: block; } @@ -118,6 +121,7 @@ display: flex; margin-bottom: var(--Space-x6); } + .mapContainer { display: flex; flex-direction: column; @@ -125,13 +129,16 @@ border-radius: var(--Corner-radius-md); border: 1px solid var(--Base-Border-Subtle); } + .buttonContainer { display: none; } + .skeletonContainer .title { margin-bottom: 0; } + .skeletonContainer .sideBar { gap: var(--Spacing-x3); } -} +} \ No newline at end of file diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/tracking.ts b/apps/scandic-web/components/HotelReservation/SelectHotel/tracking.ts index e3714a227..3ba88ae33 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/tracking.ts +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/tracking.ts @@ -23,9 +23,9 @@ export function getTracking( hotelCity: string | undefined, paramCity: string | undefined, bookingCode?: string, - isBookingCodeRateAvailable?: string, + isBookingCodeRateAvailable = false, isRedemption?: boolean, - isRedemptionAvailable?: boolean + isRedemptionAvailable = false ) { const pageTrackingData: TrackingSDKPageData = { channel: TrackingChannelEnum["hotelreservation"], @@ -63,10 +63,10 @@ export function getTracking( searchType: "destination", bookingCode: bookingCode ?? "n/a", bookingCodeAvailability: bookingCode - ? isBookingCodeRateAvailable + ? isBookingCodeRateAvailable.toString() : undefined, rewardNight: isRedemption ? "yes" : "no", - rewardNightAvailability: isRedemptionAvailable ? "true" : "false", + rewardNightAvailability: isRedemptionAvailable.toString(), } return {