Merged in fix/SW-2676-tracking-select-hotel (pull request #2165)
Fix/SW-2676 tracking select hotel * fix(SW-2676): add tracking select hotel * fix(SW-2676): fix tracking text * fix(SW-2676): create tracking function Approved-by: Tobias Johansson
This commit is contained in:
@@ -7,6 +7,7 @@ import { useCallback } from "react"
|
||||
import { useHotelsMapStore } from "@/stores/hotels-map"
|
||||
|
||||
import HotelCardDialog from "@/components/HotelReservation/HotelCardDialog"
|
||||
import { trackEvent } from "@/utils/tracking/base"
|
||||
|
||||
import HotelPin from "./HotelPin"
|
||||
|
||||
@@ -19,12 +20,20 @@ function HotelListingMapContent({ hotelPins }: HotelListingMapContentProps) {
|
||||
useHotelsMapStore()
|
||||
|
||||
const toggleActiveHotelPin = useCallback(
|
||||
(pinName: string | null) => {
|
||||
(pinName: string | null, hotelId: string) => {
|
||||
if (activeHotel === pinName || pinName === null) {
|
||||
deactivate()
|
||||
return
|
||||
}
|
||||
|
||||
trackEvent({
|
||||
event: "hotelClickMap",
|
||||
map: {
|
||||
action: "hotel click - map",
|
||||
},
|
||||
hotelInfo: {
|
||||
hotelId,
|
||||
},
|
||||
})
|
||||
activate(pinName)
|
||||
},
|
||||
[activeHotel, activate, deactivate]
|
||||
@@ -58,7 +67,7 @@ function HotelListingMapContent({ hotelPins }: HotelListingMapContentProps) {
|
||||
zIndex={isActiveOrHovered ? 2 : 0}
|
||||
onMouseEnter={() => engage(pin.name)}
|
||||
onMouseLeave={() => disengage()}
|
||||
onClick={() => toggleActiveHotelPin(pin.name)}
|
||||
onClick={() => toggleActiveHotelPin(pin.name, pin.operaId)}
|
||||
>
|
||||
<div className={styles.dialogContainer}>
|
||||
<HotelCardDialog
|
||||
|
||||
Reference in New Issue
Block a user