From 610791b2fc5be0385105a1f39d4252824a35f4f3 Mon Sep 17 00:00:00 2001 From: Appaji Date: Fri, 14 Jun 2024 22:16:14 +0530 Subject: [PATCH] Support ReactNode in ModalHeader --- .../ui/src/primitives/tailwind/Modal/index.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/primitives/tailwind/Modal/index.tsx b/packages/ui/src/primitives/tailwind/Modal/index.tsx index 1cd114771f..09d1086046 100644 --- a/packages/ui/src/primitives/tailwind/Modal/index.tsx +++ b/packages/ui/src/primitives/tailwind/Modal/index.tsx @@ -36,7 +36,8 @@ export interface ModalProps { title?: string hideFooter?: boolean className?: string - children: ReactNode + rawChildren?: ReactNode + children?: ReactNode submitLoading?: boolean showCloseButton?: boolean closeButtonDisabled?: boolean @@ -92,7 +93,11 @@ export const ModalFooter = ({ return (
{showCloseButton && ( - )} @@ -101,7 +106,7 @@ export const ModalFooter = ({ endIcon={submitLoading ? : undefined} disabled={submitButtonDisabled || submitLoading} onClick={onSubmit} - className="place-self-end" + className="place-self-end font-['Figtree']" > {submitButtonText || t('common:components.confirm')} @@ -115,6 +120,7 @@ const Modal = ({ onClose, onSubmit, hideFooter, + rawChildren, children, className, submitLoading, @@ -129,7 +135,9 @@ const Modal = ({
{onClose && } -
{children}
+ {rawChildren && rawChildren} + {children &&
{children}
} + {!hideFooter && (