AdvancedFields.js
2 years ago
AttributeHelp.js
2 years ago
BlockAddPrevButton.js
2 years ago
BlockAdvancedValue.js
2 years ago
BlockClassName.js
2 years ago
BlockDefaultValue.js
2 years ago
BlockDescription.js
2 years ago
BlockLabel.js
2 years ago
BlockName.js
2 years ago
BlockPlaceholder.js
2 years ago
BlockPrevButtonLabel.js
2 years ago
BlockRequired.js
2 years ago
BlockVisibility.js
2 years ago
FieldControl.js
2 years ago
FieldSettingsWrapper.js
2 years ago
FieldWrapper.js
2 years ago
GeneralFields.js
2 years ago
SelectVariations.js
2 years ago
ToggleGroupVariations.js
2 years ago
ToolBarDefault.js
2 years ago
ToolBarFields.js
2 years ago
BlockPrevButtonLabel.js
36 lines
| 1 | import useBlockAttributes from '../hooks/useBlockAttributes'; |
| 2 | import AttributeHelp from './AttributeHelp'; |
| 3 | |
| 4 | const { |
| 5 | __, |
| 6 | } = wp.i18n; |
| 7 | const { |
| 8 | TextControl, |
| 9 | } = wp.components; |
| 10 | |
| 11 | function BlockPrevButtonLabel( { label, help } ) { |
| 12 | const [ |
| 13 | attributes, |
| 14 | setAttributes, |
| 15 | ] = useBlockAttributes(); |
| 16 | |
| 17 | if ( !attributes.add_prev ) { |
| 18 | return null; |
| 19 | } |
| 20 | |
| 21 | return <> |
| 22 | <TextControl |
| 23 | label={ |
| 24 | label ?? __( 'Prev Page Button Label', 'jet-form-builder' ) |
| 25 | } |
| 26 | value={ attributes.prev_label } |
| 27 | className="jet-fb m-unset" |
| 28 | onChange={ prev_label => setAttributes( { prev_label } ) } |
| 29 | /> |
| 30 | <AttributeHelp name="prev_label"> |
| 31 | { help ?? '' } |
| 32 | </AttributeHelp> |
| 33 | </>; |
| 34 | } |
| 35 | |
| 36 | export default BlockPrevButtonLabel; |