@@ -2,6 +2,7 @@ import { Route, IndexRoute } from 'react-router';
2
2
import React from 'react' ;
3
3
import App from './modules/App/App' ;
4
4
import IDEView from './modules/IDE/pages/IDEView' ;
5
+ import IDEViewMobile from './modules/IDE/pages/IDEViewMobile' ;
5
6
import FullView from './modules/IDE/pages/FullView' ;
6
7
import LoginView from './modules/User/pages/LoginView' ;
7
8
import SignupView from './modules/User/pages/SignupView' ;
@@ -24,9 +25,11 @@ const onRouteChange = (store) => {
24
25
store . dispatch ( stopSketch ( ) ) ;
25
26
} ;
26
27
28
+ const isMobile = ( ) => window . innerWidth <= 760 ;
29
+
27
30
const routes = store => (
28
31
< Route path = "/" component = { App } onChange = { ( ) => { onRouteChange ( store ) ; } } >
29
- < IndexRoute component = { IDEView } onEnter = { checkAuth ( store ) } />
32
+ < IndexRoute component = { isMobile ( ) ? IDEViewMobile : IDEView } onEnter = { checkAuth ( store ) } />
30
33
< Route path = "/login" component = { userIsNotAuthenticated ( LoginView ) } />
31
34
< Route path = "/signup" component = { userIsNotAuthenticated ( SignupView ) } />
32
35
< Route path = "/reset-password" component = { userIsNotAuthenticated ( ResetPasswordView ) } />
@@ -49,6 +52,7 @@ const routes = store => (
49
52
< Route path = "/:username/collections/create" component = { DashboardView } />
50
53
< Route path = "/:username/collections/:collection_id" component = { CollectionView } />
51
54
< Route path = "/about" component = { IDEView } />
55
+
52
56
</ Route >
53
57
) ;
54
58
0 commit comments