2021-01-18 02:18:49 +05:30
|
|
|
import React, { Suspense, useState } from "react";
|
|
|
|
|
import { Spin } from "antd";
|
|
|
|
|
import {
|
|
|
|
|
Route,
|
|
|
|
|
Switch,
|
2021-02-21 06:02:06 +05:30
|
|
|
Redirect
|
2021-01-18 02:18:49 +05:30
|
|
|
} from "react-router-dom";
|
2021-02-21 06:02:06 +05:30
|
|
|
import Signup from "./Signup";
|
|
|
|
|
const App = React.lazy(() => import("Src/components/App"));
|
2021-01-18 02:18:49 +05:30
|
|
|
|
|
|
|
|
const AppWrapper = () => {
|
|
|
|
|
|
2021-02-21 06:02:06 +05:30
|
|
|
console.log("other")
|
2021-01-18 02:18:49 +05:30
|
|
|
return (
|
2021-02-21 06:02:06 +05:30
|
|
|
<Suspense fallback={<Spin size="large"/>}>
|
|
|
|
|
<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} />
|
|
|
|
|
<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;
|