mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-19 07:54:23 +01:00
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
26 lines
905 B
TypeScript
26 lines
905 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
import { settingsAtom } from "@yaakapp-internal/models";
|
|
import { useAtomValue } from "jotai";
|
|
import { getResolvedTheme, getThemes } from "../lib/theme/themes";
|
|
import { usePluginsKey } from "./usePlugins";
|
|
import { usePreferredAppearance } from "./usePreferredAppearance";
|
|
|
|
export function useResolvedTheme() {
|
|
const preferredAppearance = usePreferredAppearance();
|
|
const settings = useAtomValue(settingsAtom);
|
|
const pluginKey = usePluginsKey();
|
|
return useQuery({
|
|
placeholderData: (prev) => prev,
|
|
queryKey: ["resolved_theme", preferredAppearance, settings.updatedAt, pluginKey],
|
|
queryFn: async () => {
|
|
const data = await getResolvedTheme(
|
|
preferredAppearance,
|
|
settings.appearance,
|
|
settings.themeLight,
|
|
settings.themeDark,
|
|
);
|
|
return { ...data, ...(await getThemes()) };
|
|
},
|
|
});
|
|
}
|