From e3b1bfc4141c5b35947a21d727e66ab31dd7e013 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Wed, 5 Feb 2025 13:10:28 +0000 Subject: [PATCH] Merged in feat/SW-1454-hotel-listing-city-page (pull request #1250) feat(SW-1454): added hotel listing * feat(SW-1454): added hotel listing Approved-by: Fredrik Thorsson --- .../DestinationPage/CityListing/index.tsx | 4 +- .../destinationCityPage.module.css | 4 +- .../DestinationCityPage/index.tsx | 12 +-- .../hotelListingItem.module.css | 54 ++++++++++ .../HotelListing/HotelListingItem/index.tsx | 101 ++++++++++++++++++ .../HotelListing/hotelListing.module.css | 32 ++++++ .../DestinationPage/HotelListing/index.tsx | 76 +++++++++++++ .../SelectHotelMapContent/index.tsx | 1 + .../ImageGallery/imageGallery.module.css | 2 + .../backToTopButton.module.css | 5 + .../BackToTopButton/index.tsx | 2 +- .../BackToTopButton/variants.ts | 1 + hooks/useScrollToTop.ts | 34 ++++-- i18n/dictionaries/da.json | 3 +- i18n/dictionaries/de.json | 3 +- i18n/dictionaries/en.json | 3 +- i18n/dictionaries/fi.json | 3 +- i18n/dictionaries/no.json | 3 +- i18n/dictionaries/sv.json | 3 +- .../contentstack/destinationCityPage/query.ts | 29 +++-- .../contentstack/destinationCityPage/utils.ts | 31 ++++++ .../destinationCountryPage/query.ts | 55 ++-------- .../destinationCountryPage/utils.ts | 49 +++++++++ server/routers/hotels/output.ts | 13 ++- server/routers/hotels/query.ts | 8 +- .../routers/hotels/schemas/additionalData.ts | 2 +- server/routers/hotels/utils.ts | 92 +++++++++++++--- 27 files changed, 522 insertions(+), 103 deletions(-) create mode 100644 components/ContentType/DestinationPage/HotelListing/HotelListingItem/hotelListingItem.module.css create mode 100644 components/ContentType/DestinationPage/HotelListing/HotelListingItem/index.tsx create mode 100644 components/ContentType/DestinationPage/HotelListing/hotelListing.module.css create mode 100644 components/ContentType/DestinationPage/HotelListing/index.tsx diff --git a/components/ContentType/DestinationPage/CityListing/index.tsx b/components/ContentType/DestinationPage/CityListing/index.tsx index 639d46e09..6eda28805 100644 --- a/components/ContentType/DestinationPage/CityListing/index.tsx +++ b/components/ContentType/DestinationPage/CityListing/index.tsx @@ -19,7 +19,9 @@ export default async function CityListing({ cities }: CityListingProps) {
{intl.formatMessage( - { id: `{count} Locations` }, + { + id: `{count, plural, one {{count} Location} other {{count} Locations}}`, + }, { count: cities.length } )} diff --git a/components/ContentType/DestinationPage/DestinationCityPage/destinationCityPage.module.css b/components/ContentType/DestinationPage/DestinationCityPage/destinationCityPage.module.css index f2ba79648..1032fc939 100644 --- a/components/ContentType/DestinationPage/DestinationCityPage/destinationCityPage.module.css +++ b/components/ContentType/DestinationPage/DestinationCityPage/destinationCityPage.module.css @@ -16,7 +16,9 @@ .mainSection { grid-area: mainSection; padding-bottom: var(--Spacing-x7); - min-height: 500px; /* This is a temporary value because of no content atm */ + max-width: var(--max-width-page); + width: 100%; + margin: 0 auto; } .sidebar { diff --git a/components/ContentType/DestinationPage/DestinationCityPage/index.tsx b/components/ContentType/DestinationPage/DestinationCityPage/index.tsx index 2bc30e119..d2b51975d 100644 --- a/components/ContentType/DestinationPage/DestinationCityPage/index.tsx +++ b/components/ContentType/DestinationPage/DestinationCityPage/index.tsx @@ -7,9 +7,9 @@ import BreadcrumbsSkeleton from "@/components/TempDesignSystem/Breadcrumbs/Bread import Body from "@/components/TempDesignSystem/Text/Body" import Title from "@/components/TempDesignSystem/Text/Title" import TrackingSDK from "@/components/TrackingSDK" -import { getIntl } from "@/i18n" import ExperienceList from "../ExperienceList" +import HotelListing from "../HotelListing" import SidebarContentWrapper from "../SidebarContentWrapper" import DestinationPageSidePeek from "../Sidepeek" import StaticMap from "../StaticMap" @@ -20,16 +20,13 @@ import styles from "./destinationCityPage.module.css" import { PageContentTypeEnum } from "@/types/requests/contentType" export default async function DestinationCityPage() { - const [intl, pageData] = await Promise.all([ - getIntl(), - getDestinationCityPage(), - ]) + const pageData = await getDestinationCityPage() if (!pageData) { return null } - const { tracking, destinationCityPage } = pageData + const { tracking, destinationCityPage, hotels } = pageData const { images, heading, @@ -55,8 +52,7 @@ export default async function DestinationCityPage() { />
- {/* TODO: Add hotel listing by cityIdentifier */} - {">>>> MAIN CONTENT <<<<"} +