File tree Expand file tree Collapse file tree 2 files changed +35
-6
lines changed Expand file tree Collapse file tree 2 files changed +35
-6
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
3
+ import styled from 'styled-components' ;
2
4
3
- export default ( ) => ( < div >
4
- < h1 > Test</ h1 >
5
- </ div > ) ; //eslint-disable-line
5
+ const Header = styled . div `
6
+ width: 100%;
7
+ color: orange;
8
+ background: red;
9
+ ` ;
10
+
11
+ const Footer = styled . div `
12
+ width: 100%;
13
+ color: orange;
14
+ background: blue;
15
+ position: absolute;
16
+ bottom: 0;
17
+ ` ;
18
+
19
+ const Screen = ( { children } ) => (
20
+ < div className = "fullscreen-preview" >
21
+ { children }
22
+ </ div >
23
+ ) ;
24
+ Screen . propTypes = {
25
+ children : PropTypes . element . isRequired
26
+ } ;
27
+
28
+ export default ( ) => (
29
+ < Screen >
30
+ < Header > < h1 > Test</ h1 > </ Header >
31
+ < Footer > < h1 > Actionbar</ h1 > </ Footer >
32
+ </ Screen >
33
+ ) ;
Original file line number Diff line number Diff line change 1
1
import { Route , IndexRoute } from 'react-router' ;
2
2
import React from 'react' ;
3
3
import App from './modules/App/App' ;
4
- import IDEView from './modules/IDE/pages/IDEView' ;
5
- import IDEViewMobile from './modules/IDE/pages/IDEViewMobile' ;
4
+ import IDEViewScreen from './modules/IDE/pages/IDEView' ;
5
+ import IDEViewMobileScreen from './modules/IDE/pages/IDEViewMobile' ;
6
6
import FullView from './modules/IDE/pages/FullView' ;
7
7
import LoginView from './modules/User/pages/LoginView' ;
8
8
import SignupView from './modules/User/pages/SignupView' ;
@@ -26,10 +26,11 @@ const onRouteChange = (store) => {
26
26
} ;
27
27
28
28
const isMobile = ( ) => window . innerWidth <= 760 ;
29
+ const IDEView = isMobile ( ) ? IDEViewMobileScreen : IDEViewScreen ;
29
30
30
31
const routes = store => (
31
32
< Route path = "/" component = { App } onChange = { ( ) => { onRouteChange ( store ) ; } } >
32
- < IndexRoute component = { isMobile ( ) ? IDEViewMobile : IDEView } onEnter = { checkAuth ( store ) } />
33
+ < IndexRoute component = { IDEView } onEnter = { checkAuth ( store ) } />
33
34
< Route path = "/login" component = { userIsNotAuthenticated ( LoginView ) } />
34
35
< Route path = "/signup" component = { userIsNotAuthenticated ( SignupView ) } />
35
36
< Route path = "/reset-password" component = { userIsNotAuthenticated ( ResetPasswordView ) } />
You can’t perform that action at this time.
0 commit comments