Skip to content

Commit 628c4fe

Browse files
Add PlotTimeline.stories.tsx
1 parent d291d79 commit 628c4fe

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { CssBaseline, ThemeProvider } from "@mui/material"
2+
import { Meta, StoryObj } from "@storybook/react"
3+
import React from "react"
4+
import { useMockStudy } from "../MockStudies"
5+
import { darkTheme } from "../styles/darkTheme"
6+
import { lightTheme } from "../styles/lightTheme"
7+
import { PlotTimeline } from "./PlotTimeline"
8+
9+
const meta: Meta<typeof PlotTimeline> = {
10+
component: PlotTimeline,
11+
title: "Plot/Timeline",
12+
tags: ["autodocs"],
13+
decorators: [
14+
(Story, storyContext) => {
15+
const { study } = useMockStudy(storyContext.parameters?.studyId)
16+
if (!study) return <p>loading...</p>
17+
return (
18+
<ThemeProvider theme={storyContext.parameters?.theme}>
19+
<CssBaseline />
20+
<Story
21+
args={{
22+
study,
23+
}}
24+
/>
25+
</ThemeProvider>
26+
)
27+
},
28+
],
29+
}
30+
31+
export default meta
32+
type Story = StoryObj<typeof PlotTimeline>
33+
34+
export const LightTheme: Story = {
35+
parameters: {
36+
studyId: 1,
37+
theme: lightTheme,
38+
},
39+
}
40+
41+
export const DarkTheme: Story = {
42+
parameters: {
43+
studyId: 1,
44+
theme: darkTheme,
45+
},
46+
}
47+
48+
// TODO(c-bata): Add a story for multi objective study.
49+
// export const MultiObjective: Story = {
50+
// parameters: {
51+
// ...
52+
// },
53+
// }

0 commit comments

Comments
 (0)