From 7de6d899f11506709e373fd835b7f0ed2020d7be Mon Sep 17 00:00:00 2001 From: kibin Date: Wed, 1 Apr 2026 07:44:53 +0000 Subject: [PATCH] fix(254): modal scrollable with sticky footer --- src/components/ui/Modal.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/ui/Modal.tsx b/src/components/ui/Modal.tsx index 7713723..1ce1456 100644 --- a/src/components/ui/Modal.tsx +++ b/src/components/ui/Modal.tsx @@ -9,10 +9,11 @@ interface ModalProps { onClose: () => void; title: string; children: React.ReactNode; + footer?: React.ReactNode; className?: string; } -export function Modal({ isOpen, onClose, title, children, className }: ModalProps) { +export function Modal({ isOpen, onClose, title, children, footer, className }: ModalProps) { const overlayRef = useRef(null); useEffect(() => { @@ -31,8 +32,8 @@ export function Modal({ isOpen, onClose, title, children, className }: ModalProp className="fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4" onClick={(e) => e.target === overlayRef.current && onClose()} > -
-
+
+

{title}

-
{children}
+
{children}
+ {footer && ( +
+ {footer} +
+ )}
);