feat(react/settings): port override theme fonts

This commit is contained in:
Elian Doran
2025-08-14 18:26:22 +03:00
parent ba6a1ec584
commit 83e1512b59
5 changed files with 27 additions and 44 deletions

View File

@@ -5,6 +5,7 @@ import SpacedUpdate from "../../services/spaced_update";
import { OptionNames } from "@triliumnext/commons";
import options from "../../services/options";
import utils, { reloadFrontendApp } from "../../services/utils";
import { __values } from "tslib";
/**
* Allows a React component to react to Trilium events (e.g. `entitiesReloaded`). When the desired event is triggered, the handler is invoked with the event parameters.
@@ -93,6 +94,14 @@ export function useTriliumOption(name: OptionNames, needsRefresh?: boolean): [st
]
}
export function useTriliumOptionBool(name: OptionNames): [boolean, (newValue: boolean) => Promise<void>] {
const [ value, setValue ] = useTriliumOption(name);
return [
(value === "true"),
(newValue) => setValue(newValue ? "true" : "false")
]
}
/**
* Generates a unique name via a random alphanumeric string of a fixed length.
*