2019-08-13 14:47:40 +00:00
|
|
|
import React, { Suspense, lazy } from "react";
|
|
|
|
import { BrowserRouter, Route, Switch } from "react-router-dom";
|
|
|
|
import { Loader, ErrorContainer } from "asc-web-components";
|
|
|
|
import StudioLayout from "./components/Layout/Layout";
|
|
|
|
import Login from "./components/pages/Login/Login";
|
|
|
|
import Home from "./components/pages/Home/Home";
|
|
|
|
import { withTranslation } from 'react-i18next';
|
|
|
|
import { PrivateRoute } from "./helpers/privateRoute";
|
2019-06-04 11:55:15 +00:00
|
|
|
|
2019-08-13 14:47:40 +00:00
|
|
|
const About = lazy(() => import("./components/pages/About/About"));
|
2019-05-15 14:56:09 +00:00
|
|
|
|
2019-08-13 14:47:40 +00:00
|
|
|
const App = ({t}) => {
|
|
|
|
return (
|
|
|
|
<BrowserRouter>
|
|
|
|
<StudioLayout>
|
|
|
|
<Suspense
|
|
|
|
fallback={<Loader className="pageLoader" type="rombs" size={40} />}
|
|
|
|
>
|
|
|
|
<Switch>
|
|
|
|
<Route exact path="/login" component={Login} />
|
|
|
|
<PrivateRoute exact path="/" component={Home} />
|
|
|
|
<PrivateRoute exact path="/about" component={About} />
|
|
|
|
<PrivateRoute
|
|
|
|
component={() => (
|
|
|
|
<ErrorContainer>
|
|
|
|
{t('ResourceNotFound')}
|
|
|
|
</ErrorContainer>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
</Switch>
|
|
|
|
</Suspense>
|
|
|
|
</StudioLayout>
|
|
|
|
</BrowserRouter>
|
|
|
|
);
|
2019-05-15 14:56:09 +00:00
|
|
|
};
|
|
|
|
|
2019-08-13 14:47:40 +00:00
|
|
|
export default withTranslation()(App);
|