PHP Classes

File: src/components/Inspector.js

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   WordPress FAQ Plugin Block Element   src/components/Inspector.js   Download  
File: src/components/Inspector.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WordPress FAQ Plugin Block Element
Show frequently asked questions in WordPress pages
Author: By
Last change:
Date: 1 year ago
Size: 2,700 bytes
 

Contents

Class file image Download
import { InspectorControls, PanelColorSettings } from "@wordpress/block-editor"; const { __ } = wp.i18n; import { PanelBody, TextControl } from "@wordpress/components"; /** * Internal dependencies * Inspector controls * @param {*} props */ export default function Inspector(props) { const { attributes, setAttributes } = props; return ( <InspectorControls> <PanelBody title={__("Settings", "faq-block-element-for-wp")}> <PanelColorSettings title={__("Header title color", "faq-block-element-for-wp")} colorSettings={[ { label: __("Select a color", "faq-block-element-for-wp"), value: attributes.headertitleColor, onChange: (color) => { setAttributes({ headertitleColor: color }); } } ]} /> <TextControl label={__("FAQ Container Width", "faq-block-element-for-wp")} value={attributes.faqwidth} onChange={(value) => { setAttributes({ faqwidth: value }); }} /> <TextControl label={__("FAQ Container Padding", "faq-block-element-for-wp")} value={attributes.faqpadding} onChange={(value) => { setAttributes({ faqpadding: value }); }} /> <PanelColorSettings title={__("Inner header title color", "faq-block-element-for-wp")} colorSettings={[ { label: __("Select a color", "faq-block-element-for-wp"), value: attributes.innerheadertitleColor, onChange: (color) => { setAttributes({ innerheadertitleColor: color }); } } ]} /> <PanelColorSettings title={__( "Inner header hover and active color", "faq-block-element-for-wp" )} colorSettings={[ { label: __("Select a color", "faq-block-element-for-wp"), value: attributes.innerheaderhoveractiveColor, onChange: (color) => { setAttributes({ innerheaderhoveractiveColor: color }); } } ]} /> <PanelColorSettings title={__("Inner text color", "faq-block-element-for-wp")} colorSettings={[ { label: __("Select a color", "faq-block-element-for-wp"), value: attributes.innertextColor, onChange: (color) => { setAttributes({ innertextColor: color }); } } ]} /> </PanelBody> </InspectorControls> ); }