PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.3
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.3
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 / divider / save.js

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

43 lines 884 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 { applyFilters } from '@wordpress/hooks';
4
5 import IconPicker from '../../components/icon-picker';
6 import metadata from './block.json';
7 const { name } = metadata;
8 import { useBlockProps } from '@wordpress/block-editor';
9
10 /**
11 * Block Save Class.
12 *
13 * @param props
14 */
15 export default function BlockSave(props) {
16 const { icon, type } = props.attributes;
17
18 let className = `ghostkit-divider ghostkit-divider-type-${type}`;
19
20 if (icon) {
21 className = classnames(className, 'ghostkit-divider-with-icon');
22 }
23
24 className = applyFilters('ghostkit.blocks.className', className, {
25 name,
26 ...props,
27 });
28
29 const blockProps = useBlockProps.save({ className });
30
31 return (
32 <div {...blockProps}>
33 {icon ? (
34 <IconPicker.Render
35 name={icon}
36 tag="div"
37 className="ghostkit-divider-icon"
38 />
39 ) : null}
40 </div>
41 );
42 }
43