From 52076589ddb6dd6384b3dc1774b3dfe5dac76a9f Mon Sep 17 00:00:00 2001 From: c-bata Date: Fri, 16 Aug 2024 22:56:15 +0900 Subject: [PATCH] Remove PlotEdfDark.stories.tsx --- .../react/src/components/PlotEdf.stories.tsx | 19 +++++++-- .../src/components/PlotEdfDark.stories.tsx | 41 ------------------- 2 files changed, 16 insertions(+), 44 deletions(-) delete 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 index 2dacb490..b815591f 100644 --- a/tslib/react/src/components/PlotEdf.stories.tsx +++ b/tslib/react/src/components/PlotEdf.stories.tsx @@ -3,6 +3,7 @@ import { Meta, StoryObj } from "@storybook/react" import React from "react" import { useMockStudy } from "../MockStudies" import { lightTheme } from "../styles/lightTheme" +import { darkTheme } from "../styles/darkTheme" import { PlotEdf } from "./PlotEdf" const meta: Meta = { @@ -11,10 +12,14 @@ const meta: Meta = { tags: ["autodocs"], decorators: [ (Story, storyContext) => { - const { study } = useMockStudy(storyContext.parameters?.studyId) + const studyId = storyContext.parameters?.studyId; + const theme = storyContext.parameters?.theme; + + const { study } = useMockStudy(studyId) if (!study) return

loading...

+ return ( - + = { export default meta type Story = StoryObj -export const MockStudyExample1: Story = { +export const LightTheme: Story = { parameters: { studyId: 1, + theme: "light", + }, +} + +export const DarkTheme: Story = { + parameters: { + studyId: 1, + theme: "dark", }, } diff --git a/tslib/react/src/components/PlotEdfDark.stories.tsx b/tslib/react/src/components/PlotEdfDark.stories.tsx deleted file mode 100644 index 51b366c0..00000000 --- a/tslib/react/src/components/PlotEdfDark.stories.tsx +++ /dev/null @@ -1,41 +0,0 @@ -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, - }, -}