feat(SW-1012): Added possibility for multiple include params for hotels
This commit is contained in:
committed by
Fredrik Thorsson
parent
92bbfcf533
commit
05006506f0
@@ -0,0 +1 @@
|
||||
export default function RestaurantSidepeek() {}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { restaurantAndBar } from "@/constants/routes/hotelPageParams"
|
||||
|
||||
import SidePeek from "@/components/TempDesignSystem/SidePeek"
|
||||
import { getIntl } from "@/i18n"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
import styles from "./restaurantBar.module.css"
|
||||
|
||||
import type { RestaurantBarSidePeekProps } from "@/types/components/hotelPage/sidepeek/restaurantBar"
|
||||
|
||||
export default async function RestaurantBarSidePeek({
|
||||
restaurants,
|
||||
}: RestaurantBarSidePeekProps) {
|
||||
const lang = getLang()
|
||||
|
||||
const intl = await getIntl()
|
||||
|
||||
return (
|
||||
<SidePeek
|
||||
contentKey={restaurantAndBar[lang]}
|
||||
title={intl.formatMessage({ id: "Restaurant & Bar" })}
|
||||
>
|
||||
<div className={styles.content}>
|
||||
{restaurants.map((restaurant) => (
|
||||
<div key={restaurant.id}>
|
||||
<h3>{restaurant.name}</h3>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</SidePeek>
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import { notFound } from "next/navigation"
|
||||
import { Suspense } from "react"
|
||||
|
||||
import { restaurantAndBar } from "@/constants/routes/hotelPageParams"
|
||||
import { env } from "@/env/server"
|
||||
import { getHotelData, getHotelPage } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
@@ -21,6 +20,7 @@ import MapCard from "./Map/MapCard"
|
||||
import MapWithCardWrapper from "./Map/MapWithCard"
|
||||
import MobileMapToggle from "./Map/MobileMapToggle"
|
||||
import StaticMap from "./Map/StaticMap"
|
||||
import RestaurantBarSidePeek from "./SidePeeks/RestaurantBar"
|
||||
import AmenitiesList from "./AmenitiesList"
|
||||
import Facilities from "./Facilities"
|
||||
import IntroSection from "./IntroSection"
|
||||
@@ -78,8 +78,8 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
|
||||
ratings,
|
||||
parking,
|
||||
} = hotelData.data.attributes
|
||||
const roomCategories =
|
||||
hotelData.included?.filter((item) => item.type === "roomcategories") || []
|
||||
const roomCategories = hotelData.included?.rooms || []
|
||||
const restaurants = hotelData.included?.restaurants || []
|
||||
const images = gallery?.smallerImages
|
||||
const description = hotelContent.texts.descriptions.medium
|
||||
const activitiesCard = content?.[0]?.upcoming_activities_card || null
|
||||
@@ -197,14 +197,8 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
|
||||
ecoLabels={hotelFacts.ecoLabels}
|
||||
descriptions={hotelContent.texts}
|
||||
/>
|
||||
<SidePeek
|
||||
contentKey={restaurantAndBar[lang]}
|
||||
title={intl.formatMessage({ id: "Restaurant & Bar" })}
|
||||
>
|
||||
{/* TODO */}
|
||||
Restaurant & Bar
|
||||
</SidePeek>
|
||||
<WellnessAndExerciseSidePeek healthFacilities={healthFacilities} />
|
||||
<RestaurantBarSidePeek restaurants={restaurants} />
|
||||
{activitiesCard && (
|
||||
<ActivitiesSidePeek contentPage={activitiesCard.contentPage} />
|
||||
)}
|
||||
|
||||
@@ -95,7 +95,7 @@ export async function RoomsContainer({
|
||||
user={user}
|
||||
availablePackages={packages ?? []}
|
||||
roomsAvailability={roomsAvailability}
|
||||
roomCategories={hotelData?.included ?? []}
|
||||
roomCategories={hotelData?.included?.rooms ?? []}
|
||||
hotelType={hotelData?.data.attributes?.hotelType}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ export default function HotelReservationSidePeek({
|
||||
}
|
||||
)
|
||||
|
||||
const selectedRoom = hotelData?.included?.find((room) =>
|
||||
const selectedRoom = hotelData?.included?.rooms?.find((room) =>
|
||||
room.roomTypes.some((type) => type.code === roomTypeCode)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user