import { h } from 'preact'; import PropTypes from 'prop-types'; import { defaultChildrenPropTypes } from '../../common-prop-types'; import { FocusTrap } from '../../shared/components/focusTrap'; /** * A component that creates a full-width modal that slides in from the bottom of viewport. * * * @param {object} props * @param {Array} props.children * @param {string} props.title The title to be applied to the dialog, surfaced to screen reader users * @param {Function} props.onClose Action to complete when user opts to close the drawer * * @example * const [isDrawerOpen, setIsDrawerOpen] = useState(false); * return ( *
* * {isDrawerOpen && ( * setIsDrawerOpen(false)} * > *

Lorem ipsum

* *
* )} *
* ); */ export const MobileDrawer = ({ children, title, onClose = () => {} }) => { return (
{children}
); }; MobileDrawer.propTypes = { children: defaultChildrenPropTypes.isRequired, title: PropTypes.string.isRequired, onClose: PropTypes.func, };