Server IP : 104.21.14.103 / Your IP : 18.119.139.219 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 : /proc/thread-self/root/home/giankuin/sieuthiweb.com.vn/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/blocks/reviews/all-reviews/ |
Upload File : |
/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { InspectorControls } from '@wordpress/block-editor'; import { PanelBody, ToggleControl } from '@wordpress/components'; import { Fragment } from '@wordpress/element'; import PropTypes from 'prop-types'; import { Icon, discussion } from '@woocommerce/icons'; /** * Internal dependencies */ import EditorContainerBlock from '../editor-container-block.js'; import NoReviewsPlaceholder from './no-reviews-placeholder.js'; import { getSharedReviewContentControls, getSharedReviewListControls, } from '../edit-utils.js'; /** * Component to handle edit mode of "All Reviews". */ const AllReviewsEditor = ( { attributes, setAttributes } ) => { const getInspectorControls = () => { return ( <InspectorControls key="inspector"> <PanelBody title={ __( 'Content', 'woocommerce' ) } > <ToggleControl label={ __( 'Product name', 'woocommerce' ) } checked={ attributes.showProductName } onChange={ () => setAttributes( { showProductName: ! attributes.showProductName, } ) } /> { getSharedReviewContentControls( attributes, setAttributes ) } </PanelBody> <PanelBody title={ __( 'List Settings', 'woocommerce' ) } > { getSharedReviewListControls( attributes, setAttributes ) } </PanelBody> </InspectorControls> ); }; return ( <Fragment> { getInspectorControls() } <EditorContainerBlock attributes={ attributes } className="wc-block-all-reviews" icon={ <Icon icon={ discussion } className="block-editor-block-icon" /> } name={ __( 'All Reviews', 'woocommerce' ) } noReviewsPlaceholder={ NoReviewsPlaceholder } /> </Fragment> ); }; AllReviewsEditor.propTypes = { /** * The attributes for this block. */ attributes: PropTypes.object.isRequired, /** * The register block name. */ name: PropTypes.string.isRequired, /** * A callback to update attributes. */ setAttributes: PropTypes.func.isRequired, }; export default AllReviewsEditor;