Server IP : 104.21.14.103 / Your IP : 3.146.176.172 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/giankuin/www/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/hocs/with-feedback-prompt/ |
Upload File : |
/** * External dependencies */ import { Fragment } from '@wordpress/element'; import { InspectorControls } from '@wordpress/block-editor'; import { createHigherOrderComponent } from '@wordpress/compose'; import FeedbackPrompt from '@woocommerce/block-components/feedback-prompt'; /** * Adds a feedback prompt with custom text to the editor sidebar. * * @param {string} content Text to display in the feedback prompt. * * @return {Function} Function that returns the wrapped component. */ const withFeedbackPrompt = ( content ) => /** * Adds a feedback prompt to the provided component. * * @param {WPComponent} BlockEdit Original component. * * @return {WPComponent} Wrapped component. */ createHigherOrderComponent( ( BlockEdit ) => { return ( props ) => ( <Fragment> <InspectorControls> <FeedbackPrompt text={ content } /> </InspectorControls> <BlockEdit { ...props } /> </Fragment> ); }, 'withFeedbackPrompt' ); export default withFeedbackPrompt;