Last active
November 17, 2015 22:12
-
-
Save michaltakac/63dc8d7c5a96b2085676 to your computer and use it in GitHub Desktop.
Meteorboard Main layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './theme.less'; | |
import Component from 'react-pure-render/component'; | |
import {Grid, Row, Col} from 'react-bootstrap'; | |
import Header from './Header.react'; | |
import Sidebar from './components/Sidebar.react'; | |
import React, {PropTypes} from 'react'; | |
import RouterHandler from '../../common/components/RouterHandler.react'; | |
import mapDispatchToProps from '../../common/app/mapDispatchToProps'; | |
import mapStateToProps from '../../common/app/mapStateToProps'; | |
import {connect} from 'react-redux'; | |
@connect(mapStateToProps, mapDispatchToProps) | |
export default class App extends Component { | |
static propTypes = { | |
actions: PropTypes.object.isRequired, | |
children: PropTypes.object.isRequired, | |
location: PropTypes.object.isRequired, | |
msg: PropTypes.object.isRequired, | |
ui: PropTypes.object.isRequired, | |
users: PropTypes.object.isRequired | |
} | |
render() { | |
const {location: {pathname}, msg, users: {viewer}, ui, actions} = this.props; | |
return ( | |
<div> | |
{/* Pass data-pathname to allow route specific styling. */} | |
<Header actions={actions} msg={msg} pathname={pathname} ui={ui} viewer={viewer} /> | |
<Sidebar location={pathname} ui={ui} /> | |
<section id='page'> | |
<div id='main-content'> | |
<Grid> | |
<Row> | |
<Col id='content' lg={12}> | |
<Row> | |
<Col md={12}> | |
<RouterHandler {...this.props} /> | |
</Col> | |
</Row> | |
</Col> | |
</Row> | |
</Grid> | |
</div> | |
</section> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment