fix: improve loading on destination overview page

- Only load data from Contentstack
- Use static JSON for destination list
- Some logic improvements to data handling and types
This commit is contained in:
Michael Zetterberg
2025-03-26 11:38:10 +01:00
parent f010a6869a
commit 65f75c11ef
37 changed files with 6619 additions and 185 deletions
@@ -1,17 +1,21 @@
export type DestinationsData = {
country: string
countryUrl: string | undefined
numberOfHotels: number
cities: {
id: string
name: string
hotelIds: string[]
hotelCount: number
url: string
}[]
}[]
export type City = {
id: string
name: string
hotelIds: string[]
hotelCount: number
url?: string
}
export type Cities = DestinationsData[number]["cities"]
export type DestinationCountry = {
country: string
countryUrl?: string
numberOfHotels: number
cities: City[]
}
export type DestinationsData = DestinationCountry[]
export type Cities = DestinationCountry["cities"]
export type HotelsSectionProps = {
destinations: DestinationsData
+15
View File
@@ -29,6 +29,21 @@ export type ContentTypeParams = {
| PageContentTypeEnum.startPage
}
// This is purely for use in `apps/scandic-web/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx`
// It is meant as an interim solution while we move away from the switch-case
// approach into routing these based on App router.
// Folders in `apps/scandic-web/app/[lang]/(live)/(public)` should not be in this type.
export type NonAppRouterContentTypeParams = {
contentType:
| PageContentTypeEnum.loyaltyPage
| PageContentTypeEnum.contentPage
| PageContentTypeEnum.hotelPage
| PageContentTypeEnum.collectionPage
| PageContentTypeEnum.destinationCountryPage
| PageContentTypeEnum.destinationCityPage
| PageContentTypeEnum.startPage
}
export type ContentTypeWebviewParams = {
contentType: "loyalty-page" | "account-page"
}