mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-30 01:04:42 +01:00
34 lines
841 B
React
34 lines
841 B
React
|
import React from 'react'
|
||
|
import { LayerEditor } from './layers.jsx'
|
||
|
import theme from './theme.js'
|
||
|
|
||
|
/** The workspace drawer contains the editor components depending on the context
|
||
|
* chosen in the toolbar. */
|
||
|
export class WorkspaceDrawer extends React.Component {
|
||
|
static propTypes = {
|
||
|
workContext: React.PropTypes.oneOf(['layers', 'settings']).isRequired,
|
||
|
styleManager: React.PropTypes.object.isRequired
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
let workspaceContent = null
|
||
|
|
||
|
if(this.props.workContext === "layers" && this.props.styleManager.mapStyle) {
|
||
|
workspaceContent = <LayerEditor styleManager={this.props.styleManager}/>
|
||
|
}
|
||
|
|
||
|
return <div style={{
|
||
|
zIndex: 100,
|
||
|
position: "fixed",
|
||
|
left: 60,
|
||
|
width: 300,
|
||
|
top: 0,
|
||
|
bottom: 0,
|
||
|
overflow: "hidden",
|
||
|
backgroundColor: theme.colors.gray}
|
||
|
}>
|
||
|
{workspaceContent}
|
||
|
</div>
|
||
|
}
|
||
|
}
|