From 2383310e899faeaf205f425700afbea2e9af152a Mon Sep 17 00:00:00 2001 From: porink0424 Date: Wed, 12 Jun 2024 17:29:23 +0900 Subject: [PATCH] Add stories of PlotEdf --- .../react/src/components/PlotEdf.stories.tsx | 38 +++++++++++++++++ .../src/components/PlotEdfDark.stories.tsx | 41 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 tslib/react/src/components/PlotEdf.stories.tsx create mode 100644 tslib/react/src/components/PlotEdfDark.stories.tsx diff --git a/tslib/react/src/components/PlotEdf.stories.tsx b/tslib/react/src/components/PlotEdf.stories.tsx new file mode 100644 index 00000000..2dacb490 --- /dev/null +++ b/tslib/react/src/components/PlotEdf.stories.tsx @@ -0,0 +1,38 @@ +import { CssBaseline, ThemeProvider } from "@mui/material" +import { Meta, StoryObj } from "@storybook/react" +import React from "react" +import { useMockStudy } from "../MockStudies" +import { lightTheme } from "../styles/lightTheme" +import { PlotEdf } from "./PlotEdf" + +const meta: Meta = { + component: PlotEdf, + title: "PlotEdf", + tags: ["autodocs"], + decorators: [ + (Story, storyContext) => { + const { study } = useMockStudy(storyContext.parameters?.studyId) + if (!study) return

loading...

+ return ( + + + + + ) + }, + ], +} + +export default meta +type Story = StoryObj + +export const MockStudyExample1: Story = { + parameters: { + studyId: 1, + }, +} diff --git a/tslib/react/src/components/PlotEdfDark.stories.tsx b/tslib/react/src/components/PlotEdfDark.stories.tsx new file mode 100644 index 00000000..3fca1506 --- /dev/null +++ b/tslib/react/src/components/PlotEdfDark.stories.tsx @@ -0,0 +1,41 @@ +import { CssBaseline, ThemeProvider } from "@mui/material" +import { Meta, StoryObj } from "@storybook/react" +import React from "react" +import { useMockStudy } from "../MockStudies" +import { darkTheme } from "../styles/darkTheme" +import { PlotEdf } from "./PlotEdf" + +const meta: Meta = { + component: PlotEdf, + title: "PlotEdfDark", + tags: ["autodocs"], + decorators: [ + (Story, storyContext) => { + const { study } = useMockStudy(storyContext.parameters?.studyId) + if (!study) return

loading...

+ return ( + + + + + ) + }, + ], + parameters: { + backgrounds: { default: "dark" }, + }, +} + +export default meta +type Story = StoryObj + +export const MockStudyExample1: Story = { + parameters: { + studyId: 1, + }, +}