From 372f4fc64890984f10e3f4cf3933328bccdf989e Mon Sep 17 00:00:00 2001 From: porink0424 Date: Wed, 14 Feb 2024 10:12:07 +0900 Subject: [PATCH] Remove redundant repetitions --- optuna_dashboard/ts/components/Settings.tsx | 42 +++++++++++++-------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/optuna_dashboard/ts/components/Settings.tsx b/optuna_dashboard/ts/components/Settings.tsx index 50ad1213..6b58453d 100644 --- a/optuna_dashboard/ts/components/Settings.tsx +++ b/optuna_dashboard/ts/components/Settings.tsx @@ -55,7 +55,7 @@ export const Settings = ({ handleClose }: SettingsProps) => { Settings @@ -76,9 +76,16 @@ export const Settings = ({ handleClose }: SettingsProps) => { value={plotlyColorTheme.dark} onChange={handleDarkModeColorChange} > - - Default - + {( + [{ value: "default", label: "Default" }] as { + value: PlotlyColorThemeDark + label: string + }[] + ).map((v) => ( + + {v.label} + + ))} @@ -92,18 +99,21 @@ export const Settings = ({ handleClose }: SettingsProps) => { value={plotlyColorTheme.light} onChange={handleLightModeColorChange} > - - Default - - - Seaborn - - - Presentation - - - GGPlot2 - + {( + [ + { value: "default", label: "Default" }, + { value: "seaborn", label: "Seaborn" }, + { value: "presentation", label: "Presentation" }, + { value: "ggplot2", label: "GGPlot2" }, + ] as { + value: PlotlyColorThemeLight + label: string + }[] + ).map((v) => ( + + {v.label} + + ))} )}