generateblocks
/
src
/
extend
/
inspector-control
/
controls
/
background-panel
/
components
/
selector.js
generateblocks
/
src
/
extend
/
inspector-control
/
controls
/
background-panel
/
components
Last commit date
attachment.js
3 years ago
background-color-overlay.js
3 years ago
background-options.js
2 years ago
image-opacity.js
3 years ago
image-size.js
3 years ago
image-url.js
3 years ago
position.js
3 years ago
repeat.js
3 years ago
selector.js
3 years ago
size.js
3 years ago
use-inline-style.js
3 years ago
selector.js
28 lines
| 1 | import { __ } from '@wordpress/i18n'; |
| 2 | import { SelectControl } from '@wordpress/components'; |
| 3 | |
| 4 | export default function Selector( { value, onChange, position, useInnerContainer } ) { |
| 5 | let help = null; |
| 6 | |
| 7 | if ( ! useInnerContainer && 'pseudo-element' === value ) { |
| 8 | help = __( 'Note: This image will sit on top of content inside this Container unless the content has its own Container with "Position" set to "Relative" (Layout panel).', 'generateblocks' ); |
| 9 | |
| 10 | if ( ! position ) { |
| 11 | help = __( 'Note: You need to set your "Position" option to "Relative" (Layout panel) or this image will overflow out of this Container.', 'generateblocks' ); |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | return ( |
| 16 | <SelectControl |
| 17 | label={ __( 'Selector', 'generateblocks' ) } |
| 18 | value={ value } |
| 19 | options={ [ |
| 20 | { label: __( 'Element', 'generateblocks' ), value: 'element' }, |
| 21 | { label: __( 'Pseudo Element', 'generateblocks' ), value: 'pseudo-element' }, |
| 22 | ] } |
| 23 | onChange={ onChange } |
| 24 | help={ help } |
| 25 | /> |
| 26 | ); |
| 27 | } |
| 28 |