Merged in feat/sw-3473-remove-tracking-context (pull request #2843)
feat(SW-3473): Rework booking-flow tracking provider * Remove tracking context and import instead * Remove unused file Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -6,9 +6,9 @@ import { useEffect } from "react"
|
||||
import { PaymentCallbackStatusEnum } from "@scandic-hotels/common/constants/paymentCallbackStatusEnum"
|
||||
import { LoadingSpinner } from "@scandic-hotels/design-system/LoadingSpinner"
|
||||
import { trackEvent } from "@scandic-hotels/tracking/base"
|
||||
import { trackPaymentEvent } from "@scandic-hotels/tracking/payment"
|
||||
|
||||
import { detailsStorageName } from "../../../../stores/enter-details"
|
||||
import { useTrackingContext } from "../../../../trackingContext"
|
||||
import { serializeBookingSearchParams } from "../../../../utils/url"
|
||||
import {
|
||||
clearPaymentInfoSessionStorage,
|
||||
@@ -30,7 +30,6 @@ export function HandleErrorCallback({
|
||||
errorMessage?: string
|
||||
}) {
|
||||
const router = useRouter()
|
||||
const { trackPaymentEvent } = useTrackingContext()
|
||||
useEffect(() => {
|
||||
const bookingData = window.sessionStorage.getItem(detailsStorageName)
|
||||
|
||||
@@ -106,7 +105,7 @@ export function HandleErrorCallback({
|
||||
router.replace(`${returnUrl}?${searchParams.toString()}`)
|
||||
}
|
||||
}
|
||||
}, [returnUrl, router, searchObject, status, errorMessage, trackPaymentEvent])
|
||||
}, [returnUrl, router, searchObject, status, errorMessage])
|
||||
|
||||
return <LoadingSpinner fullPage />
|
||||
}
|
||||
|
||||
@@ -26,6 +26,10 @@ import { PaymentOption } from "@scandic-hotels/design-system/Form/PaymentOption"
|
||||
import { PaymentOptionsGroup } from "@scandic-hotels/design-system/Form/PaymentOptionsGroup"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trackEvent } from "@scandic-hotels/tracking/base"
|
||||
import {
|
||||
trackGlaSaveCardAttempt,
|
||||
trackPaymentEvent,
|
||||
} from "@scandic-hotels/tracking/payment"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import { bedTypeMap } from "@scandic-hotels/trpc/constants/bedTypeMap"
|
||||
import { SEARCH_TYPE_REDEMPTION } from "@scandic-hotels/trpc/constants/booking"
|
||||
@@ -38,7 +42,6 @@ import { useHandleBookingStatus } from "../../../hooks/useHandleBookingStatus"
|
||||
import { useIsLoggedIn } from "../../../hooks/useIsLoggedIn"
|
||||
import useLang from "../../../hooks/useLang"
|
||||
import { useEnterDetailsStore } from "../../../stores/enter-details"
|
||||
import { useTrackingContext } from "../../../trackingContext"
|
||||
import ConfirmBooking, { ConfirmBookingRedemption } from "../Confirm"
|
||||
import PriceChangeDialog from "../PriceChangeDialog"
|
||||
import { writeGlaToSessionStorage } from "./PaymentCallback/helpers"
|
||||
@@ -80,7 +83,6 @@ export default function PaymentClient({
|
||||
const searchParams = useSearchParams()
|
||||
const isUserLoggedIn = useIsLoggedIn()
|
||||
const { getTopOffset } = useStickyPosition({})
|
||||
const { trackPaymentEvent, trackGlaSaveCardAttempt } = useTrackingContext()
|
||||
|
||||
const [showBookingAlert, setShowBookingAlert] = useState(false)
|
||||
|
||||
@@ -265,7 +267,6 @@ export default function PaymentClient({
|
||||
bookingMustBeGuaranteed,
|
||||
hasOnlyFlexRates,
|
||||
setIsSubmitting,
|
||||
trackPaymentEvent,
|
||||
]
|
||||
)
|
||||
|
||||
@@ -504,8 +505,6 @@ export default function PaymentClient({
|
||||
isUserLoggedIn,
|
||||
getTopOffset,
|
||||
setIsSubmitting,
|
||||
trackGlaSaveCardAttempt,
|
||||
trackPaymentEvent,
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user