feat(badges/content): add badge for app themes

This commit is contained in:
Elian Doran
2026-02-15 12:37:37 +02:00
parent 1588c8103c
commit b72b82ff1a
2 changed files with 9 additions and 2 deletions

View File

@@ -2297,6 +2297,7 @@
"type_app_css": "Custom CSS",
"type_render_note": "Render note",
"type_web_view": "Web view",
"type_app_theme": "Custom theme",
"toggle_tooltip_enable_tooltip": "Click to enable this {{type}}.",
"toggle_tooltip_disable_tooltip": "Click to disable this {{type}}.",
"menu_docs": "Open documentation",

View File

@@ -12,10 +12,10 @@ import FormToggle from "../react/FormToggle";
import { useNoteContext, useNoteLabel, useNoteLabelBoolean, useTriliumEvent } from "../react/hooks";
const DANGEROUS_ATTRIBUTES = BUILTIN_ATTRIBUTES.filter(a => a.isDangerous || a.name === "appCss");
const activeContentLabels = [ "iconPack", "widget", "appCss" ] as const;
const activeContentLabels = [ "iconPack", "widget", "appCss", "appTheme" ] as const;
interface ActiveContentInfo {
type: "iconPack" | "backendScript" | "frontendScript" | "widget" | "appCss" | "renderNote" | "webView";
type: "iconPack" | "backendScript" | "frontendScript" | "widget" | "appCss" | "renderNote" | "webView" | "appTheme";
isEnabled: boolean;
canToggleEnabled: boolean;
}
@@ -57,6 +57,10 @@ const typeMappings: Record<ActiveContentInfo["type"], {
webView: {
icon: "bx bx-globe",
helpPage: "1vHRoWCEjj0L"
},
appTheme: {
icon: "bx bx-palette",
helpPage: "7NfNr5pZpVKV"
}
};
@@ -201,6 +205,8 @@ function getTranslationForType(type: ActiveContentInfo["type"]) {
return t("active_content_badges.type_render_note");
case "webView":
return t("active_content_badges.type_web_view");
case "appTheme":
return t("active_content_badges.type_app_theme");
}
}