fix: support for tracking link clicks
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -98,6 +98,7 @@ export function MainMenu({
|
||||
</li>
|
||||
<li className={styles.mobileLinkRow}>
|
||||
<LoginButton
|
||||
trackingId="LoginStartHamburgerMenu"
|
||||
className={styles.mobileLinkButton}
|
||||
lang={lang}
|
||||
/>
|
||||
|
||||
@@ -65,6 +65,7 @@ export default async function TopMenu({
|
||||
</>
|
||||
) : (
|
||||
<LoginButton
|
||||
trackingId="LoginStartTopMenu"
|
||||
lang={lang}
|
||||
className={`${styles.sessionLink} ${styles.loginLink}`}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user