Skip to content

Commit ca0d953

Browse files
committed
⛏ create basic header and footer components
1 parent cb2f42d commit ca0d953

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed
Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
import 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+
);

client/routes.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Route, IndexRoute } from 'react-router';
22
import React from 'react';
33
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';
66
import FullView from './modules/IDE/pages/FullView';
77
import LoginView from './modules/User/pages/LoginView';
88
import SignupView from './modules/User/pages/SignupView';
@@ -26,10 +26,11 @@ const onRouteChange = (store) => {
2626
};
2727

2828
const isMobile = () => window.innerWidth <= 760;
29+
const IDEView = isMobile() ? IDEViewMobileScreen : IDEViewScreen;
2930

3031
const 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)} />

0 commit comments

Comments
 (0)