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:
Pontus Dreij
2025-03-21 07:24:01 +00:00
parent 096cf700f4
commit 2bc14a6eeb
7 changed files with 65 additions and 5 deletions

View File

@@ -20,6 +20,7 @@ import Body from "@/components/TempDesignSystem/Text/Body"
import Caption from "@/components/TempDesignSystem/Text/Caption"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import useLang from "@/hooks/useLang"
import { trackMyStayPageLink } from "@/utils/tracking"
import { useManageStayStore } from "../../stores/manageStayStore"
import AddToCalendarButton from "./Actions/AddToCalendarButton"
@@ -75,12 +76,35 @@ export default function ActionPanel({
url: hotel.contactInformation.websiteUrl,
}
const handleModifyStay = () => {
trackMyStayPageLink("modify dates")
setActiveView("modifyStay")
}
const handleCancelStay = () => {
trackMyStayPageLink("cancel booking")
setActiveView("cancelStay")
}
const handleDownloadInvoice = () => {
trackMyStayPageLink("download invoice")
}
const handleGuaranteeLateArrival = () => {
trackMyStayPageLink("guarantee late arrival")
onGuaranteeClick()
}
const handleCustomerSupport = () => {
trackMyStayPageLink("customer support")
}
return (
<div className={styles.actionPanel}>
<div className={styles.menu}>
<Button
variant="icon"
onClick={() => setActiveView("modifyStay")}
onClick={handleModifyStay}
intent="text"
className={styles.button}
>
@@ -90,7 +114,7 @@ export default function ActionPanel({
{showGuaranteeButton && (
<Button
variant="icon"
onClick={onGuaranteeClick}
onClick={handleGuaranteeLateArrival}
intent="text"
className={styles.button}
>
@@ -106,7 +130,7 @@ export default function ActionPanel({
/>
<Button
variant="icon"
onClick={() => {}}
onClick={handleDownloadInvoice}
intent="text"
className={styles.button}
>
@@ -116,7 +140,7 @@ export default function ActionPanel({
{showCancelStayButton && (
<Button
variant="icon"
onClick={() => setActiveView("cancelStay")}
onClick={handleCancelStay}
intent="text"
className={styles.button}
>
@@ -154,6 +178,7 @@ export default function ActionPanel({
href={customerService[lang]}
variant="icon"
className={styles.link}
onClick={handleCustomerSupport}
>
<Caption color="burgundy">
{intl.formatMessage({ id: "Customer support" })}