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 5682773c3..7557a4b59 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx @@ -4,9 +4,9 @@ import { Suspense } from "react" import { dt } from "@/lib/dt" import { getHotelData, getLocations } from "@/lib/trpc/memoizedRequests" -import LoadingSpinner from "@/components/Current/LoadingSpinner" import HotelInfoCard from "@/components/HotelReservation/SelectRate/HotelInfoCard" import { RoomsContainer } from "@/components/HotelReservation/SelectRate/Rooms/RoomsContainer" +import { RoomsContainerSkeleton } from "@/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton" import { getHotelReservationQueryParams } from "@/components/HotelReservation/SelectRate/RoomSelection/utils" import { setLang } from "@/i18n/serverContext" import { safeTry } from "@/utils/safeTry" @@ -71,7 +71,8 @@ export default async function SelectRatePage({ adultCount={adults} childArray={children ?? []} /> - }> + + }> state.noRoomsAvailable - // ) - // const setNoRoomsAvailable = useRoomAvailableStore( - // (state) => state.setNoRoomsAvailable - // ) - const sortedFacilities = hotelAttributes?.detailedFacilities .sort((a, b) => b.sortOrder - a.sortOrder) .slice(0, 5) - // useEffect(() => { - // if (noAvailability) { - // setNoRoomsAvailable() - // } - // }, [noAvailability, setNoRoomsAvailable]) - return (
{hotelAttributes && ( diff --git a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/RoomCardSkeleton.module.css b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/RoomCardSkeleton.module.css new file mode 100644 index 000000000..d5c618625 --- /dev/null +++ b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/RoomCardSkeleton.module.css @@ -0,0 +1,26 @@ +.card { + font-size: 14px; + display: flex; + flex-direction: column; + background-color: #fff; + border-radius: var(--Corner-radius-Large); + border: 1px solid var(--Base-Border-Subtle); + position: relative; + height: 100%; + justify-content: space-between; + min-height: 200px; + flex: 1; + overflow: hidden; +} + +.imageContainer { + aspect-ratio: 16/9; + width: 100%; +} + +.priceVariants { + display: flex; + flex-direction: column; + gap: var(--Spacing-x1); + padding: var(--Spacing-x2); +} diff --git a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/RoomCardSkeleton.tsx b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/RoomCardSkeleton.tsx new file mode 100644 index 000000000..0e032ed1c --- /dev/null +++ b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/RoomCardSkeleton.tsx @@ -0,0 +1,21 @@ +import SkeletonShimmer from "@/components/SkeletonShimmer" + +import styles from "./RoomCardSkeleton.module.css" + +export function RoomCardSkeleton() { + return ( +
+ {/* image container */} +
+ +
+ +
+ {/* price variants */} + {Array.from({ length: 3 }).map((_, index) => ( + + ))} +
+
+ ) +} diff --git a/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton.module.css b/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton.module.css new file mode 100644 index 000000000..7f7d28860 --- /dev/null +++ b/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton.module.css @@ -0,0 +1,21 @@ +.container { + padding: var(--Spacing-x2); +} + +.filterContainer { + height: 38px; +} + +.skeletonContainer { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); + /* used to hide overflowing rows */ + grid-template-rows: auto; + grid-auto-rows: 0; + overflow: hidden; + + flex-wrap: wrap; + justify-content: space-between; + margin-top: 20px; + gap: var(--Spacing-x2); +} diff --git a/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton.tsx b/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton.tsx new file mode 100644 index 000000000..7731ff375 --- /dev/null +++ b/components/HotelReservation/SelectRate/Rooms/RoomsContainerSkeleton.tsx @@ -0,0 +1,24 @@ +import Body from "@/components/TempDesignSystem/Text/Body" +import { getIntl } from "@/i18n" + +import { RoomCardSkeleton } from "../RoomSelection/RoomCard/RoomCardSkeleton" + +import styles from "./RoomsContainerSkeleton.module.css" + +type Props = { + count?: number +} + +export async function RoomsContainerSkeleton({ count = 4 }: Props) { + const intl = await getIntl() + return ( +
+
+
+ {Array.from({ length: count }).map((_, index) => ( + + ))} +
+
+ ) +} diff --git a/server/routers/contentstack/base/utils.ts b/server/routers/contentstack/base/utils.ts index 27ec2304f..daf4575a0 100644 --- a/server/routers/contentstack/base/utils.ts +++ b/server/routers/contentstack/base/utils.ts @@ -82,6 +82,8 @@ export function getSiteConfigConnections(refs: GetSiteConfigRefData) { const siteConfigData = refs.all_site_config.items[0] const connections: System["system"][] = [] + if (!siteConfigData) return connections + const alertConnection = siteConfigData.sitewide_alert.alertConnection alertConnection.edges.forEach(({ node }) => { diff --git a/stores/roomAvailability.ts b/stores/roomAvailability.ts deleted file mode 100644 index ad01453e4..000000000 --- a/stores/roomAvailability.ts +++ /dev/null @@ -1,17 +0,0 @@ -"use client" - -import { create } from "zustand" - -interface RoomAvailabilityState { - noRoomsAvailable: boolean - setNoRoomsAvailable: () => void - setRoomsAvailable: () => void -} - -const useRoomAvailableStore = create((set) => ({ - noRoomsAvailable: false, - setNoRoomsAvailable: () => set(() => ({ noRoomsAvailable: true })), - setRoomsAvailable: () => set(() => ({ noRoomsAvailable: false })), -})) - -export default useRoomAvailableStore