fix: support for tracking link clicks

This commit is contained in:
Christel Westerberg
2024-07-12 09:59:39 +02:00
parent 546679387f
commit edb6005a72
8 changed files with 107 additions and 1 deletions

View File

@@ -7,12 +7,14 @@ import { login } from "@/constants/routes/handleAuth"
import Link from "@/components/TempDesignSystem/Link"
import type { TrackableLoginId } from "@/types/components/tracking"
import { LangParams } from "@/types/params"
export default function LoginButton({
className,
trackingId,
lang,
}: LangParams & { className: string }) {
}: LangParams & { className: string; trackingId: TrackableLoginId }) {
const { formatMessage } = useIntl()
const pathName = usePathname()
@@ -20,6 +22,7 @@ export default function LoginButton({
<Link
href={`${login[lang]}?redirectTo=${encodeURIComponent(`/${lang}${pathName}`)}`}
className={className}
id={trackingId}
>
{formatMessage({ id: "Log in" })}
</Link>