import { __ } from "@wordpress/i18n"; import { InspectorControls } from "@wordpress/block-editor"; import { TabPanel, PanelBody, TextControl, BaseControl, ButtonGroup, Button, } from "@wordpress/components"; import ColorControl from "../../../util/color-control"; import TypographyDropdown from "../../../util/typography-control-v2"; import ResponsiveRangeController from "../../../util/responsive-range-control"; import ResponsiveDimensionsControl from "../../../util/dimensions-control-v2"; import { ICON_SIZE, FORM_WIDTH, FORM_HEIGHT, FORM_HEADING_ALIGN, FORM_BUTTON_WIDTH, FORM_BUTTON_PADDING, FORM_BUTTON_ALIGN, } from "./constants"; import { formTitleTypo, feedBackFormHeadingtypo, feedbackFormLabelTypo, feedbackFormButtonTextTypo, } from "./typographyPrefixConstants"; import objAttributes from "./attributes"; const Inspector = ({ attributes, setAttributes }) => { const { formContent, formTitle, buttonText, formContentColor, resOption, iconColor, feedbackFormHeadingColor, feedbackFormHeadingAlignment, feedbackFormLabelColor, feedbackFormButtonBackColor, feedbackFormButtonTextColor, feedbackFormButtonAlignment, feedbackFormNameLabelText, feedbackFormEmailLabelText, feedbackFormMessageLabelText } = attributes; const resRequiredProps = { setAttributes, resOption, attributes, objAttributes, }; return (
{(tab) => { return (
{tab.name === "content" && ( { setAttributes({ feedbackFormNameLabelText: value.toString(), }); }} /> { setAttributes({ feedbackFormEmailLabelText: value.toString(), }); }} /> { setAttributes({ feedbackFormMessageLabelText: value.toString(), }); }} /> { setAttributes({ formContent: value.toString(), }); }} /> { setAttributes({ formTitle: value.toString(), }); }} /> { setAttributes({ buttonText: value.toString(), }); }} /> )} {tab.name === "styles" && ( <> { setAttributes({ formContentColor: value, }); }} /> { setAttributes({ iconColor: value, }); }} /> { setAttributes({ feedbackFormHeadingColor: value, }); }} /> {FORM_HEADING_ALIGN.map( (item, key) => ( ) )} { setAttributes({ feedbackFormLabelColor: value, }); }} /> { setAttributes({ feedbackFormButtonBackColor: value, }); }} /> { setAttributes({ feedbackFormButtonTextColor: value, }); }} /> {FORM_BUTTON_ALIGN.map( (item, key) => ( ) )} )}
); }}
); }; export default Inspector;