generateblocks
/
src
/
extend
/
inspector-control
/
controls
/
background-panel
/
components
/
image-opacity.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
image-opacity.js
29 lines
| 1 | import { __ } from '@wordpress/i18n'; |
| 2 | import { Notice, RangeControl } from '@wordpress/components'; |
| 3 | |
| 4 | export default function ImageOpacity( { value, onChange, isPseudoElement } ) { |
| 5 | return ( |
| 6 | <> |
| 7 | <RangeControl |
| 8 | label={ __( 'Image Opacity', 'generateblocks' ) } |
| 9 | value={ value } |
| 10 | onChange={ onChange } |
| 11 | min={ 0 } |
| 12 | max={ 1 } |
| 13 | step={ 0.01 } |
| 14 | initialPosition={ generateBlocksDefaults.container.bgOptions.opacity } |
| 15 | /> |
| 16 | |
| 17 | { 1 !== value && ! isPseudoElement && |
| 18 | <Notice |
| 19 | className="gblocks-option-notice" |
| 20 | status="info" |
| 21 | isDismissible={ false } |
| 22 | > |
| 23 | { __( 'Your selector must be set to Pseudo Element to use opacity.', 'generateblocks' ) } |
| 24 | </Notice> |
| 25 | } |
| 26 | </> |
| 27 | ); |
| 28 | } |
| 29 |