mirror of
https://github.com/maputnik/editor.git
synced 2025-12-26 08:00:01 +00:00
25 lines
508 B
JavaScript
25 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
|