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:
@@ -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[] = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user