diff --git a/.env.test b/.env.test index 457ac6e2e..0a246a8f7 100644 --- a/.env.test +++ b/.env.test @@ -54,4 +54,5 @@ ENABLE_BOOKING_WIDGET_HOTELRESERVATION_PATH="false" SHOW_SITE_WIDE_ALERT="false" NEXT_PUBLIC_SENTRY_ENVIRONMENT="test" -NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE="0" \ No newline at end of file +NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE="0" +SITEMAP_SYNC_SECRET="test \ No newline at end of file diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/@sidePeek/[...paths]/loading.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/@sidePeek/[...paths]/loading.tsx deleted file mode 100644 index 67515d4f5..000000000 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/@sidePeek/[...paths]/loading.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import LoadingSpinner from "@/components/LoadingSpinner" - -export default function LoadingHotelSidePeek() { - return -} diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/@sidePeek/[...paths]/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/@sidePeek/[...paths]/page.tsx deleted file mode 100644 index 933780e59..000000000 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/@sidePeek/[...paths]/page.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { getHotel } from "@/lib/trpc/memoizedRequests" - -import SidePeek from "@/components/HotelReservation/SidePeek" - -import type { LangParams, PageArgs } from "@/types/params" - -export default async function HotelSidePeek({ - params, - searchParams, -}: PageArgs) { - if (!searchParams.hotel) { - return - } - - const hotel = await getHotel({ - hotelId: searchParams.hotel, - language: params.lang, - isCardOnlyPayment: false, - }) - - return -} diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/@sidePeek/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/@sidePeek/page.tsx deleted file mode 100644 index 438f146ae..000000000 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/@sidePeek/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function HotelSidePeekSlot() { - return null -} diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx index 9a2755a3e..2db943cea 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/layout.tsx @@ -1,17 +1,16 @@ +import SidePeek from "@/components/HotelReservation/SidePeek" + import styles from "./layout.module.css" import type { LangParams, LayoutArgs } from "@/types/params" export default function HotelReservationLayout({ children, - sidePeek, -}: React.PropsWithChildren> & { - sidePeek: React.ReactNode -}) { +}: React.PropsWithChildren>) { return (
{children} - {sidePeek} +
) } diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx index f1941fbea..15be827ea 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx @@ -1,32 +1,12 @@ -import { differenceInCalendarDays, format, isWeekend } from "date-fns" import stringify from "json-stable-stringify-without-jsonify" -import { notFound } from "next/navigation" import { Suspense } from "react" -import { getHotel } from "@/lib/trpc/memoizedRequests" - -import HotelInfoCard, { - HotelInfoCardSkeleton, -} from "@/components/HotelReservation/SelectRate/HotelInfoCard" -import { - preload, - RoomsContainer, -} from "@/components/HotelReservation/SelectRate/RoomsContainer" +import SelectRate from "@/components/HotelReservation/SelectRate" +import { HotelInfoCardSkeleton } from "@/components/HotelReservation/SelectRate/HotelInfoCard" import { RoomsContainerSkeleton } from "@/components/HotelReservation/SelectRate/RoomsContainer/RoomsContainerSkeleton" -import TrackingSDK from "@/components/TrackingSDK" import { setLang } from "@/i18n/serverContext" -import { convertSearchParamsToObj } from "@/utils/url" -import { getHotelSearchDetails } from "../utils" -import { getValidDates } from "./getValidDates" - -import { ChildBedMapEnum } from "@/types/components/bookingWidget/enums" import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate" -import { - TrackingChannelEnum, - type TrackingSDKHotelInfo, - type TrackingSDKPageData, -} from "@/types/components/tracking" import type { LangParams, PageArgs } from "@/types/params" export default async function SelectRatePage({ @@ -34,93 +14,20 @@ export default async function SelectRatePage({ searchParams, }: PageArgs) { setLang(params.lang) - const searchDetails = await getHotelSearchDetails({ searchParams }) - if (!searchDetails?.hotel) { - return notFound() - } - const { hotel, adultsInRoom, childrenInRoom, selectHotelParams } = - searchDetails - const { fromDate, toDate } = getValidDates( - selectHotelParams.fromDate, - selectHotelParams.toDate - ) - - preload( - hotel.id, - params.lang, - fromDate.format("YYYY-MM-DD"), - toDate.format("YYYY-MM-DD"), - adultsInRoom, - childrenInRoom - ) - - const hotelData = await getHotel({ - hotelId: hotel.id, - isCardOnlyPayment: false, - language: params.lang, - }) - - const arrivalDate = fromDate.toDate() - const departureDate = toDate.toDate() - - const pageTrackingData: TrackingSDKPageData = { - pageId: "select-rate", - domainLanguage: params.lang, - channel: TrackingChannelEnum["hotelreservation"], - pageName: "hotelreservation|select-rate", - siteSections: "hotelreservation|select-rate", - pageType: "bookingroomsandratespage", - siteVersion: "new-web", - } - - const hotelsTrackingData: TrackingSDKHotelInfo = { - searchTerm: selectHotelParams.city ?? hotel?.name, - arrivalDate: format(arrivalDate, "yyyy-MM-dd"), - departureDate: format(departureDate, "yyyy-MM-dd"), - noOfAdults: adultsInRoom[0], // TODO: Handle multiple rooms - noOfChildren: childrenInRoom?.length, - ageOfChildren: childrenInRoom?.map((c) => c.age).join(","), - childBedPreference: childrenInRoom - ?.map((c) => ChildBedMapEnum[c.bed]) - .join("|"), - noOfRooms: 1, // // TODO: Handle multiple rooms - duration: differenceInCalendarDays(departureDate, arrivalDate), - leadTime: differenceInCalendarDays(arrivalDate, new Date()), - searchType: "hotel", - bookingTypeofDay: isWeekend(arrivalDate) ? "weekend" : "weekday", - country: hotelData?.hotel.address.country, - hotelID: hotel?.id, - region: hotelData?.hotel.address.city, - } - - const hotelId = +hotel.id - - const booking = convertSearchParamsToObj(searchParams) const suspenseKey = stringify(searchParams) - return ( - <> - }> - - - }> - - - - - - + return ( + + + + + } + > + + ) } diff --git a/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/@sidePeek/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/@sidePeek/page.tsx deleted file mode 100644 index 933780e59..000000000 --- a/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/@sidePeek/page.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { getHotel } from "@/lib/trpc/memoizedRequests" - -import SidePeek from "@/components/HotelReservation/SidePeek" - -import type { LangParams, PageArgs } from "@/types/params" - -export default async function HotelSidePeek({ - params, - searchParams, -}: PageArgs) { - if (!searchParams.hotel) { - return - } - - const hotel = await getHotel({ - hotelId: searchParams.hotel, - language: params.lang, - isCardOnlyPayment: false, - }) - - return -} diff --git a/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/layout.tsx b/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/layout.tsx index 51fd48cb2..c7bc50ba5 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/layout.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/my-stay/[refId]/layout.tsx @@ -1,15 +1,14 @@ +import SidePeek from "@/components/HotelReservation/SidePeek" + import type { LangParams, LayoutArgs } from "@/types/params" export default function HotelReservationLayout({ children, - sidePeek, -}: React.PropsWithChildren> & { - sidePeek: React.ReactNode -}) { +}: React.PropsWithChildren>) { return (
{children} - {sidePeek} +
) } diff --git a/app/[lang]/(live)/@footer/[...path]/page.tsx b/app/[lang]/(live)/@footer/[...path]/page.tsx deleted file mode 100644 index 03a82e5f5..000000000 --- a/app/[lang]/(live)/@footer/[...path]/page.tsx +++ /dev/null @@ -1 +0,0 @@ -export { default } from "../page" diff --git a/app/[lang]/(live)/@footer/loading.tsx b/app/[lang]/(live)/@footer/loading.tsx deleted file mode 100644 index 9078cc122..000000000 --- a/app/[lang]/(live)/@footer/loading.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { env } from "@/env/server" - -import CurrentLoadingSpinner from "@/components/Current/LoadingSpinner" -import { FooterDetailsSkeleton } from "@/components/Footer/Details" -import { FooterNavigationSkeleton } from "@/components/Footer/Navigation" - -export default function LoadingFooter() { - if (env.HIDE_FOR_NEXT_RELEASE) { - return - } - return ( -
- - -
- ) -} diff --git a/app/[lang]/(live)/@footer/page.tsx b/app/[lang]/(live)/@footer/page.tsx deleted file mode 100644 index 90fc74d02..000000000 --- a/app/[lang]/(live)/@footer/page.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { env } from "@/env/server" - -import CurrentFooter from "@/components/Current/Footer" -import Footer, { preload } from "@/components/Footer" -import { setLang } from "@/i18n/serverContext" - -import type { LangParams, PageArgs } from "@/types/params" - -export default function FooterSlot({ params }: PageArgs) { - setLang(params.lang) - - if (env.HIDE_FOR_NEXT_RELEASE) { - return - } - - preload() - - return