preview.js
29 lines
| 1 | /** |
| 2 | * Block dependencies |
| 3 | */ |
| 4 | import Inspector from '../inspector'; |
| 5 | import Controls from '../controls'; |
| 6 | |
| 7 | /** |
| 8 | * Internal dependencies |
| 9 | */ |
| 10 | const { Component } = wp.element; |
| 11 | |
| 12 | /** |
| 13 | * Render Form Preview |
| 14 | */ |
| 15 | |
| 16 | class FormPreview extends Component { |
| 17 | render(){ |
| 18 | return ( |
| 19 | <div id="donation-form-preview-block"> |
| 20 | { !! this.props.isSelected && <Inspector { ... { ...this.props } } /> } |
| 21 | { !! this.props.isSelected && <Controls { ... { ...this.props } } /> } |
| 22 | <div dangerouslySetInnerHTML={ { __html: this.props.html } }></div> |
| 23 | </div> |
| 24 | ); |
| 25 | } |
| 26 | }; |
| 27 | |
| 28 | export default FormPreview; |
| 29 |