PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.4.1
Block Animations, Motion & Scroll Effects – Ghost Kit v3.4.1
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / blocks / button / save.js

save.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.4.1, at gutenberg/blocks/button/save.js

44 lines 946 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import classnames from 'classnames/dedupe';
2
3 import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
4 import { applyFilters } from '@wordpress/hooks';
5
6 import metadata from './block.json';
7
8 const { name } = metadata;
9
10 /**
11 * Block Save Class.
12 *
13 * @param props
14 */
15 export default function BlockSave(props) {
16 const { align, gap } = props.attributes;
17
18 let className = classnames(
19 'ghostkit-button-wrapper',
20 gap ? `ghostkit-button-wrapper-gap-${gap}` : false,
21 align && align !== 'none'
22 ? `ghostkit-button-wrapper-align-${align}`
23 : false
24 );
25
26 className = applyFilters('ghostkit.blocks.className', className, {
27 name,
28 ...props,
29 });
30
31 const blockProps = useBlockProps.save({
32 className,
33 });
34 const { children, ...innerBlocksProps } = useInnerBlocksProps.save({
35 className: 'ghostkit-button-wrapper-inner',
36 });
37
38 return (
39 <div {...blockProps}>
40 <div {...innerBlocksProps}>{children}</div>
41 </div>
42 );
43 }
44