/** * Inspector Controls */ // Setup the block const { __ } = wp.i18n; const { Component } = wp.element; // Import block components const { InspectorControls, BlockDescription, ColorPalette, } = wp.editor; // Import Inspector components const { Toolbar, Button, PanelBody, PanelRow, PanelColor, FormToggle, RangeControl, SelectControl, ToggleControl, } = wp.components; /** * Create an Inspector Controls wrapper Component */ export default class Inspector extends Component { constructor( props ) { super( ...arguments ); } render() { // Setup the attributes const { twitter, facebook, google, linkedin, pinterest, email, reddit, shareAlignment, shareButtonStyle, shareButtonShape, shareButtonSize, shareButtonColor, } = this.props.attributes; // Button style values const buttonStyleOptions = [ { value: 'ab-share-icon-text', label: __( 'Icon and Text' ) }, { value: 'ab-share-icon-only', label: __( 'Icon Only' ) }, { value: 'ab-share-text-only', label: __( 'Text Only' ) }, ]; // Button shape values const buttonShapeOptions = [ { value: 'ab-share-shape-square', label: __( 'Square' ) }, { value: 'ab-share-shape-rounded', label: __( 'Rounded Square' ) }, { value: 'ab-share-shape-circular', label: __( 'Circular' ) }, ]; // Button size values const shareButtonSizeOptions = [ { value: 'ab-share-size-small', label: __( 'Small' ) }, { value: 'ab-share-size-medium', label: __( 'Medium' ) }, { value: 'ab-share-size-large', label: __( 'Large' ) }, ]; // Button color values const shareButtonColorOptions = [ { value: 'ab-share-color-standard', label: __( 'Standard' ) }, { value: 'ab-share-color-social', label: __( 'Social Colors' ) }, ]; return (

{ __( 'Enable or disable the sharing links you want to output.' ) }

this.props.setAttributes( { twitter: ! twitter } ) } /> this.props.setAttributes( { facebook: ! facebook } ) } /> this.props.setAttributes( { google: ! google } ) } /> this.props.setAttributes( { pinterest: ! pinterest } ) } /> this.props.setAttributes( { linkedin: ! linkedin } ) } /> this.props.setAttributes( { reddit: ! reddit } ) } /> this.props.setAttributes( { email: ! email } ) } />
( { value: value, label: label, } ) ) } onChange={ ( value ) => { this.props.setAttributes( { shareButtonStyle: value } ) } } /> ( { value: value, label: label, } ) ) } onChange={ ( value ) => { this.props.setAttributes( { shareButtonShape: value } ) } } /> ( { value: value, label: label, } ) ) } onChange={ ( value ) => { this.props.setAttributes( { shareButtonSize: value } ) } } /> ( { value: value, label: label, } ) ) } onChange={ ( value ) => { this.props.setAttributes( { shareButtonColor: value } ) } } />
); } }