diff --git a/src/index.js b/src/index.js index c2a7231dd..8daa7db79 100644 --- a/src/index.js +++ b/src/index.js @@ -1,11 +1,24 @@ -import React from 'react' +import React, { Suspense } from 'react' import ReactDOM from 'react-dom' import { rootDomId } from 'client/util' -import App from './router' +import Loading from 'components/Loading' + import './client/websockets' import './css/global/index.scss' +const App = React.lazy(() => import('./router')) +const HyloEditorMobile = React.lazy(() => import('components/HyloEditor/HyloEditorMobile')) + ReactDOM.render( - , + window.location.pathname === '/hyloApp/editor' + ? ( + null}> + + + ) : ( + }> + + + ), document.getElementById(rootDomId) ) diff --git a/src/router/index.js b/src/router/index.js index 8d6aff4cd..4cead40b3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,13 +1,11 @@ import React from 'react' import { ConnectedRouter } from 'connected-react-router' -import { Switch, Route } from 'react-router' import { DndProvider } from 'react-dnd' import { HTML5Backend } from 'react-dnd-html5-backend' import { Provider } from 'react-redux' import { LayoutFlagsProvider } from 'contexts/LayoutFlagsContext' import createStore, { history } from '../store' import RootRouter from 'routes/RootRouter' -import HyloAppRouter from 'routes/HyloAppRouter' const store = createStore() @@ -19,10 +17,7 @@ export default function App () { - - - - + diff --git a/src/routes/HyloAppRouter/HyloAppRouter.js b/src/routes/HyloAppRouter/HyloAppRouter.js deleted file mode 100644 index 737a6d379..000000000 --- a/src/routes/HyloAppRouter/HyloAppRouter.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' -import { Route, Switch } from 'react-router-dom' -import HyloEditorMobile from 'components/HyloEditor/HyloEditorMobile' - -export default function HyloAppRouter () { - return ( - - ( - - )} - /> - - ) -} diff --git a/src/routes/HyloAppRouter/index.js b/src/routes/HyloAppRouter/index.js deleted file mode 100644 index 3e451ab23..000000000 --- a/src/routes/HyloAppRouter/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import component from './HyloAppRouter' - -export default component