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 |