11import { Route , IndexRoute } from 'react-router' ;
22import React from 'react' ;
33import App from './modules/App/App' ;
4- import IDEViewScreen from './modules/IDE/pages/IDEView' ;
5- import IDEViewMobileScreen from './modules/IDE/pages/IDEViewMobile' ;
4+ import IDEView from './modules/IDE/pages/IDEView' ;
5+ import IDEViewMobile from './modules/IDE/pages/IDEViewMobile' ;
66import FullView from './modules/IDE/pages/FullView' ;
77import LoginView from './modules/User/pages/LoginView' ;
88import SignupView from './modules/User/pages/SignupView' ;
@@ -25,11 +25,12 @@ const onRouteChange = (store) => {
2525 store . dispatch ( stopSketch ( ) ) ;
2626} ;
2727
28- const ignoreMobile = ( ) => window . location . search . substring ( 1 ) . includes ( 'ignoremobile' ) ;
29-
30- const isMobile = ( ) => window . innerWidth <= 760 ;
31- const IDEView = isMobile ( ) && ! ignoreMobile ( ) ? IDEViewMobileScreen : IDEViewScreen ;
28+ // TODO: Investigate using react-router for this switch
29+ // const ignoreMobile = () => window.location.search.substring(1).includes('ignoremobile');
30+ // const isMobile = () => window.innerWidth <= 760;
31+ // const IDEView = isMobile() && !ignoreMobile() ? IDEViewMobileScreen : IDEViewScreen;
3232
33+ // How to use URL as a prop?
3334const routes = store => (
3435 < Route path = "/" component = { App } onChange = { ( ) => { onRouteChange ( store ) ; } } >
3536 < IndexRoute component = { IDEView } onEnter = { checkAuth ( store ) } />
@@ -55,6 +56,7 @@ const routes = store => (
5556 < Route path = "/:username/collections/create" component = { DashboardView } />
5657 < Route path = "/:username/collections/:collection_id" component = { CollectionView } />
5758 < Route path = "/about" component = { IDEView } />
59+ < Route path = "/mobile" component = { IDEViewMobile } />
5860
5961 </ Route >
6062) ;
0 commit comments