전 저장소 리팩터링과 SSOT 정비

This commit is contained in:
Yun Chan 2026-07-15 21:31:30 +09:00
parent 14ecbd4e7d
commit 3dfddcac6f
173 changed files with 19679 additions and 6952 deletions

View file

@ -0,0 +1,17 @@
import { useCallback, useSyncExternalStore } from "react";
import {
applyTheme,
readAppliedTheme,
subscribeTheme,
type AppTheme,
} from "./theme";
/**
* hook. Topbar와 Settings가 external store를 .
* Settings ([dark, setDark]) .
*/
export function useTheme(): [boolean, (next: boolean) => void] {
const theme = useSyncExternalStore(subscribeTheme, readAppliedTheme, (): AppTheme => "dark");
const setDark = useCallback((next: boolean) => applyTheme(next ? "dark" : "light"), []);
return [theme === "dark", setDark];
}