@brizy/ui
Version:
React elements in Brizy style
12 lines (11 loc) • 961 B
JavaScript
import React from "react";
import AntModal from "antd-v5/lib/modal";
import { alphaClassNames } from "../alphaClassNamesFn";
import { StyleProvider } from "@ant-design/cssinjs";
export const AlphaModal = ({ open, onClose, children, closable = false, isSidebar, animation, getContainer, getStyleContainer, className, }) => {
const wrapClassName = alphaClassNames(className)({ modal__sidebar: isSidebar });
const transitionName = isSidebar ? { transitionName: `move-${animation !== null && animation !== void 0 ? animation : "right"}` } : {};
const mask = isSidebar ? false : true;
return (React.createElement(StyleProvider, { container: getStyleContainer },
React.createElement(AntModal, Object.assign({ open: open, onCancel: onClose, destroyOnClose: true, closable: closable, footer: null, wrapClassName: wrapClassName, width: "fit-content", centered: true }, transitionName, { mask: mask, getContainer: getContainer }), children)));
};