@shopgate/engage
Version:
Shopgate's ENGAGE library.
21 lines (20 loc) • 727 B
JavaScript
import React from 'react';
import { createPortal } from 'react-dom';
import classNames from 'classnames';
import { useTrackModalState } from '@shopgate/engage/a11y/hooks';
import { Sheet } from '@shopgate/engage/components';
import { jsx as _jsx } from "react/jsx-runtime";
const node = document.getElementById('portals');
/**
* @param {Object} props The props to be passed to the Sheet.
* @returns {JSX.Element}
*/
function SheetDrawer(props) {
// Track modal visibility for accessibility purposes.
useTrackModalState(props.isOpen);
return /*#__PURE__*/createPortal(/*#__PURE__*/_jsx(Sheet, {
...props,
className: classNames(props.className, 'engage__sheet-drawer')
}), node);
}
export default SheetDrawer;