mirror of
https://github.com/zadam/trilium.git
synced 2026-02-17 11:56:57 +01:00
feat(badges/content): add badge for app themes
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user