/var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/blocks/donation-form/edit
NameSizeModeActions
block.js7690644editdlrm
block.scss2230644editdlrm
inspector.js33980644editdlrm
Edit: /var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/give/blocks/donation-form/edit/inspector.js (3398B)
/** * WordPress dependencies */ const { __ } = wp.i18n; const { InspectorControls } = wp.blockEditor; const { Dashicon, Button, PanelBody, SelectControl, ToggleControl, TextControl } = wp.components; const { Component } = wp.element; const { withSelect } = wp.data; /** * Internal dependencies */ import giveFormOptions from '../data/options'; import { isLegacyForm } from '../../utils'; /** * Render Inspector Controls */ class Inspector extends Component { constructor( props ) { super( props ); this.state = { continueButtonTitle: this.props.attributes.continueButtonTitle, }; this.saveSetting = this.saveSetting.bind( this ); this.saveState = this.saveState.bind( this ); } saveSetting( name, value ) { this.props.setAttributes( { [ name ]: value, } ); } saveState( name, value ) { this.setState( { [ name ]: value, } ); } render() { const { forms } = this.props; const { id, displayStyle, showTitle, showGoal, showContent, contentDisplay, } = this.props.attributes; return ( { isLegacyForm( forms, id ) && (
this.saveSetting( 'displayStyle', value ) } /> { 'reveal' === displayStyle && ( this.saveState( 'continueButtonTitle', value ) } onBlur={ ( event ) => this.saveSetting( 'continueButtonTitle', event.target.value ) } /> ) } this.saveSetting( 'showTitle', value ) } /> this.saveSetting( 'showGoal', value ) } /> this.saveSetting( 'contentDisplay', value ) } /> { contentDisplay && ( this.saveSetting( 'showContent', value ) } /> ) }
) }
); } } /** * Export with forms data */ export default withSelect( ( select ) => { return { forms: select( 'core' ).getEntityRecords( 'postType', 'give_forms', { per_page: 30 } ), }; } )( Inspector );