Commit 628e591c authored by Damien Mariotto's avatar Damien Mariotto
Browse files

[Modal] Fix proptypes display in doc

parent 71d2714e
Pipeline #1637 passed with stage
in 55 seconds
...@@ -105,39 +105,43 @@ function Modal({ ...@@ -105,39 +105,43 @@ function Modal({
childProps.onExited = handleExited; childProps.onExited = handleExited;
} }
return ReactDOM.createPortal( return (
<div <>
className={classNames(classes.root)} {ReactDOM.createPortal(
onClick={handleBackdropClick}
ref={node}
>
{!disableOverlay && (
<Overlay className={classNames({ [classes.hidden]: exited })} />
)}
{typeof props.children === 'string' ? (
<div
className={classNames(className, classes.content, {
[classes.hidden]: exited
})}
onClick={handleClickInside}
>
{props.children}
</div>
) : (
<div <div
className={classNames(className, classes.content, { className={classNames(classes.root)}
[classes.hidden]: exited onClick={handleBackdropClick}
})} ref={node}
onClick={handleClickInside}
> >
{props.children && {!disableOverlay && (
React.Children.map(props.children, child => <Overlay className={classNames({ [classes.hidden]: exited })} />
React.cloneElement(child, childProps) )}
)} {typeof props.children === 'string' ? (
</div> <div
className={classNames(className, classes.content, {
[classes.hidden]: exited
})}
onClick={handleClickInside}
>
{props.children}
</div>
) : (
<div
className={classNames(className, classes.content, {
[classes.hidden]: exited
})}
onClick={handleClickInside}
>
{props.children &&
React.Children.map(props.children, child =>
React.cloneElement(child, childProps)
)}
</div>
)}
</div>,
modalRoot
)} )}
</div>, </>
modalRoot
); );
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment