@@ -2,6 +2,7 @@ import { Route, IndexRoute } from 'react-router';
22import React from 'react' ;
33import App from './modules/App/App' ;
44import IDEView from './modules/IDE/pages/IDEView' ;
5+ import IDEViewMobile from './modules/IDE/pages/IDEViewMobile' ;
56import FullView from './modules/IDE/pages/FullView' ;
67import LoginView from './modules/User/pages/LoginView' ;
78import SignupView from './modules/User/pages/SignupView' ;
@@ -24,9 +25,11 @@ const onRouteChange = (store) => {
2425 store . dispatch ( stopSketch ( ) ) ;
2526} ;
2627
28+ const isMobile = ( ) => window . innerWidth <= 760 ;
29+
2730const routes = store => (
2831 < Route path = "/" component = { App } onChange = { ( ) => { onRouteChange ( store ) ; } } >
29- < IndexRoute component = { IDEView } onEnter = { checkAuth ( store ) } />
32+ < IndexRoute component = { isMobile ( ) ? IDEViewMobile : IDEView } onEnter = { checkAuth ( store ) } />
3033 < Route path = "/login" component = { userIsNotAuthenticated ( LoginView ) } />
3134 < Route path = "/signup" component = { userIsNotAuthenticated ( SignupView ) } />
3235 < Route path = "/reset-password" component = { userIsNotAuthenticated ( ResetPasswordView ) } />
@@ -49,6 +52,7 @@ const routes = store => (
4952 < Route path = "/:username/collections/create" component = { DashboardView } />
5053 < Route path = "/:username/collections/:collection_id" component = { CollectionView } />
5154 < Route path = "/about" component = { IDEView } />
55+
5256 </ Route >
5357) ;
5458
0 commit comments