mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 17:01:16 +01:00
Render modals directly inplace
This commit is contained in:
parent
bc30327299
commit
607e920548
1 changed files with 17 additions and 23 deletions
|
@ -110,28 +110,6 @@ export default class Toolbar extends React.Component {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
renderModals() {
|
|
||||||
return [
|
|
||||||
<SettingsModal
|
|
||||||
mapStyle={this.props.mapStyle}
|
|
||||||
onStyleChanged={this.props.onStyleChanged}
|
|
||||||
isOpen={this.state.isOpen.settings}
|
|
||||||
onOpenToggle={this.toggleModal.bind(this, 'settings')}
|
|
||||||
/>,
|
|
||||||
<OpenModal
|
|
||||||
isOpen={this.state.isOpen.open}
|
|
||||||
onStyleOpen={this.props.onStyleOpen}
|
|
||||||
onOpenToggle={this.toggleModal.bind(this, 'open')}
|
|
||||||
/>,
|
|
||||||
<SourcesModal
|
|
||||||
mapStyle={this.props.mapStyle}
|
|
||||||
onStyleChanged={this.props.onStyleChanged}
|
|
||||||
isOpen={this.state.isOpen.sources}
|
|
||||||
onOpenToggle={this.toggleModal.bind(this, 'sources')}
|
|
||||||
/>,
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <div style={{
|
return <div style={{
|
||||||
position: "fixed",
|
position: "fixed",
|
||||||
|
@ -142,7 +120,23 @@ export default class Toolbar extends React.Component {
|
||||||
top: 0,
|
top: 0,
|
||||||
backgroundColor: colors.black
|
backgroundColor: colors.black
|
||||||
}}>
|
}}>
|
||||||
{this.renderModals()}
|
<SettingsModal
|
||||||
|
mapStyle={this.props.mapStyle}
|
||||||
|
onStyleChanged={this.props.onStyleChanged}
|
||||||
|
isOpen={this.state.isOpen.settings}
|
||||||
|
onOpenToggle={this.toggleModal.bind(this, 'settings')}
|
||||||
|
/>
|
||||||
|
<OpenModal
|
||||||
|
isOpen={this.state.isOpen.open}
|
||||||
|
onStyleOpen={this.props.onStyleOpen}
|
||||||
|
onOpenToggle={this.toggleModal.bind(this, 'open')}
|
||||||
|
/>
|
||||||
|
<SourcesModal
|
||||||
|
mapStyle={this.props.mapStyle}
|
||||||
|
onStyleChanged={this.props.onStyleChanged}
|
||||||
|
isOpen={this.state.isOpen.sources}
|
||||||
|
onOpenToggle={this.toggleModal.bind(this, 'sources')}
|
||||||
|
/>
|
||||||
<ToolbarLink
|
<ToolbarLink
|
||||||
href={"https://github.com/maputnik/editor"}
|
href={"https://github.com/maputnik/editor"}
|
||||||
style={{
|
style={{
|
||||||
|
|
Loading…
Reference in a new issue