@@ -7,11 +7,12 @@ import type { DeveloperDocsLink } from "@/lib/interfaces"
7
7
import Emoji from "@/components/Emoji"
8
8
9
9
import { cn } from "@/lib/utils/cn"
10
+ import { trackCustomEvent } from "@/lib/utils/matomo"
10
11
11
12
import docLinks from "@/data/developer-docs-links.yaml"
12
13
13
14
import { Flex , Stack } from "./ui/flex"
14
- import { BaseLink } from "./ui/Link "
15
+ import { LinkBox , LinkOverlay } from "./ui/link-box "
15
16
16
17
import { useRtlFlip } from "@/hooks/useRtlFlip"
17
18
@@ -43,19 +44,12 @@ const CardLink = ({ docData, isPrev, contentNotTranslated }: CardLinkProps) => {
43
44
const { isRtl } = useRtlFlip ( )
44
45
45
46
return (
46
- < BaseLink
47
- href = { docData . href }
47
+ < LinkBox
48
48
className = { cn (
49
49
"flex w-full flex-1 items-center no-underline" ,
50
50
"h-[82px] rounded-sm border bg-background" ,
51
51
isPrev ? "justify-start" : "justify-end"
52
52
) }
53
- rel = { isPrev ? "prev" : "next" }
54
- customEventOptions = { {
55
- eventCategory : "next/previous article DocsNav" ,
56
- eventAction : "click" ,
57
- eventName : isPrev ? "previous" : "next" ,
58
- } }
59
53
>
60
54
< div className = { cn ( "h-full p-4" , isPrev ? "order-[0]" : "order-1" ) } >
61
55
< Emoji
@@ -68,12 +62,22 @@ const CardLink = ({ docData, isPrev, contentNotTranslated }: CardLinkProps) => {
68
62
</ div >
69
63
< TextDiv className = { cn ( ! isPrev ? "pe-0 text-end" : "ps-0" ) } >
70
64
< p className = "uppercase text-body" > { t ( isPrev ? "previous" : "next" ) } </ p >
71
-
72
- < p className = { cn ( "underline" , isPrev ? "text-start" : "text-end" ) } >
65
+ < LinkOverlay
66
+ href = { docData . href }
67
+ onClick = { ( ) => {
68
+ trackCustomEvent ( {
69
+ eventCategory : "next/previous article DocsNav" ,
70
+ eventAction : "click" ,
71
+ eventName : isPrev ? "previous" : "next" ,
72
+ } )
73
+ } }
74
+ className = { cn ( "underline" , isPrev ? "text-start" : "text-end" ) }
75
+ rel = { isPrev ? "prev" : "next" }
76
+ >
73
77
{ t ( docData . id ) }
74
- </ p >
78
+ </ LinkOverlay >
75
79
</ TextDiv >
76
- </ BaseLink >
80
+ </ LinkBox >
77
81
)
78
82
}
79
83
0 commit comments