maputnik/src/components/AppLayout.jsx

49 lines
1.1 KiB
React
Raw Normal View History

2016-12-20 16:37:35 +01:00
import React from 'react'
import PropTypes from 'prop-types'
2016-12-21 12:06:33 +01:00
import ScrollContainer from './ScrollContainer'
2016-12-20 16:37:35 +01:00
2016-12-22 16:39:09 +01:00
class AppLayout extends React.Component {
2016-12-20 16:37:35 +01:00
static propTypes = {
toolbar: PropTypes.element.isRequired,
layerList: PropTypes.element.isRequired,
layerEditor: PropTypes.element,
map: PropTypes.element.isRequired,
bottom: PropTypes.element,
2018-06-03 11:00:50 +02:00
modals: PropTypes.node,
2016-12-20 16:37:35 +01:00
}
static childContextTypes = {
reactIconBase: PropTypes.object
2016-12-20 16:37:35 +01:00
}
getChildContext() {
return {
2017-01-11 14:11:45 +01:00
reactIconBase: { size: 14 }
2016-12-20 16:37:35 +01:00
}
}
render() {
2017-01-10 21:28:30 +01:00
return <div className="maputnik-layout">
2016-12-20 16:37:35 +01:00
{this.props.toolbar}
2017-01-10 21:28:30 +01:00
<div className="maputnik-layout-list">
2016-12-21 12:06:33 +01:00
<ScrollContainer>
{this.props.layerList}
</ScrollContainer>
2016-12-20 16:37:35 +01:00
</div>
2017-01-10 21:28:30 +01:00
<div className="maputnik-layout-drawer">
2016-12-21 12:06:33 +01:00
<ScrollContainer>
{this.props.layerEditor}
</ScrollContainer>
2016-12-20 16:37:35 +01:00
</div>
{this.props.map}
2017-01-10 21:28:30 +01:00
{this.props.bottom && <div className="maputnik-layout-bottom">
{this.props.bottom}
</div>
}
{this.props.modals}
2016-12-20 16:37:35 +01:00
</div>
}
}
2016-12-22 16:39:09 +01:00
export default AppLayout