Merge branch 'master' into feature/tracking

This commit is contained in:
Linus Flood
2024-11-18 12:20:13 +01:00
240 changed files with 5429 additions and 2717 deletions

View File

@@ -13,26 +13,23 @@ export type GuestsRoom = {
child: Child[]
}
export interface GuestsRoomsPickerProps {
closePicker: () => void
}
export type GuestsRoomPickerProps = {
index: number
}
export type AdultSelectorProps = {
roomIndex: number
}
export type ChildSelectorProps = {
export type SelectorProps = {
roomIndex: number
currentAdults: number
currentChildren: Child[]
childrenInAdultsBed: number
}
export type ChildInfoSelectorProps = {
child: Child
adults: number
index: number
roomIndex: number
childrenInAdultsBed: number
}
export interface CounterProps {

View File

@@ -1,14 +1,10 @@
import { FormState, UseFormReturn } from "react-hook-form"
import type {
BookingWidgetSchema,
BookingWidgetType,
} from "@/types/components/bookingWidget"
import type { BookingWidgetType } from "@/types/components/bookingWidget"
import type { Location, Locations } from "@/types/trpc/routers/hotel/locations"
export interface BookingWidgetFormProps {
locations: Locations
type?: BookingWidgetType
setIsOpen: (isOpen: boolean) => void
}
export interface BookingWidgetFormContentProps {

View File

@@ -11,6 +11,7 @@ export interface FilterChipProps {
value?: string
selected?: boolean
disabled?: boolean
hasTooltip?: boolean
}
export type FilterChipCheckboxProps = Omit<FilterChipProps, "type">

View File

@@ -1,3 +1,9 @@
import type { LinkProps } from "@/components/TempDesignSystem/Link/link"
import type { LinkProps } from "next/link"
export interface HeaderLinkProps extends React.PropsWithChildren<LinkProps> {}
import type { IconName } from "../icon"
export interface HeaderLinkProps extends React.PropsWithChildren {
href: LinkProps["href"]
iconName: IconName | null
iconSize?: number
}

View File

@@ -4,4 +4,5 @@ import type { Header } from "@/types/trpc/routers/contentstack/header"
export interface MobileMenuProps {
languageUrls: LanguageSwitcherData
topLink: Header["header"]["topLink"]
isLoggedIn: boolean
}

View File

@@ -0,0 +1,7 @@
import type { Header } from "@/types/trpc/routers/contentstack/header"
export interface TopLinkProps {
isLoggedIn: boolean
topLink: Header["header"]["topLink"]
iconSize?: number
}

View File

@@ -1,6 +1,8 @@
import { RoomPackageCodeEnum } from "../selectRate/roomFilter"
import { Child } from "../selectRate/selectRate"
import { Packages } from "@/types/requests/packages"
interface Room {
adults: number
roomTypeCode: string
@@ -16,8 +18,8 @@ export interface BookingData {
}
type Price = {
price?: string
currency?: string
price: number
currency: string
}
export type RoomsData = {
@@ -27,4 +29,5 @@ export type RoomsData = {
adults: number
children?: Child[]
cancellationText: string
packages: Packages | null
}

View File

@@ -5,4 +5,5 @@ export type HotelSidePeekProps = {
hotel: Hotel
activeSidePeek: SidePeekEnum
close: () => void
showCTA: boolean
}

View File

@@ -0,0 +1,5 @@
import type { HotelsAvailabilityPrices } from "@/server/routers/hotels/output"
export type HotelPriceListProps = {
price: HotelsAvailabilityPrices
}

View File

@@ -0,0 +1,6 @@
import { Hotel } from "@/types/hotel"
export type HotelLogoProps = {
hotelId: Hotel["operaId"]
hotelType: Hotel["hotelType"]
}

View File

@@ -13,15 +13,13 @@ import type { Coordinates } from "@/types/components/maps/coordinates"
export interface HotelListingProps {
hotels: HotelData[]
activeHotelPin?: string | null
onHotelCardHover?: (hotelName: string | null) => void
setActiveHotelPin: (hotelName: string | null) => void
}
export interface SelectHotelMapProps {
apiKey: string
coordinates: Coordinates
hotelPins: HotelPin[]
mapId: string
isModal: boolean
hotels: HotelData[]
}
@@ -40,6 +38,7 @@ export type HotelPin = {
}[]
amenities: Filter[]
ratings: number | null
operaId: string
}
export interface HotelListingMapContentProps {
@@ -50,6 +49,12 @@ export interface HotelListingMapContentProps {
export interface HotelCardDialogProps {
isOpen: boolean
pin: HotelPin
data: HotelPin
handleClose: (event: { stopPropagation: () => void }) => void
}
export interface HotelCardDialogListingProps {
hotels: HotelData[]
activeCard: string | null | undefined
onActiveCardChange: (hotelName: string | null) => void
}

View File

@@ -0,0 +1,5 @@
export type PriceCardProps = {
currency: string
memberAmount?: string | undefined
regularAmount?: string | undefined
}

View File

@@ -9,6 +9,7 @@ export interface ReadMoreProps {
label: string
hotelId: string
hotel: Hotel
showCTA: boolean
}
export interface ContactProps {

View File

@@ -2,4 +2,5 @@ import type { HotelData } from "@/types/hotel"
export type HotelInfoCardProps = {
hotelData: HotelData | null
noAvailability: boolean
}

View File

@@ -1,3 +1,3 @@
import type { GalleryImage } from "@/types/hotel"
export type ImageGalleryProps = { images: GalleryImage[]; title: string }
export type ImageGalleryProps = { images?: GalleryImage[]; title: string }

View File

@@ -5,6 +5,6 @@ import type { Rate } from "./selectRate"
export interface RateSummaryProps {
rateSummary: Rate
isUserLoggedIn: boolean
packages: RoomPackageData
packages: RoomPackageData | undefined
roomsAvailability: RoomsAvailability
}

View File

@@ -1,10 +1,10 @@
import { z } from "zod"
import {
packagePriceSchema,
RateDefinition,
RoomConfiguration,
} from "@/server/routers/hotels/output"
import { packagePriceSchema } from "@/server/routers/hotels/schemas/packages"
import { RoomPriceSchema } from "./flexibilityOption"
import { Rate } from "./selectRate"
@@ -18,7 +18,7 @@ export type RoomCardProps = {
rateDefinitions: RateDefinition[]
roomCategories: RoomData[]
selectedPackages: RoomPackageCodes[]
packages: RoomPackageData
packages: RoomPackageData | undefined
handleSelectRate: (rate: Rate) => void
}

View File

@@ -3,7 +3,7 @@ import { z } from "zod"
import {
getRoomPackagesSchema,
packagesSchema,
} from "@/server/routers/hotels/schemas/packages"
} from "@/server/routers/hotels/output"
export enum RoomPackageCodeEnum {
PET_ROOM = "PETR",
@@ -16,9 +16,7 @@ export interface RoomFilterProps {
filterOptions: RoomPackageData
}
export interface RoomPackageData
extends z.output<typeof getRoomPackagesSchema> {}
export type RoomPackageCodes = RoomPackageData[number]["code"]
export type RoomPackage = z.output<typeof packagesSchema>
export interface RoomPackageData extends Array<RoomPackage> {}
export type RoomPackageCodes = RoomPackage["code"]

View File

@@ -2,11 +2,21 @@ import type { RoomData } from "@/types/hotel"
import type { SafeUser } from "@/types/user"
import type { RoomsAvailability } from "@/server/routers/hotels/output"
import type { RoomPackageCodes, RoomPackageData } from "./roomFilter"
import type { Rate } from "./selectRate"
export interface RoomSelectionProps {
roomsAvailability: RoomsAvailability
roomCategories: RoomData[]
user: SafeUser
packages: RoomPackageData
packages: RoomPackageData | undefined
selectedPackages: RoomPackageCodes[]
setRateSummary: (rateSummary: Rate) => void
rateSummary: Rate | null
}
export interface SelectRateProps {
roomsAvailability: RoomsAvailability
roomCategories: RoomData[]
user: SafeUser
packages: RoomPackageData
}

View File

@@ -28,7 +28,7 @@ export interface BreakfastSelectionProps extends SectionProps {
export interface DetailsProps extends SectionProps {}
export interface PaymentProps {
roomPrice: string
roomPrice: number
otherPaymentOptions: string[]
savedCreditCards: CreditCard[] | null
mustBeGuaranteed: boolean

View File

@@ -29,6 +29,6 @@ export interface Rate {
roomTypeCode: RoomConfiguration["roomTypeCode"]
priceName: string
public: Product["productType"]["public"]
member: Product["productType"]["member"]
member?: Product["productType"]["member"]
features: RoomConfiguration["features"]
}

View File

@@ -0,0 +1,3 @@
export type TripAdvisorProps = {
rating: number
}

View File

@@ -82,6 +82,7 @@ export enum IconName {
Phone = "Phone",
Plus = "Plus",
PlusCircle = "PlusCircle",
PriceTag = "PriceTag",
Restaurant = "Restaurant",
RoomService = "RoomService",
Sauna = "Sauna",

View File

@@ -0,0 +1,9 @@
import type { GalleryImage } from "@/types/hotel"
export type ImageGalleryProps = {
images?: GalleryImage[]
title: string
fill?: boolean
width?: number
height?: number
}

View File

@@ -3,12 +3,12 @@ import type { GalleryImage } from "@/types/hotel"
export interface LightboxProps {
images: GalleryImage[]
dialogTitle: string /* Accessible title for dialog screen readers */
children: React.ReactNode
onClose: () => void
isOpen: boolean
}
export interface GalleryProps {
images: GalleryImage[]
dialogTitle: string
onClose: () => void
onSelectImage: (image: GalleryImage) => void
onImageClick: () => void

View File

@@ -7,6 +7,6 @@ export type HeaderProps = {
}
preamble?: string | null
textTransform?: HeadingProps["textTransform"]
title: string | null
title?: string | null
topTitle?: boolean
}