From fbadadb949bdc4816e4553eff0cea95403cc6444 Mon Sep 17 00:00:00 2001 From: Arno V Date: Tue, 5 Mar 2024 07:56:05 -0500 Subject: [PATCH] feat(Modal): adding prop className to ModalClose (#372) ## Summary by CodeRabbit - **Style** - Enhanced the styling capability of the modal close component by introducing a class name property. --- 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, })} - +
); });