mirror of
https://github.com/maputnik/editor.git
synced 2026-02-27 23:10:01 +00:00
Separate work space drawer
This commit is contained in:
33
src/workspace.jsx
Normal file
33
src/workspace.jsx
Normal file
@@ -0,0 +1,33 @@
|
||||
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>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user