feat: add global theme toggle

This commit is contained in:
SethBurkart123
2025-03-30 08:49:13 +11:00
parent 6147e96cc9
commit 3ecd7205ed
14 changed files with 145 additions and 141 deletions
+2 -2
View File
@@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BetterSEQTA+ Settings</title>
</head>
<body>
<div id="app"></div>
<body class="h-[600px]">
<div id="app" style="height: 100%;"></div>
<script type="module" src="./index.ts"></script>
</body>
</html>
@@ -25,6 +25,7 @@
interface Plugin {
pluginId: string;
name: string;
description: string;
settings: Record<string, PluginSetting>;
}
@@ -78,6 +79,23 @@
pluginSettings.forEach(plugin => {
if (Object.keys(plugin.settings).length === 0) return;
// Add enable/disable toggle if plugin has disableToggle set
if ((plugin as any).disableToggle) {
entries.push({
title: `Enable ${plugin.name}`,
description: `${plugin.description}`,
id: getPluginSettingId(plugin.pluginId, 'enabled'),
Component: Switch,
props: {
state: pluginSettingsValues[plugin.pluginId]?.enabled ?? true,
onChange: (value: boolean) => {
updatePluginSetting(plugin.pluginId, 'enabled', value);
// The plugin manager will handle the actual enabling/disabling
}
}
});
}
Object.entries(plugin.settings).forEach(([key, setting]) => {
const id = getPluginSettingId(plugin.pluginId, key);