Skip to content

Commit 5a2c361

Browse files
refactor(tailwind/Button): replace override story with ButtonLink story
1 parent 417c803 commit 5a2c361

File tree

3 files changed

+22
-27
lines changed

3 files changed

+22
-27
lines changed

tailwind/ui/__stories__/Button.stories.tsx

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import { MdChevronRight, MdExpandMore, MdNightlight } from "react-icons/md"
1+
import { MdChevronRight, MdExpandMore } from "react-icons/md"
22
import type { Meta, StoryObj } from "@storybook/react"
33

4-
import Translation from "@/components/Translation"
5-
64
import { HStack, VStack } from "../../../src/components/ui/flex"
7-
import { Button, ButtonLink, type ButtonVariantProps } from "../buttons/Button"
5+
import { Button, type ButtonVariantProps } from "../buttons/Button"
86

97
const meta = {
108
title: "Atoms / Form / ShadCn Buttons",
@@ -104,25 +102,3 @@ export const MultiLineText: Story = {
104102
</HStack>
105103
),
106104
}
107-
108-
export const OverrideStyles: Story = {
109-
render: () => (
110-
<>
111-
<p>
112-
Show custom styling examples here for visual testing of overrides from
113-
the theme config
114-
</p>
115-
<VStack>
116-
<Button aria-label="toggle" className="px-1.5">
117-
<MdNightlight />
118-
</Button>
119-
<ButtonLink
120-
className="min-h-0 rounded-full px-0 py-0"
121-
linkProps={{ href: "#" }}
122-
>
123-
<Translation id="get-involved" />
124-
</ButtonLink>
125-
</VStack>
126-
</>
127-
),
128-
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { Meta, StoryObj } from "@storybook/react/*"
2+
3+
import { ButtonLink as ButtonLinkComponent } from "../buttons/Button"
4+
5+
const meta = {
6+
title: "Atoms / Form / ShadCn Buttons",
7+
component: ButtonLinkComponent,
8+
} satisfies Meta<typeof ButtonLinkComponent>
9+
10+
export default meta
11+
12+
export const ButtonLink: StoryObj<typeof meta> = {
13+
args: {
14+
linkProps: {
15+
href: "#",
16+
},
17+
children: "What is Ethereum?",
18+
},
19+
}

tailwind/ui/buttons/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
107107
Button.displayName = "Button"
108108

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

0 commit comments

Comments
 (0)