diff --git a/components/ContentType/DestinationPage/CityListing/CityListingItem/CityListingItemSkeleton.tsx b/components/ContentType/DestinationPage/CityListing/CityListingItem/CityListingItemSkeleton.tsx new file mode 100644 index 000000000..fdc4bee8a --- /dev/null +++ b/components/ContentType/DestinationPage/CityListing/CityListingItem/CityListingItemSkeleton.tsx @@ -0,0 +1,32 @@ +import SkeletonShimmer from "@/components/SkeletonShimmer" +import Divider from "@/components/TempDesignSystem/Divider" + +import ExperienceListSkeleton from "../../ExperienceList/ExperienceListSkeleton" + +import styles from "./cityListingItem.module.css" + +export default async function CityListingItemSkeleton() { + return ( +
+
+ +
+
+ + +
+ + + + +
+ + + +
+ +
+
+
+ ) +} diff --git a/components/ContentType/DestinationPage/CityListing/CityListingSkeleton.tsx b/components/ContentType/DestinationPage/CityListing/CityListingSkeleton.tsx new file mode 100644 index 000000000..c1aa68a69 --- /dev/null +++ b/components/ContentType/DestinationPage/CityListing/CityListingSkeleton.tsx @@ -0,0 +1,20 @@ +import SkeletonShimmer from "@/components/SkeletonShimmer" + +import CityListingItemSkeleton from "./CityListingItem/CityListingItemSkeleton" + +import styles from "./cityListing.module.css" + +export default async function CityListingSkeleton() { + return ( +
+
+ +
+ +
+ ) +} diff --git a/components/ContentType/DestinationPage/CityListing/index.tsx b/components/ContentType/DestinationPage/CityListing/index.tsx index 6eda28805..9ad557f8f 100644 --- a/components/ContentType/DestinationPage/CityListing/index.tsx +++ b/components/ContentType/DestinationPage/CityListing/index.tsx @@ -1,3 +1,5 @@ +import { getDestinationCityPagesByCountry } from "@/lib/trpc/memoizedRequests" + import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { getIntl } from "@/i18n" @@ -5,18 +7,23 @@ import CityListingItem from "./CityListingItem" import styles from "./cityListing.module.css" -import type { DestinationCityListItem } from "@/types/trpc/routers/contentstack/destinationCityPage" +import type { Country } from "@/types/enums/country" interface CityListingProps { - cities: DestinationCityListItem[] + country: Country } -export default async function CityListing({ cities }: CityListingProps) { +export default async function CityListing({ country }: CityListingProps) { const intl = await getIntl() + const cities = await getDestinationCityPagesByCountry(country) + + if (!cities.length) { + return null + } return (
-
+
{intl.formatMessage( { diff --git a/components/ContentType/DestinationPage/DestinationCityPage/index.tsx b/components/ContentType/DestinationPage/DestinationCityPage/index.tsx index 7aa6fccac..38b1604d2 100644 --- a/components/ContentType/DestinationPage/DestinationCityPage/index.tsx +++ b/components/ContentType/DestinationPage/DestinationCityPage/index.tsx @@ -11,6 +11,7 @@ import TrackingSDK from "@/components/TrackingSDK" import ExperienceList from "../ExperienceList" import HotelListing from "../HotelListing" +import HotelListingSkeleton from "../HotelListing/HotelListingSkeleton" import SidebarContentWrapper from "../SidebarContentWrapper" import DestinationPageSidePeek from "../Sidepeek" import StaticMap from "../StaticMap" @@ -27,7 +28,7 @@ export default async function DestinationCityPage() { return null } - const { tracking, destinationCityPage, hotels } = pageData + const { tracking, destinationCityPage, cityIdentifier } = pageData const { blocks, images, @@ -54,8 +55,9 @@ export default async function DestinationCityPage() { />
- - + }> + + {blocks && }