| 1 |
/** |
| 2 |
* External dependencies |
| 3 |
*/ |
| 4 |
import classnames from 'classnames/dedupe'; |
| 5 |
|
| 6 |
/** |
| 7 |
* Internal dependencies |
| 8 |
*/ |
| 9 |
import metadata from './block.json'; |
| 10 |
|
| 11 |
/** |
| 12 |
* WordPress dependencies |
| 13 |
*/ |
| 14 |
const { applyFilters } = wp.hooks; |
| 15 |
|
| 16 |
const { InnerBlocks } = wp.blockEditor; |
| 17 |
|
| 18 |
const { Component } = wp.element; |
| 19 |
|
| 20 |
const { name } = metadata; |
| 21 |
|
| 22 |
/** |
| 23 |
* Block Save Class. |
| 24 |
*/ |
| 25 |
class BlockSave extends Component { |
| 26 |
render() { |
| 27 |
const { align } = this.props.attributes; |
| 28 |
|
| 29 |
let className = classnames( |
| 30 |
'ghostkit-form-submit-button', |
| 31 |
align && align !== 'none' ? `ghostkit-form-submit-button-align-${align}` : false |
| 32 |
); |
| 33 |
|
| 34 |
className = applyFilters('ghostkit.blocks.className', className, { |
| 35 |
...{ |
| 36 |
name, |
| 37 |
}, |
| 38 |
...this.props, |
| 39 |
}); |
| 40 |
|
| 41 |
return ( |
| 42 |
<div className={className}> |
| 43 |
<InnerBlocks.Content /> |
| 44 |
</div> |
| 45 |
); |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
export default BlockSave; |
| 50 |
|