mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-08 11:30:52 +01:00
24 lines
508 B
JavaScript
24 lines
508 B
JavaScript
import React from 'react'
|
|
import PropTypes from 'prop-types'
|
|
|
|
|
|
class Overlay extends React.Component {
|
|
static propTypes = {
|
|
isOpen: PropTypes.bool.isRequired,
|
|
children: 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
|