feat(sw-453): implemented filter from packages
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
.page {
|
||||
min-height: 100dvh;
|
||||
padding-top: var(--Spacing-x6);
|
||||
padding-left: var(--Spacing-x2);
|
||||
padding-right: var(--Spacing-x2);
|
||||
background-color: var(--Scandic-Brand-Warm-White);
|
||||
}
|
||||
|
||||
.content {
|
||||
max-width: var(--max-width);
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--Spacing-x7);
|
||||
padding: var(--Spacing-x2);
|
||||
}
|
||||
|
||||
.main {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.summary {
|
||||
max-width: 340px;
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
import { getProfileSafely } from "@/lib/trpc/memoizedRequests"
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
import { RoomPackageCode } from "@/server/routers/hotels/schemas/packages"
|
||||
|
||||
import HotelInfoCard from "@/components/HotelReservation/SelectRate/HotelInfoCard"
|
||||
import RoomFilter from "@/components/HotelReservation/SelectRate/RoomFilter"
|
||||
import RoomSelection from "@/components/HotelReservation/SelectRate/RoomSelection"
|
||||
import Rooms from "@/components/HotelReservation/SelectRate/Rooms"
|
||||
import getHotelReservationQueryParams from "@/components/HotelReservation/SelectRate/RoomSelection/utils"
|
||||
import { setLang } from "@/i18n/serverContext"
|
||||
|
||||
import styles from "./page.module.css"
|
||||
|
||||
import { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
@@ -24,7 +22,7 @@ export default async function SelectRatePage({
|
||||
const adults = selectRoomParamsObject.room?.[0].adults // TODO: Handle multiple rooms
|
||||
const children = selectRoomParamsObject.room?.[0].child?.length // TODO: Handle multiple rooms
|
||||
|
||||
const [hotelData, roomsAvailability, user] = await Promise.all([
|
||||
const [hotelData, roomsAvailability, packages, user] = await Promise.all([
|
||||
serverClient().hotel.hotelData.get({
|
||||
hotelId: searchParams.hotel,
|
||||
language: params.lang,
|
||||
@@ -37,6 +35,18 @@ export default async function SelectRatePage({
|
||||
adults,
|
||||
children,
|
||||
}),
|
||||
serverClient().hotel.packages.get({
|
||||
hotelId: searchParams.hotel,
|
||||
startDate: searchParams.fromDate,
|
||||
endDate: searchParams.toDate,
|
||||
adults: adults,
|
||||
children: children,
|
||||
packageCodes: [
|
||||
RoomPackageCode.ACCE,
|
||||
RoomPackageCode.PETR,
|
||||
RoomPackageCode.ALLG,
|
||||
],
|
||||
}),
|
||||
getProfileSafely(),
|
||||
])
|
||||
|
||||
@@ -51,20 +61,14 @@ export default async function SelectRatePage({
|
||||
const roomCategories = hotelData?.included
|
||||
|
||||
return (
|
||||
<div>
|
||||
<>
|
||||
<HotelInfoCard hotelData={hotelData} />
|
||||
<div className={styles.content}>
|
||||
<div className={styles.main}>
|
||||
<RoomFilter
|
||||
numberOfRooms={roomsAvailability.roomConfigurations.length}
|
||||
/>
|
||||
<RoomSelection
|
||||
roomsAvailability={roomsAvailability}
|
||||
roomCategories={roomCategories ?? []}
|
||||
user={user}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Rooms
|
||||
roomsAvailability={roomsAvailability}
|
||||
roomCategories={roomCategories ?? []}
|
||||
user={user}
|
||||
packages={packages ?? []}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user