Skip to content

Commit 0e5cf7c

Browse files
committed
added className support on modal components
1 parent 24d2d84 commit 0e5cf7c

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/Components/Modal/Modal.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,24 @@ const Modal = ({ isOpen, onClose, maxWidth = 'lg', children }: PropsWithChildren
7373
);
7474
};
7575

76-
const ModalHeader = ({ children }: PropsWithChildren) => {
77-
return <div className="text-lg font-medium text-gray-900 mb-4 px-5 pt-5">{children}</div>;
76+
const ModalHeader = ({ children, className }: PropsWithChildren<{ className: string }>) => {
77+
return (
78+
<div className={classNames('text-lg font-medium text-gray-900 mb-4 px-5 pt-5', className)}>
79+
{children}
80+
</div>
81+
);
7882
};
7983

80-
const ModalBody = ({ children }: PropsWithChildren) => {
81-
return <div className="px-5 pt-0">{children}</div>;
84+
const ModalBody = ({ children, className }: PropsWithChildren<{ className: string }>) => {
85+
return <div className={classNames('px-5 pt-0', className)}>{children}</div>;
8286
};
8387

84-
const ModalActions = ({ children }: PropsWithChildren) => {
85-
return <div className="px-5 py-4 mt-4 sm:px-6 sm:flex sm:flex-row-reverse">{children}</div>;
88+
const ModalActions = ({ children, className }: PropsWithChildren<{ className: string }>) => {
89+
return (
90+
<div className={classNames('px-5 py-4 mt-4 sm:px-6 sm:flex sm:flex-row-reverse', className)}>
91+
{children}
92+
</div>
93+
);
8694
};
8795

8896
export { Modal, ModalHeader, ModalBody, ModalActions };

0 commit comments

Comments
 (0)