mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
Remove PlotEdfDark.stories.tsx
This commit is contained in:
@@ -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<typeof PlotEdf> = {
|
||||
@@ -11,10 +12,14 @@ const meta: Meta<typeof PlotEdf> = {
|
||||
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 <p>loading...</p>
|
||||
|
||||
return (
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<ThemeProvider theme={theme === "light" ? lightTheme : darkTheme}>
|
||||
<CssBaseline />
|
||||
<Story
|
||||
args={{
|
||||
@@ -31,8 +36,16 @@ const meta: Meta<typeof PlotEdf> = {
|
||||
export default meta
|
||||
type Story = StoryObj<typeof PlotEdf>
|
||||
|
||||
export const MockStudyExample1: Story = {
|
||||
export const LightTheme: Story = {
|
||||
parameters: {
|
||||
studyId: 1,
|
||||
theme: "light",
|
||||
},
|
||||
}
|
||||
|
||||
export const DarkTheme: Story = {
|
||||
parameters: {
|
||||
studyId: 1,
|
||||
theme: "dark",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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<typeof PlotEdf> = {
|
||||
component: PlotEdf,
|
||||
title: "PlotEdfDark",
|
||||
tags: ["autodocs"],
|
||||
decorators: [
|
||||
(Story, storyContext) => {
|
||||
const { study } = useMockStudy(storyContext.parameters?.studyId)
|
||||
if (!study) return <p>loading...</p>
|
||||
return (
|
||||
<ThemeProvider theme={darkTheme}>
|
||||
<CssBaseline />
|
||||
<Story
|
||||
args={{
|
||||
studies: [study],
|
||||
objectiveId: 0,
|
||||
}}
|
||||
/>
|
||||
</ThemeProvider>
|
||||
)
|
||||
},
|
||||
],
|
||||
parameters: {
|
||||
backgrounds: { default: "dark" },
|
||||
},
|
||||
}
|
||||
|
||||
export default meta
|
||||
type Story = StoryObj<typeof PlotEdf>
|
||||
|
||||
export const MockStudyExample1: Story = {
|
||||
parameters: {
|
||||
studyId: 1,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user