maputnik/src/components/Layout.jsx

65 lines
1.4 KiB
React
Raw Normal View History

2016-12-20 16:37:35 +01:00
import React from 'react'
2016-12-21 12:06:33 +01:00
import ScrollContainer from './ScrollContainer'
2016-12-20 16:37:35 +01:00
2016-12-21 14:46:51 +01:00
import theme from '../config/theme'
2016-12-20 16:37:35 +01:00
import colors from '../config/colors'
export default class Layout extends React.Component {
static propTypes = {
toolbar: React.PropTypes.element.isRequired,
layerList: React.PropTypes.element.isRequired,
layerEditor: React.PropTypes.element,
map: React.PropTypes.element.isRequired,
}
static childContextTypes = {
reactIconBase: React.PropTypes.object
}
getChildContext() {
return {
2016-12-21 15:08:04 +01:00
reactIconBase: { size: 14 }
2016-12-20 16:37:35 +01:00
}
}
render() {
return <div style={{
fontFamily: theme.fontFamily,
color: theme.color,
fontWeight: 300
}}>
{this.props.toolbar}
<div style={{
2016-12-21 12:06:33 +01:00
position: 'fixed',
2016-12-20 16:37:35 +01:00
bottom: 0,
height: "100%",
2016-12-20 20:36:02 +01:00
top: 40,
2016-12-20 16:37:35 +01:00
left: 0,
2016-12-21 12:06:33 +01:00
zIndex: 1,
2016-12-20 19:20:56 +01:00
width: 200,
2016-12-20 16:37:35 +01:00
overflow: "hidden",
2016-12-20 20:36:02 +01:00
backgroundColor: colors.black
2016-12-20 16:37:35 +01:00
}}>
2016-12-21 12:06:33 +01:00
<ScrollContainer>
{this.props.layerList}
</ScrollContainer>
2016-12-20 16:37:35 +01:00
</div>
<div style={{
2016-12-21 12:06:33 +01:00
position: 'fixed',
2016-12-20 16:37:35 +01:00
bottom: 0,
height: "100%",
2016-12-20 20:36:02 +01:00
top: 40,
2016-12-20 19:20:56 +01:00
left: 200,
2016-12-21 12:06:33 +01:00
zIndex: 1,
2016-12-20 16:37:35 +01:00
width: 300,
2016-12-20 20:36:02 +01:00
backgroundColor: colors.black
}}>
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}
</div>
}
}