diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index 5a1dc806..caa07870 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -53,15 +53,25 @@ interface ModalProps { ref: RefObject; children?: ReactNode; closeOnBackdrop?: boolean; + onBackdropClick?: () => void; + position?: 'top' | 'middle' | 'bottom' | 'start' | 'end'; className?: { modal?: string; modalBox?: string; }; } -const Modal = ({ ref, children, closeOnBackdrop, className }: ModalProps) => { +const Modal = ({ + ref, + children, + closeOnBackdrop, + onBackdropClick, + position = 'middle', + className, +}: ModalProps) => { const handleBackdropClick = (e: React.MouseEvent) => { if (closeOnBackdrop && e.target === ref.current) { + onBackdropClick?.(); ref.current?.close(); } }; @@ -69,7 +79,17 @@ const Modal = ({ ref, children, closeOnBackdrop, className }: ModalProps) => { return (
{children}