Merged in feat/sw-2879-booking-widget-to-booking-flow-package (pull request #2532)
feat(SW-2879): Move BookingWidget to booking-flow package * Fix lockfile * Fix styling * a tiny little booking widget test * Tiny fixes * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Remove unused scripts * lint:fix * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Tiny lint fixes * update test * Update Input in booking-flow * Clean up comments etc * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Setup tracking context for booking-flow * Add missing use client * Fix temp tracking function * Pass booking to booking-widget * Remove comment * Add use client to booking widget tracking provider * Add use client to tracking functions * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Move debug page * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package Approved-by: Bianca Widstam
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
|
||||
export type ChildBed = {
|
||||
label: string
|
||||
value: number
|
||||
}
|
||||
|
||||
export type GuestsRoom = {
|
||||
adults: number
|
||||
childrenInRoom: Child[]
|
||||
}
|
||||
|
||||
export type GuestsRoomPickerProps = {
|
||||
index: number
|
||||
}
|
||||
|
||||
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 {
|
||||
count: number
|
||||
handleOnIncrease: () => void
|
||||
handleOnDecrease: () => void
|
||||
disableIncrease: boolean
|
||||
disableDecrease: boolean
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import type { z } from "zod"
|
||||
|
||||
import type {
|
||||
bookingCodeSchema,
|
||||
bookingWidgetSchema,
|
||||
} from "@/components/Forms/BookingWidget/schema"
|
||||
import type { bookingWidgetVariants } from "@/components/Forms/BookingWidget/variants"
|
||||
import type { BookingSearchType } from "../hotelReservation/booking"
|
||||
import type { GuestsRoom } from "./guestsRoomsPicker"
|
||||
|
||||
export type BookingWidgetSchema = z.output<typeof bookingWidgetSchema>
|
||||
export type BookingCodeSchema = z.output<typeof bookingCodeSchema>
|
||||
|
||||
export type BookingWidgetSearchData = {
|
||||
city?: string
|
||||
hotelId?: string
|
||||
fromDate?: string
|
||||
toDate?: string
|
||||
rooms?: GuestsRoom[]
|
||||
bookingCode?: string
|
||||
searchType?: BookingSearchType
|
||||
}
|
||||
|
||||
export type BookingWidgetType = VariantProps<
|
||||
typeof bookingWidgetVariants
|
||||
>["type"]
|
||||
|
||||
export interface BookingWidgetProps {
|
||||
type?: BookingWidgetType
|
||||
booking: BookingWidgetSearchData
|
||||
}
|
||||
|
||||
export interface BookingWidgetClientProps {
|
||||
type?: BookingWidgetType
|
||||
data: BookingWidgetSearchData
|
||||
pageSettingsBookingCodePromise: Promise<string> | null
|
||||
}
|
||||
|
||||
export interface BookingWidgetToggleButtonProps {
|
||||
openMobileSearch: () => void
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import type { DateRange } from "react-day-picker"
|
||||
|
||||
export interface DatePickerFormProps {
|
||||
name?: string
|
||||
}
|
||||
|
||||
interface DatePickerProps {
|
||||
close: () => void
|
||||
startMonth?: Date
|
||||
hideHeader?: boolean
|
||||
}
|
||||
|
||||
export interface DatePickerRangeProps extends DatePickerProps {
|
||||
selectedRange: DateRange | undefined
|
||||
handleOnSelect: (nextRange: DateRange | undefined, selectedDay: Date) => void
|
||||
}
|
||||
|
||||
export interface DatePickerSingleProps extends DatePickerProps {
|
||||
selectedDate: Date
|
||||
handleOnSelect: (selected: Date) => void
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import type { BookingWidgetType } from "@/types/components/bookingWidget"
|
||||
|
||||
export interface BookingWidgetFormProps {
|
||||
type?: BookingWidgetType
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
export interface BookingWidgetFormContentProps {
|
||||
formId: string
|
||||
onSubmit: () => void
|
||||
isSearching: boolean
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
import type { bookingSearchTypes } from "@/constants/booking"
|
||||
|
||||
export type BookingSearchType = (typeof bookingSearchTypes)[number]
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { BookingSearchType } from "@scandic-hotels/booking-flow/searchType"
|
||||
import type { productTypePointsSchema } from "@scandic-hotels/trpc/routers/hotels/schemas/productTypePrice"
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
import type { PackageEnum } from "@scandic-hotels/trpc/types/packages"
|
||||
@@ -10,7 +11,6 @@ import type {
|
||||
guestDetailsSchema,
|
||||
signedInDetailsSchema,
|
||||
} from "@/components/HotelReservation/EnterDetails/Details/RoomOne/schema"
|
||||
import type { BookingSearchType } from "../booking"
|
||||
import type { Price } from "../price"
|
||||
|
||||
export type DetailsSchema = z.output<typeof guestDetailsSchema>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { BookingSearchType } from "@scandic-hotels/booking-flow/searchType"
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
import type { Hotel } from "@scandic-hotels/trpc/types/hotel"
|
||||
|
||||
import type { BookingSearchType } from "../booking"
|
||||
import type { SidePeekEnum } from "../sidePeek"
|
||||
|
||||
export interface ReadMoreProps {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { BookingSearchType } from "@scandic-hotels/booking-flow/searchType"
|
||||
import type { RateEnum } from "@scandic-hotels/trpc/enums/rate"
|
||||
import type { Child } from "@scandic-hotels/trpc/types/child"
|
||||
import type { PackageEnum, Packages } from "@scandic-hotels/trpc/types/packages"
|
||||
@@ -6,8 +7,6 @@ import type {
|
||||
RoomConfiguration,
|
||||
} from "@scandic-hotels/trpc/types/roomAvailability"
|
||||
|
||||
import type { BookingSearchType } from "../booking"
|
||||
|
||||
export interface Room {
|
||||
adults: number
|
||||
childrenInRoom?: Child[]
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
import type { AutoCompleteLocation } from "@scandic-hotels/trpc/routers/autocomplete/schema"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import type { PropGetters } from "downshift"
|
||||
|
||||
import type { dialogVariants } from "@/components/Forms/BookingWidget/FormContent/Search/SearchList/Dialog/variants"
|
||||
|
||||
export interface SearchProps {
|
||||
handlePressEnter: () => void
|
||||
}
|
||||
@@ -12,36 +6,3 @@ export type SearchHistoryItem = {
|
||||
type: "cities" | "hotels"
|
||||
id: string
|
||||
}
|
||||
|
||||
type HighlightedIndex = number | null
|
||||
|
||||
export interface SearchListProps {
|
||||
getItemProps: PropGetters<unknown>["getItemProps"]
|
||||
getMenuProps: PropGetters<unknown>["getMenuProps"]
|
||||
isOpen: boolean
|
||||
handleClearSearchHistory: () => void
|
||||
highlightedIndex: HighlightedIndex
|
||||
searchInputName: string
|
||||
search: string
|
||||
searchHistory: AutoCompleteLocation[] | null
|
||||
includeTypes: ("cities" | "hotels" | "countries")[]
|
||||
}
|
||||
|
||||
export interface DialogProps
|
||||
extends React.PropsWithChildren,
|
||||
VariantProps<typeof dialogVariants>,
|
||||
Pick<SearchListProps, "getMenuProps"> {
|
||||
className?: string
|
||||
}
|
||||
|
||||
export interface ErrorDialogProps
|
||||
extends React.PropsWithChildren,
|
||||
Pick<SearchListProps, "getMenuProps"> {}
|
||||
|
||||
export interface ClearSearchButtonProps
|
||||
extends Pick<
|
||||
SearchListProps,
|
||||
"getItemProps" | "handleClearSearchHistory" | "highlightedIndex"
|
||||
> {
|
||||
index: number
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
export enum BookingCodeFilterEnum {
|
||||
Discounted = "Discounted",
|
||||
All = "All",
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import type { Room } from "@scandic-hotels/trpc/types/room"
|
||||
|
||||
import type { SafeUser } from "@/types/user"
|
||||
import type { Lang } from "@/constants/routes/hotelReservation"
|
||||
import type { BreakfastPackages } from "../components/hotelReservation/breakfast"
|
||||
import type { DetailsBooking } from "../components/hotelReservation/enterDetails/details"
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { BookingCodeFilterEnum } from "@scandic-hotels/booking-flow/stores/bookingCode-filter"
|
||||
import type { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import type { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
|
||||
import type { Room } from "@scandic-hotels/trpc/types/hotel"
|
||||
@@ -13,7 +14,6 @@ import type {
|
||||
Room as RoomBooking,
|
||||
SelectRateBooking,
|
||||
} from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import type { BookingCodeFilterEnum } from "../enums/bookingCodeFilter"
|
||||
|
||||
export interface AvailabilityError {
|
||||
details: string
|
||||
|
||||
Reference in New Issue
Block a user