import { createHigherOrderComponent } from "@wordpress/compose"; import { InspectorControls } from "@wordpress/block-editor"; import { PanelBody, ToggleControl, Icon } from "@wordpress/components"; import { addFilter } from "@wordpress/hooks"; // Custom responsive icon const responsiveIcon = ( ); const withResponsiveControls = createHigherOrderComponent((BlockEdit) => { return (props) => { const { attributes, setAttributes, isSelected } = props; const { hideOnMobile, hideOnTablet, hideOnDesktop } = attributes; return ( <> {isSelected && ( Responsive Settings } initialOpen={false} className="blynex-responsive-panel" > setAttributes({ hideOnMobile: !hideOnMobile })} /> setAttributes({ hideOnTablet: !hideOnTablet })} /> setAttributes({ hideOnDesktop: !hideOnDesktop }) } /> )} ); }; }, "withResponsiveControls"); addFilter( "editor.BlockEdit", "awp/cover-custom-controls", withResponsiveControls );