fix(SW-1111) refactor state of active hotel card and hotel pin

This commit is contained in:
Pontus Dreij
2024-12-09 16:49:15 +01:00
parent 7f50d34431
commit 15c5afc43a
15 changed files with 108 additions and 115 deletions

View File

@@ -11,9 +11,7 @@ export interface InteractiveMapProps {
pointsOfInterest?: PointOfInterest[]
activePoi?: PointOfInterest["name"] | null
hotelPins?: HotelPin[]
activeHotelPin?: HotelPin["name"] | null
mapId: string
closeButton: ReactElement
onActivePoiChange?: (poi: PointOfInterest["name"] | null) => void
onActiveHotelPinChange?: (hotelPin: HotelPin["name"] | null) => void
}

View File

@@ -10,8 +10,6 @@ export enum HotelCardListingTypeEnum {
export type HotelCardListingProps = {
hotelData: HotelData[]
type?: HotelCardListingTypeEnum
activeCard?: string | null
onHotelCardHover?: (hotelName: string | null) => void
}
export type HotelData = {

View File

@@ -7,5 +7,4 @@ export type HotelCardProps = {
hotel: HotelData
type?: HotelCardListingTypeEnum
state?: "default" | "active"
onHotelCardHover?: (hotelName: string | null) => void
}

View File

@@ -7,13 +7,13 @@ import {
import { HotelData } from "./hotelCardListingProps"
import { CategorizedFilters, Filter } from "./hotelFilters"
import { SelectHotelSearchParams } from "./selectHotelSearchParams"
import type { Coordinates } from "@/types/components/maps/coordinates"
import { Location } from "@/types/trpc/routers/hotel/locations"
export interface HotelListingProps {
hotels: HotelData[]
activeHotelPin?: string | null
setActiveHotelPin: (hotelName: string | null) => void
}
export interface SelectHotelMapProps {
@@ -45,9 +45,7 @@ export type HotelPin = {
}
export interface HotelListingMapContentProps {
activeHotelPin?: HotelPin["name"] | null
hotelPins: HotelPin[]
onActiveHotelPinChange?: (pinName: string | null) => void
}
export interface HotelCardDialogProps {
@@ -58,6 +56,11 @@ export interface HotelCardDialogProps {
export interface HotelCardDialogListingProps {
hotels: HotelData[] | null
activeCard: string | null | undefined
onActiveCardChange: (hotelName: string | null) => void
}
export type SelectHotelMapContainerProps = {
city: Location
searchParams: SelectHotelSearchParams
adultsInRoom: number
childrenInRoom: string | undefined
}