2016-12-21 13:55:11 +01:00
|
|
|
import React from 'react'
|
2017-11-06 16:32:04 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2016-12-21 13:55:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Overlay extends React.Component {
|
|
|
|
static propTypes = {
|
2017-11-06 16:32:04 +01:00
|
|
|
isOpen: PropTypes.bool.isRequired,
|
|
|
|
children: PropTypes.element.isRequired
|
2016-12-21 13:55:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2017-01-11 09:35:48 +01:00
|
|
|
let overlayStyle = {}
|
|
|
|
if(!this.props.isOpen) {
|
|
|
|
overlayStyle['display'] = 'none';
|
|
|
|
}
|
|
|
|
|
|
|
|
return <div className={"maputnik-overlay"} style={overlayStyle}>
|
|
|
|
<div className={"maputnik-overlay-viewport"} />
|
2016-12-21 13:55:11 +01:00
|
|
|
{this.props.children}
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Overlay
|