2021-04-24 02:29:12 +05:30
|
|
|
import React, { Suspense } from "react";
|
2021-01-18 02:18:49 +05:30
|
|
|
import { Spin } from "antd";
|
2021-02-21 06:23:56 +05:30
|
|
|
import { Route, Switch, Redirect } from "react-router-dom";
|
2021-04-24 02:29:12 +05:30
|
|
|
import Signup from "./Auth/Signup";
|
|
|
|
|
const App = React.lazy(() => import("Src/modules/App"));
|
2021-01-18 02:18:49 +05:30
|
|
|
|
|
|
|
|
const AppWrapper = () => {
|
|
|
|
|
return (
|
2021-02-21 06:23:56 +05:30
|
|
|
<Suspense fallback={<Spin size="large" />}>
|
2021-02-21 06:02:06 +05:30
|
|
|
<Switch>
|
|
|
|
|
<Route path="/application" exact component={App} />
|
|
|
|
|
<Route path="/application/:servicename" component={App} />
|
|
|
|
|
<Route path="/service-map" component={App} />
|
|
|
|
|
<Route path="/traces" exact component={App} />
|
|
|
|
|
<Route path="/traces/:id" component={App} />
|
|
|
|
|
<Route path="/usage-explorer" component={App} />
|
|
|
|
|
<Route path="/settings" component={App} />
|
2021-02-22 05:14:59 +05:30
|
|
|
<Route path="/add-instrumentation" component={App} />
|
2021-02-21 06:02:06 +05:30
|
|
|
<Route path="/signup" component={Signup} />
|
|
|
|
|
<Route
|
|
|
|
|
path="/"
|
|
|
|
|
exact
|
|
|
|
|
render={() => {
|
|
|
|
|
return localStorage.getItem("isLoggedIn") === "yes" ? (
|
|
|
|
|
<Redirect to="/application" />
|
|
|
|
|
) : (
|
|
|
|
|
<Redirect to="/signup" />
|
|
|
|
|
);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Switch>
|
|
|
|
|
</Suspense>
|
2021-01-18 02:18:49 +05:30
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default AppWrapper;
|