Tracking WIP
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { PropsWithChildren, useEffect } from "react"
|
||||
import { PropsWithChildren } from "react"
|
||||
|
||||
import { login } from "@/constants/routes/handleAuth"
|
||||
|
||||
@@ -31,17 +31,6 @@ export default function LoginButton({
|
||||
? `${login[lang]}?redirectTo=${encodeURIComponent(pathName)}`
|
||||
: login[lang]
|
||||
|
||||
useEffect(() => {
|
||||
document
|
||||
.getElementById(trackingId)
|
||||
?.addEventListener("click", () => trackLoginClick(position))
|
||||
return () => {
|
||||
document
|
||||
.getElementById(trackingId)
|
||||
?.removeEventListener("click", () => trackLoginClick(position))
|
||||
}
|
||||
}, [position, trackingId])
|
||||
|
||||
return (
|
||||
<Link
|
||||
className={className}
|
||||
@@ -49,6 +38,7 @@ export default function LoginButton({
|
||||
color={color}
|
||||
href={href}
|
||||
prefetch={false}
|
||||
onClick={() => trackLoginClick(position)}
|
||||
>
|
||||
{children}
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user