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 / gif / save.js

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

38 lines 743 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 { RichText, useBlockProps } from '@wordpress/block-editor';
4
5 /**
6 * Block Save Class.
7 *
8 * @param props
9 */
10 export default function BlockSave(props) {
11 const { url, srcset, alt, width, height, caption } = props.attributes;
12
13 let { className } = props.attributes;
14
15 className = classnames('ghostkit-gif', className);
16
17 const blockProps = useBlockProps.save({ className });
18
19 return (
20 <figure {...blockProps}>
21 <img
22 src={url}
23 srcSet={srcset}
24 alt={alt}
25 width={width}
26 height={height}
27 />
28 {!RichText.isEmpty(caption) ? (
29 <RichText.Content
30 className="ghostkit-gif-caption"
31 tagName="figcaption"
32 value={caption}
33 />
34 ) : null}
35 </figure>
36 );
37 }
38