| 1 |
import Button from 'elementor-app/ui/molecules/button'; |
| 2 |
|
| 3 |
export default function DialogWrapper( props ) { |
| 4 |
let WrapperTag = 'div'; |
| 5 |
|
| 6 |
if ( props.onSubmit ) { |
| 7 |
WrapperTag = 'form'; |
| 8 |
} |
| 9 |
|
| 10 |
return ( |
| 11 |
<section className="eps-modal__overlay"> |
| 12 |
<WrapperTag className="eps-modal eps-dialog" onSubmit={ props.onSubmit }> |
| 13 |
{ |
| 14 |
props.onClose && |
| 15 |
<Button |
| 16 |
onClick={ props.onClose } |
| 17 |
text={ __( 'Close', 'elementor' ) } |
| 18 |
hideText={ true } |
| 19 |
icon="eicon-close" |
| 20 |
className="eps-dialog__close-button" |
| 21 |
/> |
| 22 |
} |
| 23 |
{ props.children } |
| 24 |
</WrapperTag> |
| 25 |
</section> |
| 26 |
); |
| 27 |
} |
| 28 |
|
| 29 |
DialogWrapper.propTypes = { |
| 30 |
onClose: PropTypes.func, |
| 31 |
onSubmit: PropTypes.func, |
| 32 |
children: PropTypes.any, |
| 33 |
}; |
| 34 |
|