Merged in feat/refactor-select-rate (pull request #1402)
Select-rate: refactor - converted RoomsContainer into a client component * feat/select-rate - refactor and fixed duplicate key warning * Rooms as client component * Fixed lang in input * It works * Cleanup * Cleanup * PR fixes Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -10,11 +10,7 @@ import { getHotelSearchDetails } from "@/app/[lang]/(live)/(public)/hotelreserva
|
||||
import HotelInfoCard, {
|
||||
HotelInfoCardSkeleton,
|
||||
} from "@/components/HotelReservation/SelectRate/HotelInfoCard"
|
||||
import {
|
||||
preload,
|
||||
RoomsContainer,
|
||||
} from "@/components/HotelReservation/SelectRate/RoomsContainer"
|
||||
import { RoomsContainerSkeleton } from "@/components/HotelReservation/SelectRate/RoomsContainer/RoomsContainerSkeleton"
|
||||
import { RoomsContainer } from "@/components/HotelReservation/SelectRate/RoomsContainer"
|
||||
import TrackingSDK from "@/components/TrackingSDK"
|
||||
import { setLang } from "@/i18n/serverContext"
|
||||
import { convertSearchParamsToObj } from "@/utils/url"
|
||||
@@ -45,15 +41,6 @@ export default async function SelectRatePage({
|
||||
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,
|
||||
@@ -104,18 +91,17 @@ export default async function SelectRatePage({
|
||||
<HotelInfoCard hotelData={hotelData} />
|
||||
</Suspense>
|
||||
|
||||
<Suspense key={suspenseKey} fallback={<RoomsContainerSkeleton />}>
|
||||
<RoomsContainer
|
||||
adultArray={adultsInRoom}
|
||||
booking={booking}
|
||||
childArray={childrenInRoom}
|
||||
fromDate={arrivalDate}
|
||||
hotelId={hotelId}
|
||||
lang={params.lang}
|
||||
toDate={departureDate}
|
||||
/>
|
||||
</Suspense>
|
||||
<Suspense key={suspenseKey} fallback={null}>
|
||||
<RoomsContainer
|
||||
hotelData={hotelData}
|
||||
adultArray={adultsInRoom}
|
||||
booking={booking}
|
||||
childArray={childrenInRoom}
|
||||
fromDate={arrivalDate}
|
||||
hotelId={hotelId}
|
||||
toDate={departureDate}
|
||||
/>
|
||||
|
||||
<Suspense key={`${suspenseKey}-tracking`} fallback={null}>
|
||||
<TrackingSDK
|
||||
pageData={pageTrackingData}
|
||||
hotelInfo={hotelsTrackingData}
|
||||
|
||||
Reference in New Issue
Block a user