Skip to content

Commit ec47b90

Browse files
refactor(tailwind/ButtonLink): flip link and button props
1 parent 5a2c361 commit ec47b90

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

tailwind/ui/__stories__/ButtonLink.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ export default meta
1111

1212
export const ButtonLink: StoryObj<typeof meta> = {
1313
args: {
14-
linkProps: {
15-
href: "#",
16-
},
14+
href: "#",
1715
children: "What is Ethereum?",
1816
},
1917
}

tailwind/ui/buttons/Button.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
106106
)
107107
Button.displayName = "Button"
108108

109-
type ButtonLinkProps = ButtonProps & {
110-
linkProps: Omit<LinkProps, "onClick">
109+
type ButtonLinkProps = Omit<LinkProps, "onClick"> & {
110+
buttonProps?: ButtonProps
111111
customEventOptions?: MatomoEventOptions
112112
}
113113

114114
const ButtonLink = React.forwardRef<HTMLAnchorElement, ButtonLinkProps>(
115-
({ linkProps, customEventOptions, children, ...buttonProps }, ref) => {
115+
({ buttonProps, customEventOptions, children, ...linkProps }, ref) => {
116116
const handleClick = () => {
117117
customEventOptions && trackCustomEvent(customEventOptions)
118118
}

0 commit comments

Comments
 (0)