diff options
Diffstat (limited to 'renderer/src/components/SettingsPage.tsx')
| -rw-r--r-- | renderer/src/components/SettingsPage.tsx | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/renderer/src/components/SettingsPage.tsx b/renderer/src/components/SettingsPage.tsx index 7d06547..0c0c2e8 100644 --- a/renderer/src/components/SettingsPage.tsx +++ b/renderer/src/components/SettingsPage.tsx | |||
| @@ -4,15 +4,18 @@ import { GitSettings } from "./settings/GitSettings"; | |||
| 4 | import { ModelSettings } from "./settings/ModelSettings"; | 4 | import { ModelSettings } from "./settings/ModelSettings"; |
| 5 | import { McpSettings } from "./settings/McpSettings"; | 5 | import { McpSettings } from "./settings/McpSettings"; |
| 6 | 6 | ||
| 7 | type SettingsSection = "model" | "mcp" | "system-prompts" | "git"; | 7 | type Theme = "dark" | "light"; |
| 8 | type SettingsSection = "appearance" | "model" | "mcp" | "system-prompts" | "git"; | ||
| 8 | 9 | ||
| 9 | interface SettingsPageProps { | 10 | interface SettingsPageProps { |
| 10 | onClose: () => void; | 11 | onClose: () => void; |
| 12 | theme: Theme; | ||
| 13 | onToggleTheme: () => void; | ||
| 11 | } | 14 | } |
| 12 | 15 | ||
| 13 | export function SettingsPage({ onClose }: SettingsPageProps) { | 16 | export function SettingsPage({ onClose, theme, onToggleTheme }: SettingsPageProps) { |
| 14 | const [activeSection, setActiveSection] = | 17 | const [activeSection, setActiveSection] = |
| 15 | useState<SettingsSection>("model"); | 18 | useState<SettingsSection>("appearance"); |
| 16 | 19 | ||
| 17 | return ( | 20 | return ( |
| 18 | <div className="settings-overlay"> | 21 | <div className="settings-overlay"> |
| @@ -35,6 +38,14 @@ export function SettingsPage({ onClose }: SettingsPageProps) { | |||
| 35 | <nav className="settings-nav"> | 38 | <nav className="settings-nav"> |
| 36 | <button | 39 | <button |
| 37 | className={`settings-nav-item${ | 40 | className={`settings-nav-item${ |
| 41 | activeSection === "appearance" ? " active" : "" | ||
| 42 | }`} | ||
| 43 | onClick={() => setActiveSection("appearance")} | ||
| 44 | > | ||
| 45 | Appearance | ||
| 46 | </button> | ||
| 47 | <button | ||
| 48 | className={`settings-nav-item${ | ||
| 38 | activeSection === "model" ? " active" : "" | 49 | activeSection === "model" ? " active" : "" |
| 39 | }`} | 50 | }`} |
| 40 | onClick={() => setActiveSection("model")} | 51 | onClick={() => setActiveSection("model")} |
| @@ -69,6 +80,22 @@ export function SettingsPage({ onClose }: SettingsPageProps) { | |||
| 69 | 80 | ||
| 70 | {/* Content */} | 81 | {/* Content */} |
| 71 | <div className="settings-content"> | 82 | <div className="settings-content"> |
| 83 | {activeSection === "appearance" && ( | ||
| 84 | <div> | ||
| 85 | <div className="settings-section-title">Theme</div> | ||
| 86 | <div className="settings-section-desc"> | ||
| 87 | Choose between light and dark mode. | ||
| 88 | </div> | ||
| 89 | <div className="settings-toggle-row"> | ||
| 90 | <span className="settings-toggle-label"> | ||
| 91 | {theme === "dark" ? "Dark" : "Light"} | ||
| 92 | </span> | ||
| 93 | <button className="btn-secondary" onClick={onToggleTheme}> | ||
| 94 | Switch to {theme === "dark" ? "Light" : "Dark"} mode | ||
| 95 | </button> | ||
| 96 | </div> | ||
| 97 | </div> | ||
| 98 | )} | ||
| 72 | {activeSection === "model" && <ModelSettings />} | 99 | {activeSection === "model" && <ModelSettings />} |
| 73 | {activeSection === "mcp" && <McpSettings />} | 100 | {activeSection === "mcp" && <McpSettings />} |
| 74 | {activeSection === "system-prompts" && <SystemPromptsSettings />} | 101 | {activeSection === "system-prompts" && <SystemPromptsSettings />} |
