@brizy/ui
Version:
React elements in Brizy style
10 lines (9 loc) • 791 B
JavaScript
import React from "react";
import AntModal from "antd/lib/modal";
import { classNames } from "../classNamesFn";
export const Modal = ({ open, onClose, children, closable = false, isSidebar, animation, getContainer, className, }) => {
const wrapClassName = classNames(className)({ modal__sidebar: isSidebar });
const transitionName = isSidebar ? { transitionName: `move-${animation !== null && animation !== void 0 ? animation : "right"}` } : {};
const mask = isSidebar ? false : true;
return (React.createElement(AntModal, 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));
};