Skip to content

Commit a8ecc60

Browse files
authored
Merge pull request #13706 from ethereum/button-link-patch
fix: ButtonLink button props and cn merging
2 parents b8922bd + ac364aa commit a8ecc60

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/ui/buttons/Button.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,19 @@ type ButtonLinkProps = Omit<LinkProps, "onClick"> & {
114114
}
115115

116116
const ButtonLink = React.forwardRef<HTMLAnchorElement, ButtonLinkProps>(
117-
({ buttonProps, customEventOptions, children, ...linkProps }, ref) => {
117+
(
118+
{ buttonProps, customEventOptions, children, className, ...linkProps },
119+
ref
120+
) => {
121+
const { size, variant } = buttonProps || {}
118122
const handleClick = () => {
119123
customEventOptions && trackCustomEvent(customEventOptions)
120124
}
121125
return (
122-
<Button asChild {...buttonProps}>
126+
<Button asChild size={size} variant={variant} {...buttonProps}>
123127
<BaseLink
124128
ref={ref}
125-
className="no-underline hover:no-underline"
129+
className={cn("no-underline hover:no-underline", className)}
126130
activeClassName=""
127131
{...linkProps}
128132
onClick={handleClick}

0 commit comments

Comments
 (0)