From 92e5070d4d477350d8052263a5de8b954f05da73 Mon Sep 17 00:00:00 2001 From: Arno V Date: Mon, 4 Mar 2024 16:37:21 -0400 Subject: [PATCH] feat(Modal): adding prop className to ModalClose --- packages/ui-private/src/components/Modal/Modal.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/ui-private/src/components/Modal/Modal.tsx b/packages/ui-private/src/components/Modal/Modal.tsx index 10ad0844..1b03e771 100644 --- a/packages/ui-private/src/components/Modal/Modal.tsx +++ b/packages/ui-private/src/components/Modal/Modal.tsx @@ -107,18 +107,19 @@ export const ModalClose = React.forwardRef< HTMLButtonElement, { trigger: React.ReactElement; + className?: string; } >(function ModalClose(props, ref) { const { setOpen } = useModalContext(); - const { trigger, ...rest } = props; + const { trigger, className, ...rest } = props; const handleClose = React.useCallback(() => setOpen(false), [setOpen]); return ( - <> +
{React.cloneElement(trigger, { ref, onClick: handleClose, ...rest, })} - +
); });