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 11import React from 'react' ;
2+ import PropTypes from 'prop-types' ;
3+ import styled from 'styled-components' ;
24
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 11import { Route , IndexRoute } from 'react-router' ;
22import React from 'react' ;
33import 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' ;
66import FullView from './modules/IDE/pages/FullView' ;
77import LoginView from './modules/User/pages/LoginView' ;
88import SignupView from './modules/User/pages/SignupView' ;
@@ -26,10 +26,11 @@ const onRouteChange = (store) => {
2626} ;
2727
2828const isMobile = ( ) => window . innerWidth <= 760 ;
29+ const IDEView = isMobile ( ) ? IDEViewMobileScreen : IDEViewScreen ;
2930
3031const routes = store => (
3132 < Route path = "/" component = { App } onChange = { ( ) => { onRouteChange ( store ) ; } } >
32- < IndexRoute component = { isMobile ( ) ? IDEViewMobile : IDEView } onEnter = { checkAuth ( store ) } />
33+ < IndexRoute component = { IDEView } onEnter = { checkAuth ( store ) } />
3334 < Route path = "/login" component = { userIsNotAuthenticated ( LoginView ) } />
3435 < Route path = "/signup" component = { userIsNotAuthenticated ( SignupView ) } />
3536 < Route path = "/reset-password" component = { userIsNotAuthenticated ( ResetPasswordView ) } />
You can’t perform that action at this time.
0 commit comments