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 / form / field-description / index.js

index.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.3, at gutenberg/blocks/form/field-description/index.js

33 lines 677 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { RichText } from '@wordpress/block-editor';
2 import { __ } from '@wordpress/i18n';
3
4 /**
5 * Field Description Class.
6 *
7 * @param props
8 */
9 export default function FieldDescription(props) {
10 const { attributes, setAttributes, isSelected } = props;
11
12 const { description, hideDescription } = attributes;
13
14 if (!description && !isSelected) {
15 return null;
16 }
17
18 if (hideDescription && !isSelected) {
19 return null;
20 }
21
22 return (
23 <RichText
24 inlineToolbar
25 tagName="small"
26 className="ghostkit-form-field-description"
27 value={description}
28 placeholder={__('Write description…', 'ghostkit')}
29 onChange={(val) => setAttributes({ description: val })}
30 />
31 );
32 }
33