maputnik/src/components/AppLayout.jsx

81 lines
1.8 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'
2016-12-25 17:46:18 +01:00
import { fontSizes } from '../config/scales'
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: React.PropTypes.element.isRequired,
layerList: React.PropTypes.element.isRequired,
layerEditor: React.PropTypes.element,
map: React.PropTypes.element.isRequired,
bottom: React.PropTypes.element,
2016-12-20 16:37:35 +01:00
}
static childContextTypes = {
reactIconBase: React.PropTypes.object
}
getChildContext() {
return {
2016-12-25 17:46:18 +01:00
reactIconBase: { size: fontSizes[3] }
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-26 11:22:41 +01:00
width: 350,
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}
{this.props.bottom && <div style={{
position: 'fixed',
height: 50,
bottom: 0,
left: 550,
zIndex: 1,
width: '100%',
backgroundColor: colors.black
}}>
{this.props.bottom}
</div>
}
2016-12-20 16:37:35 +01:00
</div>
}
}
2016-12-22 16:39:09 +01:00
export default AppLayout