mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-02-06 05:30:07 +00:00
perf: use websocket context
This commit is contained in:
29
src/main.tsx
29
src/main.tsx
@@ -7,6 +7,7 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { Toaster } from "sonner";
|
||||
import { MotionProvider } from "./components/motion/motion-provider";
|
||||
import { WebSocketProvider } from "./context/websocket-provider";
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
@@ -15,19 +16,21 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||
<MotionProvider>
|
||||
<ThemeProvider storageKey="vite-ui-theme">
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<App />
|
||||
<Toaster
|
||||
duration={1000}
|
||||
toastOptions={{
|
||||
classNames: {
|
||||
default:
|
||||
"w-fit rounded-full px-2.5 py-1.5 bg-neutral-100 border border-neutral-200 backdrop-blur-xl shadow-none",
|
||||
},
|
||||
}}
|
||||
position="top-center"
|
||||
className={"flex items-center justify-center"}
|
||||
/>
|
||||
<ReactQueryDevtools />
|
||||
<WebSocketProvider url="/api/v1/ws/server">
|
||||
<App />
|
||||
<Toaster
|
||||
duration={1000}
|
||||
toastOptions={{
|
||||
classNames: {
|
||||
default:
|
||||
"w-fit rounded-full px-2.5 py-1.5 bg-neutral-100 border border-neutral-200 backdrop-blur-xl shadow-none",
|
||||
},
|
||||
}}
|
||||
position="top-center"
|
||||
className={"flex items-center justify-center"}
|
||||
/>
|
||||
<ReactQueryDevtools />
|
||||
</WebSocketProvider>
|
||||
</QueryClientProvider>
|
||||
</ThemeProvider>
|
||||
</MotionProvider>
|
||||
|
||||
Reference in New Issue
Block a user