Skip to content

Commit 5bb4290

Browse files
committed
chore: update BUttonLink component to avoid logic duplication
1 parent b5494f3 commit 5bb4290

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/components/Buttons/ButtonLink.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,8 @@ export type ButtonLinkProps = LinkProps &
88
customEventOptions?: MatomoEventOptions
99
}
1010

11-
const ButtonLink = ({
12-
customEventOptions,
13-
onClick,
14-
...props
15-
}: ButtonLinkProps) => {
16-
const handleClick = () => {
17-
customEventOptions && trackCustomEvent(customEventOptions)
18-
}
19-
20-
return (
21-
<Button
22-
as={BaseLink}
23-
activeStyle={{}}
24-
{...props}
25-
onClick={onClick ? onClick : handleClick}
26-
/>
27-
)
11+
const ButtonLink = ({ ...props }: ButtonLinkProps) => {
12+
return <Button as={BaseLink} activeStyle={{}} {...props} />
2813
}
2914

3015
export default ButtonLink

0 commit comments

Comments
 (0)