mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-07 01:25:25 +01:00
23 lines
485 B
JavaScript
23 lines
485 B
JavaScript
import React from 'react'
|
|
|
|
|
|
class Overlay extends React.Component {
|
|
static propTypes = {
|
|
isOpen: React.PropTypes.bool.isRequired,
|
|
children: React.PropTypes.element.isRequired
|
|
}
|
|
|
|
render() {
|
|
let overlayStyle = {}
|
|
if(!this.props.isOpen) {
|
|
overlayStyle['display'] = 'none';
|
|
}
|
|
|
|
return <div className={"maputnik-overlay"} style={overlayStyle}>
|
|
<div className={"maputnik-overlay-viewport"} />
|
|
{this.props.children}
|
|
</div>
|
|
}
|
|
}
|
|
|
|
export default Overlay
|