Skip to content

Commit b55dc25

Browse files
committed
chore: use customEventOptions prop to handle onClick logic
1 parent 5bb4290 commit b55dc25

File tree

1 file changed

+16
-17
lines changed
  • src/components/FindWallet/WalletTable

1 file changed

+16
-17
lines changed

src/components/FindWallet/WalletTable/index.tsx

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,6 @@ const WalletTable = ({
330330
})
331331
}
332332

333-
const handleWalletWebsiteClick = (walletName: string) => {
334-
trackCustomEvent({
335-
eventCategory: "WalletExternalLinkList",
336-
eventAction: "Tap main button",
337-
eventName: `${walletName}`,
338-
})
339-
}
340-
341333
return (
342334
<WalletContainer
343335
key={wallet.key}
@@ -350,10 +342,7 @@ const WalletTable = ({
350342
}}
351343
onClick={(e) => {
352344
// Prevent expanding the wallet more info section when clicking on the "Visit website" button
353-
if (
354-
(e.target as HTMLElement).matches("a, a svg")
355-
)
356-
return
345+
if ((e.target as HTMLElement).matches("a, a svg")) return
357346
showMoreInfo(wallet)
358347
}}
359348
>
@@ -393,7 +382,11 @@ const WalletTable = ({
393382
{hasPersonasLabels && (
394383
<Flex gap={1.5} wrap="wrap">
395384
{walletPersonas.map((persona) => (
396-
<Tag key={persona} label={t(persona)} variant="highContrast" />
385+
<Tag
386+
key={persona}
387+
label={t(persona)}
388+
variant="highContrast"
389+
/>
397390
))}
398391
</Flex>
399392
)}
@@ -445,9 +438,11 @@ const WalletTable = ({
445438
w="auto"
446439
isExternal
447440
size="sm"
448-
onClick={() =>
449-
handleWalletWebsiteClick(wallet.name)
450-
}
441+
customEventOptions={{
442+
eventCategory: "WalletExternalLinkList",
443+
eventAction: "Tap main button",
444+
eventName: `${wallet.name}`,
445+
}}
451446
>
452447
{t("page-find-wallet-visit-website")}
453448
</ButtonLink>
@@ -474,7 +469,11 @@ const WalletTable = ({
474469
w="100%"
475470
isExternal
476471
size="sm"
477-
onClick={() => handleWalletWebsiteClick(wallet.name)}
472+
customEventOptions={{
473+
eventCategory: "WalletExternalLinkList",
474+
eventAction: "Tap main button",
475+
eventName: `${wallet.name}`,
476+
}}
478477
>
479478
{t("page-find-wallet-visit-website")}
480479
</ButtonLink>

0 commit comments

Comments
 (0)