PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 2.0.2
GenerateBlocks v2.0.2
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / src / blocks / media / components / ImagePlaceholder.jsx
generateblocks / src / blocks / media / components Last commit date
BlockSettings.jsx 1 year ago Image.jsx 1 year ago ImagePlaceholder.jsx 1 year ago
ImagePlaceholder.jsx
33 lines
1 import { MediaPlaceholder } from '@wordpress/block-editor';
2 import { __ } from '@wordpress/i18n';
3 import getIcon from '../../../utils/get-icon';
4
5 export function ImagePlaceholder( props ) {
6 const {
7 onSelectImage,
8 onSelectURL,
9 onUploadError,
10 uniqueId,
11 } = props;
12
13 const placeholder = <MediaPlaceholder
14 labels={ {
15 title: __( 'Image', 'generateblocks' ),
16 instructions: __( 'Choose an image from your media library or add one with a URL.', 'generateblocks' ),
17 } }
18 icon={ getIcon( 'image' ) }
19 onSelect={ onSelectImage }
20 onSelectURL={ onSelectURL }
21 onError={ onUploadError }
22 accept="image/*"
23 allowedTypes={ [ 'image' ] }
24 />;
25
26 return <div
27 className="gblocks-image__placeholder"
28 data-gb-id={ uniqueId }
29 >
30 { placeholder }
31 </div>;
32 }
33