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:
Anton Gunnarsson
2025-09-22 13:08:10 +00:00
parent a7b19e8b14
commit 630e89c845
30 changed files with 77 additions and 382 deletions

View File

@@ -5,8 +5,7 @@ import { useCallback } from "react"
import { useIntl } from "react-intl"
import DeprecatedSelect from "@scandic-hotels/design-system/DeprecatedSelect"
import { useTrackingContext } from "../../../trackingContext"
import { trackEvent } from "@scandic-hotels/tracking/base"
const enum SortOrder {
Distance = "distance",
@@ -27,7 +26,6 @@ type HotelSorterProps = {
}
export default function HotelSorter({ discreet }: HotelSorterProps) {
const tracking = useTrackingContext()
const searchParams = useSearchParams()
const pathname = usePathname()
const intl = useIntl()
@@ -41,7 +39,7 @@ export default function HotelSorter({ discreet }: HotelSorterProps) {
const newSearchParams = new URLSearchParams(searchParams)
newSearchParams.set("sort", newSort)
tracking.trackGenericEvent({
trackEvent({
event: "sortOptionClick",
filter: {
sortOptions: newSort,
@@ -53,7 +51,7 @@ export default function HotelSorter({ discreet }: HotelSorterProps) {
`${pathname}?${newSearchParams.toString()}`
)
},
[tracking, pathname, searchParams]
[pathname, searchParams]
)
const sortItems: SortItem[] = [
{