Android_Retail/src/Components/Modal/DefaultModal.jsx

68 lines
2.0 KiB
JavaScript

import {DefaultModal as DefaultModalLibrary} from "../../../ownLib/my-ui-lib"
export const DefaultModal = DefaultModalLibrary
// import { useEffect } from 'react';
// import { Modal } from 'antd';
// import Buttons from '../Forms/Buttons';
// import { ArrowRightOutlined, CloseOutlined } from '@ant-design/icons';
// export const DefaultModal = ({
// open,
// title,
// handleCancel,
// children,
// footer,
// handleSubmit,
// width,
// destroyOnClose,
// buttonText,
// maskTransitionName,
// transitionName,
// className,
// }) => {
// // Close modal on pressing 'Escape'
// useEffect(() => {
// const handleKeyDown = (event) => {
// if (event.key === 'Escape' && open) {
// handleCancel();
// }
// };
// window.addEventListener('keydown', handleKeyDown);
// return () => window.removeEventListener('keydown', handleKeyDown);
// }, [open, handleCancel]);
// return (
// <>
// <Modal
// destroyOnClose={destroyOnClose ? destroyOnClose : false}
// open={open}
// title={title}
// top={0}
// width={width ? width : 700}
// maskTransitionName={maskTransitionName}
// transitionName={transitionName}
// className={className}
// centered
// closeIcon={<CloseOutlined onClick={handleCancel} />}
// onCancel={handleCancel} // Handles default close (mask clicks, close icon)
// footer={
// footer
// ? [
// <Buttons
// buttonText={buttonText ? buttonText : 'SUBMIT'}
// color="901D77"
// icon={<ArrowRightOutlined />}
// handleSubmit={handleSubmit}
// >
// {buttonText}
// </Buttons>,
// ]
// : footer
// }
// maskClosable={true} // Ensures clicking outside closes the modal
// >
// {children}
// </Modal>
// </>
// );
// };