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:
+17
-13
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user