Merged in feat(SW-1993)-tracking-mystay-cancellation (pull request #1588)
Feat(SW-1993) tracking mystay * feat(SW-1993) added trackEvent for cancelStay and mypagelink * feat(SW-1993) implement trackCancelStay and trackMyStayPageLink Approved-by: Linus Flood
This commit is contained in:
@@ -4,6 +4,7 @@ import { useIntl } from "react-intl"
|
||||
|
||||
import { CalendarAddIcon } from "@/components/Icons"
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import { trackMyStayPageLink } from "@/utils/tracking"
|
||||
|
||||
import styles from "../actionPanel.module.css"
|
||||
|
||||
@@ -14,13 +15,18 @@ export default function AddToCalendarButton({
|
||||
}) {
|
||||
const intl = useIntl()
|
||||
|
||||
const handleAddToCalendar = () => {
|
||||
trackMyStayPageLink("add to calendar")
|
||||
onPress()
|
||||
}
|
||||
|
||||
return (
|
||||
<Button
|
||||
variant="icon"
|
||||
intent="text"
|
||||
theme="base"
|
||||
className={styles.button}
|
||||
onPress={onPress}
|
||||
onPress={handleAddToCalendar}
|
||||
>
|
||||
{intl.formatMessage({ id: "Add to calendar" })}
|
||||
<CalendarAddIcon width={24} height={24} color="burgundy" />
|
||||
|
||||
@@ -5,6 +5,7 @@ import { trpc } from "@/lib/trpc/client"
|
||||
import { useManageStayStore } from "@/components/HotelReservation/MyStay/stores/manageStayStore"
|
||||
import { toast } from "@/components/TempDesignSystem/Toasts"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import { trackCancelStay } from "@/utils/tracking"
|
||||
|
||||
import type {
|
||||
CancelStayFormValues,
|
||||
@@ -90,6 +91,7 @@ export default function useCancelStay({
|
||||
{ currency: booking.currencyCode }
|
||||
)
|
||||
)
|
||||
trackCancelStay(booking.hotelId, booking.confirmationNumber)
|
||||
} else if (results.length > 0 && errors.length > 0) {
|
||||
setBookingStatus()
|
||||
toast.warning(
|
||||
|
||||
Reference in New Issue
Block a user