File tree Expand file tree Collapse file tree 1 file changed +28
-4
lines changed Expand file tree Collapse file tree 1 file changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export const BaseLink = forwardRef(function Link(
86
86
href,
87
87
}
88
88
89
- if ( isInternalPdf || isExternal ) {
89
+ if ( isExternal ) {
90
90
return (
91
91
< ChakraLink
92
92
isExternal
@@ -95,9 +95,7 @@ export const BaseLink = forwardRef(function Link(
95
95
customEventOptions ?? {
96
96
eventCategory : `Link` ,
97
97
eventAction : `Clicked` ,
98
- eventName : `Clicked on ${
99
- isInternalPdf ? "internal PDF" : "external link"
100
- } `,
98
+ eventName : "Clicked on external link" ,
101
99
eventValue : href ,
102
100
}
103
101
)
@@ -120,6 +118,32 @@ export const BaseLink = forwardRef(function Link(
120
118
)
121
119
}
122
120
121
+ if ( isInternalPdf ) {
122
+ return (
123
+ < ChakraLink
124
+ isExternal
125
+ // disable locale prefixing for internal PDFs
126
+ // TODO: add i18n support using a rehype plugin (similar as we do for
127
+ // images)
128
+ locale = { false }
129
+ onClick = { ( ) =>
130
+ trackCustomEvent (
131
+ customEventOptions ?? {
132
+ eventCategory : `Link` ,
133
+ eventAction : `Clicked` ,
134
+ eventName : "Clicked on internal PDF" ,
135
+ eventValue : href ,
136
+ }
137
+ )
138
+ }
139
+ { ...commonProps }
140
+ as = { NextLink }
141
+ >
142
+ { children }
143
+ </ ChakraLink >
144
+ )
145
+ }
146
+
123
147
if ( isHash ) {
124
148
return (
125
149
< ChakraLink
You can’t perform that action at this time.
0 commit comments