@brizy/ui
Version:
React elements in Brizy style
17 lines (16 loc) • 1.13 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Modal = void 0;
const react_1 = __importDefault(require("react"));
const modal_1 = __importDefault(require("antd/lib/modal"));
const classNamesFn_1 = require("../classNamesFn");
const Modal = ({ open, onClose, children, closable = false, isSidebar, animation, getContainer, className, }) => {
const wrapClassName = (0, classNamesFn_1.classNames)(className)({ modal__sidebar: isSidebar });
const transitionName = isSidebar ? { transitionName: `move-${animation !== null && animation !== void 0 ? animation : "right"}` } : {};
const mask = isSidebar ? false : true;
return (react_1.default.createElement(modal_1.default, Object.assign({ visible: open, onCancel: onClose, destroyOnClose: true, closable: closable, footer: null, wrapClassName: wrapClassName, width: "fit-content", centered: true }, transitionName, { mask: mask, getContainer: getContainer }), children));
};
exports.Modal = Modal;