File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ type Props = {
2828 * Additional classes to apply to the modal.
2929 */
3030 className ?: string ;
31+
32+ /**
33+ * Additional classes to apply to the modal content.
34+ */
35+ contentClassName ?: string ;
3136} ;
3237
3338const MODAL_MOTION = {
@@ -43,6 +48,7 @@ export function Modal({
4348 children,
4449 closeOnOutsideClick = true ,
4550 className,
51+ contentClassName,
4652} : Props ) {
4753 const handleOutsideClick = ( e : React . MouseEvent ) => {
4854 if (
@@ -62,29 +68,29 @@ export function Modal({
6268 animate = { MODAL_MOTION . animate }
6369 exit = { MODAL_MOTION . exit }
6470 transition = { MODAL_MOTION . transition }
65- className = { cn ( 'fixed inset-0 z-50 flex w-full items-center justify-center' ) }
71+ className = { cn ( 'fixed inset-0 z-50 flex w-full items-center justify-center' , className ) }
6672 >
6773 < div className = "absolute inset-0 bg-black/50" onClick = { handleOutsideClick } />
68- < ModalContent className = { className } > { children } </ ModalContent >
74+ < ModalContent contentClassName = { contentClassName } > { children } </ ModalContent >
6975 </ motion . div >
7076 </ Portal >
7177 ) ;
7278}
7379
7480export function ModalContent ( {
7581 children,
76- className ,
82+ contentClassName ,
7783} : {
7884 children : React . ReactNode ;
79- className ?: string ;
85+ contentClassName ?: string ;
8086} ) {
8187 return (
8288 < Flex
8389 role = "dialog"
8490 aria-modal = "true"
8591 justifyContent = "center"
8692 alignItems = "center"
87- className = { cn ( 'relative z-50 rounded-lg bg-white p-6' , className ) }
93+ className = { cn ( 'relative z-50 rounded-lg bg-white p-6' , contentClassName ) }
8894 >
8995 { children }
9096 </ Flex >
You can’t perform that action at this time.
0 commit comments