mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Initial scaffold: spec, architecture playbook, and M0 skeleton
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { App } from './app/App';
|
||||
import { useAppStore } from './app/stores/AppStore';
|
||||
import '../styles/base.css';
|
||||
|
||||
// Mirror the UI theme onto <html data-theme>: apply the initial value before
|
||||
// first paint, then keep it in sync. (Store stays DOM-free; the adapter is here.)
|
||||
const applyTheme = (theme: string) => {
|
||||
document.documentElement.dataset.theme = theme;
|
||||
};
|
||||
applyTheme(useAppStore.getState().uiTheme);
|
||||
useAppStore.subscribe((state, prev) => {
|
||||
if (state.uiTheme !== prev.uiTheme) applyTheme(state.uiTheme);
|
||||
});
|
||||
|
||||
createRoot(document.getElementById('app')!).render(<App />);
|
||||
Reference in New Issue
Block a user