-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stories for InfoBox component with default and dark mode variants
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import type { Meta, StoryObj } from "@storybook/react" | ||
|
||
import { darkModeDecorator } from "@/.storybook/decorators" | ||
import InfoBox from "@/components/shared/infoBox/InfoBox" | ||
import manifestationMock from "@/lib/mocks/manifestation/infoBox.mock" | ||
import workMock from "@/lib/mocks/work/infoBox.mock" | ||
import { useSelectedManifestationStore } from "@/store/selectedManifestation.store" | ||
|
||
const meta = { | ||
title: "components/InfoBox", | ||
component: InfoBox, | ||
parameters: { | ||
layout: "centered", | ||
}, | ||
decorators: [ | ||
Story => { | ||
// Set Zustand state before rendering the story | ||
const { setSelectedManifestation } = useSelectedManifestationStore.getState() | ||
setSelectedManifestation(manifestationMock) | ||
|
||
return ( | ||
<div className="content-container my-grid-gap-2 flex-row flex-wrap lg:my-grid-gap-half"> | ||
<Story /> | ||
</div> | ||
) | ||
}, | ||
], | ||
argTypes: { | ||
work: { | ||
control: { type: "object" }, | ||
}, | ||
}, | ||
args: { | ||
work: workMock, | ||
}, | ||
} satisfies Meta<typeof InfoBox> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Default: Story = { | ||
render: args => <InfoBox {...args} />, | ||
} | ||
|
||
export const DarkMode: Story = { | ||
decorators: [darkModeDecorator], | ||
render: args => <InfoBox {...args} />, | ||
} |