mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-13 12:13:42 +01:00
36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
import { applyThemeToDocument, defaultDarkTheme, defaultLightTheme } from "@yaakapp-internal/theme";
|
|
import { createStore, Provider } from "jotai";
|
|
import { StrictMode } from "react";
|
|
import { createRoot } from "react-dom/client";
|
|
import { installFixtureBackend } from "./backend";
|
|
import { FlowPanesHarness } from "./FlowPanesHarness";
|
|
import { installLockedBackend, LockedHarness } from "./LockedHarness";
|
|
import { MessagesHarness } from "./MessagesHarness";
|
|
import { SettingsHarness } from "./SettingsHarness";
|
|
import "../main.css";
|
|
|
|
const params = new URLSearchParams(location.search);
|
|
const dark = params.get("theme") !== "light";
|
|
applyThemeToDocument(dark ? defaultDarkTheme : defaultLightTheme);
|
|
if (params.has("locked")) installLockedBackend();
|
|
else installFixtureBackend();
|
|
|
|
createRoot(document.getElementById("root") as HTMLElement).render(
|
|
<StrictMode>
|
|
<QueryClientProvider client={new QueryClient()}>
|
|
<Provider store={createStore()}>
|
|
{params.has("locked") || params.has("window") ? (
|
|
<LockedHarness />
|
|
) : params.has("settings") ? (
|
|
<SettingsHarness />
|
|
) : params.has("stream") ? (
|
|
<MessagesHarness />
|
|
) : (
|
|
<FlowPanesHarness />
|
|
)}
|
|
</Provider>
|
|
</QueryClientProvider>
|
|
</StrictMode>,
|
|
);
|