PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.5.2
GenerateBlocks v1.5.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 / container / components / BlockControls.js
generateblocks / src / blocks / container / components Last commit date
BlockControls.js 4 years ago ComponentCSS.js 4 years ago ContainerContentRenderer.js 4 years ago GridItem.js 4 years ago InspectorControls.js 4 years ago ShapeDividers.js 4 years ago
BlockControls.js
41 lines
1 import { AlignmentToolbar, BlockControls } from '@wordpress/block-editor';
2
3 export default ( { attributes, setAttributes, deviceType } ) => {
4 const {
5 alignment,
6 alignmentTablet,
7 alignmentMobile,
8 } = attributes;
9
10 return (
11 <BlockControls>
12 { 'Desktop' === deviceType && (
13 <AlignmentToolbar
14 value={ alignment }
15 onChange={ ( value ) => {
16 setAttributes( { alignment: value } );
17 } }
18 />
19 ) }
20
21 { 'Tablet' === deviceType && (
22 <AlignmentToolbar
23 value={ alignmentTablet }
24 onChange={ ( value ) => {
25 setAttributes( { alignmentTablet: value } );
26 } }
27 />
28 ) }
29
30 { 'Mobile' === deviceType && (
31 <AlignmentToolbar
32 value={ alignmentMobile }
33 onChange={ ( value ) => {
34 setAttributes( { alignmentMobile: value } );
35 } }
36 />
37 ) }
38 </BlockControls>
39 );
40 };
41