Skip to content

Commit

Permalink
Consolidate story types further
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentSmedinga committed Dec 20, 2024
1 parent 91c6552 commit 60d2523
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions storybook/src/components/Figure/Figure.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const meta = {
component: Figure,
args: {
children: caption,
inverseColor: false,
},
render: ({ children, ...args }) => (
<Figure>
Expand All @@ -28,21 +29,16 @@ const meta = {
<Figure.Caption {...args}>{children}</Figure.Caption>
</Figure>
),
} satisfies Meta<typeof Figure>
} satisfies Meta<typeof Figure.Caption>
// We use the Caption type here to allow inverseColor. This works as long as Figure has no props of its own.

export default meta

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const captionMeta = {
component: Figure.Caption,
} satisfies Meta<typeof Figure.Caption>

type Story = StoryObj<typeof meta>
type CaptionStory = StoryObj<typeof captionMeta>

export const Default: Story = {}

export const InverseColour: CaptionStory = {
export const InverseColour: Story = {
args: {
inverseColor: true,
},
Expand Down

0 comments on commit 60d2523

Please sign in to comment.