import React from 'react'; import PropTypes from 'prop-types'; import './Dialog.scss'; import { twemojify } from '../../../util/twemojify'; import Text from '../../atoms/text/Text'; import Header, { TitleWrapper } from '../../atoms/header/Header'; import ScrollView from '../../atoms/scroll/ScrollView'; import RawModal from '../../atoms/modal/RawModal'; function Dialog({ className, isOpen, title, onAfterOpen, onAfterClose, contentOptions, onRequestClose, closeFromOutside, children, invisibleScroll, }) { return (
{ typeof title === 'string' ? {twemojify(title)} : title } {contentOptions}
{children}
); } Dialog.defaultProps = { className: null, contentOptions: null, onAfterOpen: null, onAfterClose: null, onRequestClose: null, closeFromOutside: true, invisibleScroll: false, }; Dialog.propTypes = { className: PropTypes.string, isOpen: PropTypes.bool.isRequired, title: PropTypes.node.isRequired, contentOptions: PropTypes.node, onAfterOpen: PropTypes.func, onAfterClose: PropTypes.func, onRequestClose: PropTypes.func, closeFromOutside: PropTypes.bool, children: PropTypes.node.isRequired, invisibleScroll: PropTypes.bool, }; export default Dialog;