mirror of
https://github.com/docmost/docmost.git
synced 2025-11-18 16:31:12 +10:00
63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
import "@mantine/core/styles.css";
|
|
import "@mantine/spotlight/styles.css";
|
|
import "@mantine/notifications/styles.css";
|
|
import ReactDOM from "react-dom/client";
|
|
import App from "./App.tsx";
|
|
import { mantineCssResolver, theme } from "@/theme";
|
|
import { MantineProvider } from "@mantine/core";
|
|
import { BrowserRouter } from "react-router-dom";
|
|
import { ModalsProvider } from "@mantine/modals";
|
|
import { Notifications } from "@mantine/notifications";
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
import { HelmetProvider } from "react-helmet-async";
|
|
import "./i18n";
|
|
import { PostHogProvider } from "posthog-js/react";
|
|
import {
|
|
getPostHogHost,
|
|
getPostHogKey,
|
|
isCloud,
|
|
isPostHogEnabled,
|
|
} from "@/lib/config.ts";
|
|
import posthog from "posthog-js";
|
|
|
|
export const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
refetchOnMount: false,
|
|
refetchOnWindowFocus: false,
|
|
retry: false,
|
|
staleTime: 5 * 60 * 1000,
|
|
},
|
|
},
|
|
});
|
|
|
|
if (isCloud() && isPostHogEnabled) {
|
|
posthog.init(getPostHogKey(), {
|
|
api_host: getPostHogHost(),
|
|
defaults: "2025-05-24",
|
|
disable_session_recording: true,
|
|
capture_pageleave: false,
|
|
});
|
|
}
|
|
|
|
const root = ReactDOM.createRoot(
|
|
document.getElementById("root") as HTMLElement,
|
|
);
|
|
|
|
root.render(
|
|
<BrowserRouter>
|
|
<MantineProvider theme={theme} cssVariablesResolver={mantineCssResolver}>
|
|
<ModalsProvider>
|
|
<QueryClientProvider client={queryClient}>
|
|
<Notifications position="bottom-center" limit={3} />
|
|
<HelmetProvider>
|
|
<PostHogProvider client={posthog}>
|
|
<App />
|
|
</PostHogProvider>
|
|
</HelmetProvider>
|
|
</QueryClientProvider>
|
|
</ModalsProvider>
|
|
</MantineProvider>
|
|
</BrowserRouter>,
|
|
);
|