Merged in feature/select-rate-vertical-data-flow (pull request #2535)
Feature/select rate vertical data flow * add fix from SW-2666 * use translations for room packages * move types to it's own file * Merge branch 'master' of bitbucket.org:scandic-swap/web into feature/select-rate-vertical-data-flow * merge * feature/select-rate: double rate for campaing rates * revert NODE_ENV check in Cookiebot script * revert testing values * fix(SW-3171): fix all filter selected in price details * fix(SW-3166): multiroom anchoring when changing filter * fix(SW-3172): check hotelType, show correct breakfast message * Merge branch 'feature/select-rate-vertical-data-flow' of bitbucket.org:scandic-swap/web into feature/select-rate-vertical-data-flow * fix: show special needs icons for subsequent roomTypes SW-3167 * fix: Display strike through text when logged in SW-3168 * fix: Reinstate the scrollToView behaviour when selecting a rate SW-3169 * merge * . * PR fixes * fix: don't return notFound() * . * always include defaults for room packages * merge * merge * merge * Remove floating h1 for new select-rate Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import { cookies } from "next/headers"
|
||||
|
||||
import { FamilyAndFriendsCodes } from "@/constants/booking"
|
||||
|
||||
import { HotelInfoCard } from "@/components/HotelReservation/SelectRate2/HotelInfoCard"
|
||||
import { RoomsContainer } from "@/components/HotelReservation/SelectRate2/RoomsContainer"
|
||||
|
||||
import FnFNotAllowedAlert from "../FnFNotAllowedAlert/FnFNotAllowedAlert"
|
||||
import AvailabilityError from "./AvailabilityError"
|
||||
import Tracking from "./Tracking"
|
||||
|
||||
import type { RouterOutput } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import type { SelectRateBooking } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
|
||||
export default async function SelectRatePage({
|
||||
booking,
|
||||
hotelData,
|
||||
}: {
|
||||
hotelData: NonNullable<RouterOutput["hotel"]["get"]>
|
||||
booking: SelectRateBooking
|
||||
}) {
|
||||
const bookingCode = booking.bookingCode
|
||||
|
||||
let isInValidFNF = false
|
||||
if (bookingCode && FamilyAndFriendsCodes.includes(bookingCode)) {
|
||||
const cookieStore = await cookies()
|
||||
isInValidFNF = cookieStore.get("sc")?.value !== "1"
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<HotelInfoCard hotel={hotelData.hotel} booking={booking} />
|
||||
|
||||
{isInValidFNF ? (
|
||||
<FnFNotAllowedAlert />
|
||||
) : (
|
||||
<RoomsContainer
|
||||
hotelType={hotelData.hotel.hotelType}
|
||||
roomCategories={hotelData.roomCategories}
|
||||
vat={hotelData.hotel.vat}
|
||||
/>
|
||||
)}
|
||||
|
||||
<Tracking
|
||||
hotelId={hotelData.hotel.id}
|
||||
hotelName={hotelData.hotel.name}
|
||||
country={hotelData.hotel.address.country}
|
||||
city={hotelData.hotel.address.city}
|
||||
/>
|
||||
|
||||
<AvailabilityError />
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user