mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 19:35:52 +08:00
Merge pull request #157 from jyash97/fix/suspense-loader
fix: suspense for lazy loaded pages
This commit is contained in:
commit
c0004cd51c
@ -33,34 +33,41 @@ const App = () => {
|
|||||||
<Switch>
|
<Switch>
|
||||||
<RouteProvider>
|
<RouteProvider>
|
||||||
<BaseLayout>
|
<BaseLayout>
|
||||||
<Route path={ROUTES.SIGN_UP} exact component={Signup} />
|
<Suspense fallback={<Spin size="large" />}>
|
||||||
<Route path={ROUTES.APPLICATION} exact component={ServicesTable} />
|
<Route path={ROUTES.SIGN_UP} exact component={Signup} />
|
||||||
<Route path={ROUTES.SERVICE_METRICS} exact component={ServiceMetrics} />
|
<Route path={ROUTES.APPLICATION} exact component={ServicesTable} />
|
||||||
<Route path={ROUTES.SERVICE_MAP} exact component={ServiceMap} />
|
<Route
|
||||||
<Route path={ROUTES.TRACES} exact component={TraceDetail} />
|
path={ROUTES.SERVICE_METRICS}
|
||||||
<Route path={ROUTES.TRACE_GRAPH} exact component={TraceGraph} />
|
exact
|
||||||
<Route path={ROUTES.SETTINGS} exact component={SettingsPage} />
|
component={ServiceMetrics}
|
||||||
<Route
|
/>
|
||||||
path={ROUTES.INSTRUMENTATION}
|
<Route path={ROUTES.SERVICE_MAP} exact component={ServiceMap} />
|
||||||
exact
|
<Route path={ROUTES.TRACES} exact component={TraceDetail} />
|
||||||
component={IntstrumentationPage}
|
<Route path={ROUTES.TRACE_GRAPH} exact component={TraceGraph} />
|
||||||
/>
|
<Route path={ROUTES.SETTINGS} exact component={SettingsPage} />
|
||||||
<Route
|
<Route
|
||||||
path={ROUTES.USAGE_EXPLORER}
|
path={ROUTES.INSTRUMENTATION}
|
||||||
exact
|
exact
|
||||||
component={UsageExplorer}
|
component={IntstrumentationPage}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/"
|
path={ROUTES.USAGE_EXPLORER}
|
||||||
exact
|
exactexact
|
||||||
render={() => {
|
component={UsageExplorer}
|
||||||
return localStorage.getItem(IS_LOGGED_IN) === "yes" ? (
|
/>
|
||||||
<Redirect to={ROUTES.APPLICATION} />
|
<Route
|
||||||
) : (
|
path="/"
|
||||||
<Redirect to={ROUTES.SIGN_UP} />
|
exact
|
||||||
);
|
render={() => {
|
||||||
}}
|
return localStorage.getItem(IS_LOGGED_IN) === "yes" ? (
|
||||||
/>
|
<Redirect to={ROUTES.APPLICATION} />
|
||||||
|
) : (
|
||||||
|
<Redirect to={ROUTES.SIGN_UP} />
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Suspense>
|
||||||
|
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
</RouteProvider>
|
</RouteProvider>
|
||||||
</Switch>
|
</Switch>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user