PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.7.2
Block Animations, Motion & Scroll Effects – Ghost Kit v3.7.2
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.7.2, at gutenberg/blocks/divider/save.js

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