import React from 'react';
import { BrowserRouter as Router, Redirect, Route, Switch } from 'react-router-dom';

import IndexPageMain from './index/indexPage';
import RelayMain from './relay/main';
import RestfulMain from './restinpeace/restful';
import { NavBar } from './components/NavBar';

const MainPage = () => (
    <Router>
        <div>
            <NavBar />
            <header>
                <div>
                    <nav />
                </div>
            </header>

            <main>
                <Switch>
                    <Redirect exact from="/" to="/home" />
                    <Route exact path="/home" component={IndexPageMain} />
                    <Route path="/relay/:repo" component={RelayMain} />
                    <Route path="/restful/:userName/:repoName" component={RestfulMain} />
                    <Redirect from="/relay" to="/relay/lowsky/dashboard" />
                    <Redirect from="/restful" to="/restful/lowsky/dashboard" />
                </Switch>
            </main>
        </div>
    </Router>
);

export default MainPage;

@@ -5,16 +5,36 @@
 rt React
+, %7B lazy, Suspense %7D
  from 'r
@@ -184,23 +184,132 @@
 ort 
-RelayMain from 
+%7B NavBar %7D from './components/NavBar';%0Aimport %7B Spinner %7D from './components/Spinner';%0A%0Aconst RelayMain = lazy(() =%3E import(
 './r
@@ -318,23 +318,24 @@
 ay/main'
-;%0Aimpor
+));%0Acons
 t Restfu
@@ -340,21 +340,36 @@
 fulMain 
-from 
+= lazy(() =%3E import(
 './resti
@@ -387,54 +387,10 @@
 ful'
-;%0Aimport %7B NavBar %7D from './components/NavBar'
+))
 ;%0A%0Ac
@@ -595,24 +595,78 @@
      %3Cmain%3E%0A
+                %3CSuspense fallback=%7B%3CSpinner /%3E%7D%3E%0A    
             
@@ -670,32 +670,36 @@
        %3CSwitch%3E%0A
+    
                 
@@ -757,24 +757,28 @@
             
+    
 %3CRoute exact
@@ -832,32 +832,36 @@
                 
+ 
+   
 %3CRoute path=%22/re
@@ -888,32 +888,36 @@
 =%7BRelayMain%7D /%3E%0A
+    
                 
@@ -1002,32 +1002,36 @@
                 
+  
+  
 %3CRedirect from=%22
@@ -1062,32 +1062,36 @@
 y/dashboard%22 /%3E%0A
+    
                 
@@ -1170,16 +1170,20 @@
         
+    
 %3C/Switch
@@ -1176,32 +1176,60 @@
       %3C/Switch%3E%0A
+                %3C/Suspense%3E%0A
             %3C/ma

Split modules lazy loading (#705)