mirror of
https://github.com/openclaw/clawhub.git
synced 2026-08-14 00:47:57 +00:00
fix: remove runtime devtools from app shell
This commit is contained in:
@@ -1,24 +1,13 @@
|
||||
import { createRootRoute, HeadContent, Scripts } from "@tanstack/react-router";
|
||||
import { Analytics } from "@vercel/analytics/react";
|
||||
import { lazy, Suspense } from "react";
|
||||
import { AppProviders } from "../components/AppProviders";
|
||||
import { ClientOnly } from "../components/ClientOnly";
|
||||
import { DeploymentDriftBanner } from "../components/DeploymentDriftBanner";
|
||||
import { Footer } from "../components/Footer";
|
||||
import Header from "../components/Header";
|
||||
import { isDevRuntime } from "../lib/runtimeEnv";
|
||||
import { getSiteDescription, getSiteMode, getSiteName, getSiteUrlForMode } from "../lib/site";
|
||||
import appCss from "../styles.css?url";
|
||||
|
||||
const TanStackDevtools = lazy(() =>
|
||||
import("@tanstack/react-devtools").then((module) => ({ default: module.TanStackDevtools })),
|
||||
);
|
||||
const TanStackRouterDevtoolsPanel = lazy(() =>
|
||||
import("@tanstack/react-router-devtools").then((module) => ({
|
||||
default: module.TanStackRouterDevtoolsPanel,
|
||||
})),
|
||||
);
|
||||
|
||||
export const Route = createRootRoute({
|
||||
head: () => {
|
||||
const mode = getSiteMode();
|
||||
@@ -126,21 +115,6 @@ function RootDocument({ children }: { children: React.ReactNode }) {
|
||||
</div>
|
||||
<ClientOnly>
|
||||
<Analytics />
|
||||
{isDevRuntime() ? (
|
||||
<Suspense fallback={null}>
|
||||
<TanStackDevtools
|
||||
config={{
|
||||
position: "bottom-right",
|
||||
}}
|
||||
plugins={[
|
||||
{
|
||||
name: "Tanstack Router",
|
||||
render: <TanStackRouterDevtoolsPanel />,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Suspense>
|
||||
) : null}
|
||||
</ClientOnly>
|
||||
</AppProviders>
|
||||
<Scripts />
|
||||
|
||||
Reference in New Issue
Block a user