2020-07-29 20:52:57 +00:00
|
|
|
import React from 'react';
|
2020-07-24 19:30:14 +00:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { createPortal } from 'react-dom';
|
|
|
|
|
2020-07-29 18:15:55 +00:00
|
|
|
const OverlayManager = ({ overlay, hideOverlay }) => {
|
2020-07-29 19:01:40 +00:00
|
|
|
// const [visible, trigger, setRef] = useModalBehavior();
|
2020-07-29 18:15:55 +00:00
|
|
|
|
2020-07-24 19:30:14 +00:00
|
|
|
const jsx = (
|
|
|
|
<React.Fragment>
|
2020-07-29 19:01:40 +00:00
|
|
|
{/* <div ref={setRef} >
|
|
|
|
{visible && <Dropdown items={headerNavOptions} />}
|
|
|
|
</div> */}
|
2020-07-24 19:30:14 +00:00
|
|
|
</React.Fragment>
|
|
|
|
);
|
|
|
|
|
|
|
|
return jsx && createPortal(jsx, document.body);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
OverlayManager.propTypes = {
|
|
|
|
overlay: PropTypes.string,
|
|
|
|
hideOverlay: PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
OverlayManager.defaultProps = { overlay: null };
|
|
|
|
|
|
|
|
export default OverlayManager;
|