| 1 |
/** |
| 2 |
* External dependencies |
| 3 |
*/ |
| 4 |
import classnames from 'classnames/dedupe'; |
| 5 |
|
| 6 |
/** |
| 7 |
* WordPress dependencies |
| 8 |
*/ |
| 9 |
const { Component } = wp.element; |
| 10 |
|
| 11 |
const { Modal } = wp.components; |
| 12 |
|
| 13 |
/** |
| 14 |
* Component Class |
| 15 |
*/ |
| 16 |
export default class ModalComponent extends Component { |
| 17 |
render() { |
| 18 |
let className = 'ghostkit-component-modal'; |
| 19 |
|
| 20 |
if (this.props.position) { |
| 21 |
className = classnames(className, `ghostkit-component-modal-position-${this.props.position}`); |
| 22 |
} |
| 23 |
|
| 24 |
if (this.props.size) { |
| 25 |
className = classnames(className, `ghostkit-component-modal-size-${this.props.size}`); |
| 26 |
} |
| 27 |
|
| 28 |
className = classnames(className, this.props.className); |
| 29 |
|
| 30 |
return ( |
| 31 |
<Modal {...this.props} className={className}> |
| 32 |
{this.props.children} |
| 33 |
</Modal> |
| 34 |
); |
| 35 |
} |
| 36 |
} |
| 37 |
|