Merge branch 'develop' into feature/tracking
This commit is contained in:
@@ -1,13 +1,24 @@
|
||||
import { VariantProps } from "class-variance-authority"
|
||||
import { z } from "zod"
|
||||
|
||||
import { bookingWidgetSchema } from "@/components/Forms/BookingWidget/schema"
|
||||
import { bookingWidgetVariants } from "@/components/Forms/BookingWidget/variants"
|
||||
|
||||
import type { Locations } from "@/types/trpc/routers/hotel/locations"
|
||||
|
||||
export type BookingWidgetSchema = z.output<typeof bookingWidgetSchema>
|
||||
|
||||
export type BookingWidgetType = VariantProps<
|
||||
typeof bookingWidgetVariants
|
||||
>["type"]
|
||||
|
||||
export interface BookingWidgetProps {
|
||||
type?: BookingWidgetType
|
||||
}
|
||||
|
||||
export interface BookingWidgetClientProps {
|
||||
locations: Locations
|
||||
type?: BookingWidgetType
|
||||
}
|
||||
|
||||
export interface BookingWidgetToggleButtonProps {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { FacilityCard, FacilityImage } from "./hotelPage/facilities"
|
||||
|
||||
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
||||
import type { FacilityCard } from "./hotelPage/facilities"
|
||||
|
||||
export interface CardImageProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
card: FacilityCard | undefined
|
||||
imageCards: Pick<CardProps, "backgroundImage">[]
|
||||
card: FacilityCard | CardProps
|
||||
imageCards?: FacilityImage[]
|
||||
}
|
||||
|
||||
5
types/components/enterDetails/bedType.ts
Normal file
5
types/components/enterDetails/bedType.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { bedTypeSchema } from "@/components/HotelReservation/EnterDetails/BedType/schema"
|
||||
|
||||
export interface BedTypeSchema extends z.output<typeof bedTypeSchema> {}
|
||||
5
types/components/enterDetails/breakfast.ts
Normal file
5
types/components/enterDetails/breakfast.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { breakfastSchema } from "@/components/HotelReservation/EnterDetails/Breakfast/schema"
|
||||
|
||||
export interface BreakfastSchema extends z.output<typeof breakfastSchema> {}
|
||||
11
types/components/enterDetails/details.ts
Normal file
11
types/components/enterDetails/details.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { detailsSchema } from "@/components/HotelReservation/EnterDetails/Details/schema"
|
||||
|
||||
import { User } from "@/types/user"
|
||||
|
||||
export interface DetailsSchema extends z.output<typeof detailsSchema> {}
|
||||
|
||||
export interface DetailsProps {
|
||||
user: User | null
|
||||
}
|
||||
@@ -1,11 +1,20 @@
|
||||
import { FormState, UseFormReturn } from "react-hook-form"
|
||||
|
||||
import type {
|
||||
BookingWidgetSchema,
|
||||
BookingWidgetType,
|
||||
} from "@/types/components/bookingWidget"
|
||||
import type { Location, Locations } from "@/types/trpc/routers/hotel/locations"
|
||||
|
||||
export interface BookingWidgetFormProps {
|
||||
locations: Locations
|
||||
type?: BookingWidgetType
|
||||
}
|
||||
|
||||
export interface BookingWidgetFormContentProps {
|
||||
locations: Locations
|
||||
formId: string
|
||||
formState: FormState<BookingWidgetSchema>
|
||||
}
|
||||
|
||||
export enum ActionType {
|
||||
|
||||
@@ -3,6 +3,7 @@ import { navigationQueryRouter } from "@/server/routers/contentstack/myPages/nav
|
||||
import { FriendsMembership } from "@/utils/user"
|
||||
|
||||
import type { User } from "@/types/user"
|
||||
import type { LoyaltyLevel } from "@/server/routers/contentstack/loyaltyLevel/output"
|
||||
|
||||
type MyPagesNavigation = Awaited<
|
||||
ReturnType<(typeof navigationQueryRouter)["get"]>
|
||||
@@ -12,6 +13,7 @@ export interface MyPagesMenuProps {
|
||||
navigation: MyPagesNavigation
|
||||
user: Pick<User, "firstName" | "lastName">
|
||||
membership?: FriendsMembership | null
|
||||
membershipLevel: LoyaltyLevel | null
|
||||
}
|
||||
|
||||
export interface MyPagesMenuContentProps extends MyPagesMenuProps {
|
||||
|
||||
5
types/components/hotelPage/amenities.ts
Normal file
5
types/components/hotelPage/amenities.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { Amenities } from "@/types/hotel"
|
||||
|
||||
export type AmenitiesListProps = {
|
||||
detailedFacilities: Amenities
|
||||
}
|
||||
@@ -1,19 +1,54 @@
|
||||
import type { Facility } from "@/types/hotel"
|
||||
import type { ActivityCard } from "@/types/trpc/routers/contentstack/hotelPage"
|
||||
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
||||
|
||||
interface ColumnSpanOptions {
|
||||
columnSpan: "one" | "two" | "three"
|
||||
export type FacilitiesProps = {
|
||||
facilities: Facility[]
|
||||
activitiesCard?: ActivityCard
|
||||
}
|
||||
|
||||
export type FacilityCard = CardProps & ColumnSpanOptions
|
||||
|
||||
export type Facility = Array<FacilityCard>
|
||||
|
||||
export type Facilities = Array<Facility>
|
||||
|
||||
export type FacilityProps = {
|
||||
facilities: Facilities
|
||||
export type FacilityImage = {
|
||||
backgroundImage: CardProps["backgroundImage"]
|
||||
theme: CardProps["theme"]
|
||||
id: string
|
||||
}
|
||||
|
||||
export type FacilityCard = {
|
||||
secondaryButton: {
|
||||
href: string
|
||||
title: string
|
||||
openInNewTab?: boolean
|
||||
isExternal: boolean
|
||||
}
|
||||
heading: string
|
||||
scriptedTopTitle: string
|
||||
theme: CardProps["theme"]
|
||||
id: string
|
||||
}
|
||||
|
||||
export type FacilityCardType = FacilityImage | FacilityCard
|
||||
export type FacilityGrid = FacilityCardType[]
|
||||
export type Facilities = FacilityGrid[]
|
||||
|
||||
export type CardGridProps = {
|
||||
facility: Facility
|
||||
facilitiesCardGrid: FacilityGrid
|
||||
}
|
||||
|
||||
export enum FacilityEnum {
|
||||
wellness = "wellness-and-exercise",
|
||||
conference = "meetings-and-conferences",
|
||||
restaurant = "restaurant-and-bar",
|
||||
}
|
||||
|
||||
export enum RestaurantHeadings {
|
||||
restaurantAndBar = "Restaurant & Bar",
|
||||
bar = "Bar",
|
||||
restaurant = "Restaurant",
|
||||
breakfastRestaurant = "Breakfast restaurant",
|
||||
}
|
||||
|
||||
export enum FacilityIds {
|
||||
bar = 1606,
|
||||
rooftopBar = 1014,
|
||||
restaurant = 1383,
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export enum HotelHashValues {
|
||||
export enum HotelHashValues { // Should these be translated?
|
||||
overview = "#overview",
|
||||
rooms = "#rooms-section",
|
||||
restaurant = "#restaurant-and-bar",
|
||||
@@ -7,3 +7,7 @@ export enum HotelHashValues {
|
||||
activities = "#activities",
|
||||
faq = "#faq",
|
||||
}
|
||||
|
||||
export type TabNavigationProps = {
|
||||
restaurantTitle: string
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AvailabilityPrices } from "@/server/routers/hotels/output"
|
||||
import { HotelsAvailabilityPrices } from "@/server/routers/hotels/output"
|
||||
|
||||
import { Hotel } from "@/types/hotel"
|
||||
|
||||
@@ -8,5 +8,5 @@ export type HotelCardListingProps = {
|
||||
|
||||
export type HotelData = {
|
||||
hotelData: Hotel
|
||||
price: AvailabilityPrices
|
||||
price: HotelsAvailabilityPrices
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { Rate } from "@/server/routers/hotels/output"
|
||||
|
||||
export interface RoomSelectionProps {
|
||||
rates: Rate[]
|
||||
nrOfAdults: number
|
||||
nrOfNights: number
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Rate } from "@/server/routers/hotels/output"
|
||||
import { Hotel } from "@/types/hotel"
|
||||
|
||||
export interface SectionProps {
|
||||
nextPath: string
|
||||
@@ -25,14 +25,12 @@ export interface BreakfastSelectionProps extends SectionProps {
|
||||
}[]
|
||||
}
|
||||
|
||||
export interface RoomSelectionProps extends SectionProps {
|
||||
alternatives: Rate[]
|
||||
nrOfAdults: number
|
||||
nrOfNights: number
|
||||
}
|
||||
|
||||
export interface DetailsProps extends SectionProps {}
|
||||
|
||||
export interface PaymentProps {
|
||||
hotel: Hotel
|
||||
}
|
||||
|
||||
export interface SectionPageProps {
|
||||
breakfast?: string
|
||||
bed?: string
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
export interface SectionAccordionProps {
|
||||
header: string
|
||||
selection?: string | string[]
|
||||
isOpen: boolean
|
||||
isCompleted: boolean
|
||||
label: string
|
||||
path: string
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
export interface SelectRateSearchParams {
|
||||
fromDate: string
|
||||
toDate: string
|
||||
hotel: string
|
||||
}
|
||||
9
types/components/image.ts
Normal file
9
types/components/image.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export type ApiImage = {
|
||||
id: string
|
||||
url: string
|
||||
title: string
|
||||
meta: {
|
||||
alt: string
|
||||
caption: string
|
||||
}
|
||||
}
|
||||
@@ -15,40 +15,43 @@ export interface SearchListProps {
|
||||
getItemProps: PropGetters<unknown>["getItemProps"]
|
||||
getMenuProps: PropGetters<unknown>["getMenuProps"]
|
||||
isOpen: boolean
|
||||
handleClearSearchHistory: () => void
|
||||
highlightedIndex: HighlightedIndex
|
||||
locations: Locations
|
||||
search: string
|
||||
searchHistory: Locations | null
|
||||
}
|
||||
|
||||
export interface ListProps {
|
||||
getItemProps: PropGetters<unknown>["getItemProps"]
|
||||
highlightedIndex: HighlightedIndex
|
||||
export interface ListProps
|
||||
extends Pick<
|
||||
SearchListProps,
|
||||
"getItemProps" | "highlightedIndex" | "locations"
|
||||
> {
|
||||
initialIndex?: number
|
||||
label?: string
|
||||
locations: Locations
|
||||
}
|
||||
|
||||
export interface ListItemProps {
|
||||
getItemProps: PropGetters<unknown>["getItemProps"]
|
||||
highlightedIndex: HighlightedIndex
|
||||
export interface ListItemProps
|
||||
extends Pick<SearchListProps, "getItemProps" | "highlightedIndex"> {
|
||||
index: number
|
||||
location: Location
|
||||
}
|
||||
|
||||
export interface DialogProps
|
||||
extends React.PropsWithChildren,
|
||||
VariantProps<typeof dialogVariants> {
|
||||
VariantProps<typeof dialogVariants>,
|
||||
Pick<SearchListProps, "getMenuProps"> {
|
||||
className?: string
|
||||
getMenuProps: PropGetters<unknown>["getMenuProps"]
|
||||
}
|
||||
|
||||
export interface ErrorDialogProps extends React.PropsWithChildren {
|
||||
getMenuProps: PropGetters<unknown>["getMenuProps"]
|
||||
}
|
||||
export interface ErrorDialogProps
|
||||
extends React.PropsWithChildren,
|
||||
Pick<SearchListProps, "getMenuProps"> {}
|
||||
|
||||
export interface ClearSearchButtonProps {
|
||||
getItemProps: PropGetters<unknown>["getItemProps"]
|
||||
highlightedIndex: HighlightedIndex
|
||||
export interface ClearSearchButtonProps
|
||||
extends Pick<
|
||||
SearchListProps,
|
||||
"getItemProps" | "handleClearSearchHistory" | "highlightedIndex"
|
||||
> {
|
||||
index: number
|
||||
}
|
||||
|
||||
21
types/components/tooltip.ts
Normal file
21
types/components/tooltip.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
export type TooltipPosition = "left" | "right" | "top" | "bottom"
|
||||
type VerticalArrow = "top" | "bottom" | "center"
|
||||
type HorizontalArrow = "left" | "right" | "center"
|
||||
|
||||
type ValidArrowMap = {
|
||||
left: VerticalArrow
|
||||
right: VerticalArrow
|
||||
top: HorizontalArrow
|
||||
bottom: HorizontalArrow
|
||||
}
|
||||
|
||||
type ValidArrow<P extends TooltipPosition> = P extends keyof ValidArrowMap
|
||||
? ValidArrowMap[P]
|
||||
: never
|
||||
|
||||
export interface TooltipProps<P extends TooltipPosition = TooltipPosition> {
|
||||
heading?: string
|
||||
text?: string
|
||||
position: P
|
||||
arrow: ValidArrow<P>
|
||||
}
|
||||
4
types/enums/bedType.ts
Normal file
4
types/enums/bedType.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export enum bedTypeEnum {
|
||||
KING = "KING",
|
||||
QUEEN = "QUEEN",
|
||||
}
|
||||
4
types/enums/breakfast.ts
Normal file
4
types/enums/breakfast.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export enum breakfastEnum {
|
||||
BREAKFAST = "BREAKFAST",
|
||||
NO_BREAKFAST = "NO_BREAKFAST",
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
facilitySchema,
|
||||
getHotelDataSchema,
|
||||
parkingSchema,
|
||||
pointOfInterestSchema,
|
||||
@@ -13,6 +14,8 @@ export type Hotel = HotelData["data"]["attributes"]
|
||||
export type HotelAddress = HotelData["data"]["attributes"]["address"]
|
||||
export type HotelLocation = HotelData["data"]["attributes"]["location"]
|
||||
|
||||
export type Amenities = HotelData["data"]["attributes"]["detailedFacilities"]
|
||||
|
||||
type HotelRatings = HotelData["data"]["attributes"]["ratings"]
|
||||
export type HotelTripAdvisor =
|
||||
| NonNullable<HotelRatings>["tripAdvisor"]
|
||||
@@ -52,3 +55,4 @@ export enum PointOfInterestGroupEnum {
|
||||
}
|
||||
|
||||
export type ParkingData = z.infer<typeof parkingSchema>
|
||||
export type Facility = z.infer<typeof facilitySchema> & { id: string }
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
import { z } from "zod"
|
||||
|
||||
import { systemSchema } from "@/server/routers/contentstack/schemas/system"
|
||||
|
||||
export interface System {
|
||||
system: {
|
||||
content_type_uid: string
|
||||
locale: Lang
|
||||
uid: string
|
||||
}
|
||||
system: z.output<typeof systemSchema>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user