|
@@ -1,27 +1,38 @@
|
|
-import React from "react";
|
|
|
|
|
|
+import React, { Suspense, lazy } from "react";
|
|
import { Switch, Route } from "react-router-dom";
|
|
import { Switch, Route } from "react-router-dom";
|
|
-// import AuthPage from './containers/AuthPage'
|
|
|
|
|
|
|
|
import * as routes from './constants/routes'
|
|
import * as routes from './constants/routes'
|
|
|
|
|
|
import Header from "./containers/Header"
|
|
import Header from "./containers/Header"
|
|
import landingPage from './components/landingPage'
|
|
import landingPage from './components/landingPage'
|
|
-import signInPage from './components/auth/signInPage'
|
|
|
|
import Footer from './components/footer'
|
|
import Footer from './components/footer'
|
|
-import signUpPage from "./components/auth/signUpPage";
|
|
|
|
-import notFound from "./components/notFound";
|
|
|
|
-import homePage from "./components/homePage";
|
|
|
|
|
|
+import Loader from 'react-loader-spinner'
|
|
|
|
+
|
|
|
|
+const notFound = lazy(() => import("./components/notFound"));
|
|
|
|
+const homePage = lazy(() => import("./components/homePage"));
|
|
|
|
+const signInPage = lazy(() => import("./components/auth/signInPage"));
|
|
|
|
+const signUpPage = lazy(() => import("./components/auth/signUpPage"));
|
|
|
|
+
|
|
|
|
|
|
export default () => (
|
|
export default () => (
|
|
- <div className="container">
|
|
|
|
- <Header />
|
|
|
|
- <Switch>
|
|
|
|
- <Route path={routes.LANDING} exact component={landingPage} />
|
|
|
|
- <Route path={routes.SIGN_IN} exact component={signInPage} />
|
|
|
|
- <Route path={routes.SIGN_UP} exact component={signUpPage} />
|
|
|
|
- <Route path={routes.HOME} exact component={homePage} />
|
|
|
|
- <Route component={notFound} />
|
|
|
|
- </Switch>
|
|
|
|
- <Footer />
|
|
|
|
- </div>
|
|
|
|
|
|
+ <Suspense fallback={
|
|
|
|
+ <Loader
|
|
|
|
+ type="Puff"
|
|
|
|
+ color="#00BFFF"
|
|
|
|
+ height="100"
|
|
|
|
+ width="100"
|
|
|
|
+ />
|
|
|
|
+ }>
|
|
|
|
+ <div className="container">
|
|
|
|
+ <Header />
|
|
|
|
+ <Switch>
|
|
|
|
+ <Route path={routes.LANDING} exact component={landingPage} />
|
|
|
|
+ <Route path={routes.SIGN_IN} exact component={signInPage} />
|
|
|
|
+ <Route path={routes.SIGN_UP} exact component={signUpPage} />
|
|
|
|
+ <Route path={routes.HOME} exact component={homePage} />
|
|
|
|
+ <Route component={notFound} />
|
|
|
|
+ </Switch>
|
|
|
|
+ <Footer />
|
|
|
|
+ </div>
|
|
|
|
+ </Suspense>
|
|
);
|
|
);
|