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

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

52 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {
2 RichText,
3 useBlockProps,
4 useInnerBlocksProps,
5 } from '@wordpress/block-editor';
6 import { applyFilters } from '@wordpress/hooks';
7
8 import metadata from './block.json';
9
10 const { name } = metadata;
11
12 /**
13 * Block Save Class.
14 *
15 * @param props
16 */
17 export default function BlockSave(props) {
18 const { version, date } = props.attributes;
19
20 let className = 'ghostkit-changelog';
21
22 className = applyFilters('ghostkit.blocks.className', className, {
23 name,
24 ...props,
25 });
26
27 const blockProps = useBlockProps.save({ className });
28 const innerBlockProps = useInnerBlocksProps.save({
29 className: 'ghostkit-changelog-more',
30 });
31
32 return (
33 <div {...blockProps}>
34 {!RichText.isEmpty(version) ? (
35 <RichText.Content
36 tagName="span"
37 className="ghostkit-changelog-version"
38 value={version}
39 />
40 ) : null}
41 {!RichText.isEmpty(date) ? (
42 <RichText.Content
43 tagName="h2"
44 className="ghostkit-changelog-date"
45 value={date}
46 />
47 ) : null}
48 <div {...innerBlockProps} />
49 </div>
50 );
51 }
52