403Webshell
Server IP : 172.67.158.161  /  Your IP : 3.137.164.69
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/blocks/reviews/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/giankuin/www/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/blocks/reviews/editor-container-block.js
/**
 * External dependencies
 */
import { __ } from '@wordpress/i18n';
import { Component } from 'react';
import PropTypes from 'prop-types';
import { debounce } from 'lodash';
import { Placeholder } from '@wordpress/components';

/**
 * Internal dependencies
 */
import EditorBlock from './editor-block.js';
import { getBlockClassName, getSortArgs } from './utils.js';

/**
 * Container of the block rendered in the editor.
 */
class EditorContainerBlock extends Component {
	renderHiddenContentPlaceholder() {
		const { icon, name } = this.props;

		return (
			<Placeholder icon={ icon } label={ name }>
				{ __(
					'The content for this block is hidden due to block settings.',
					'woocommerce'
				) }
			</Placeholder>
		);
	}

	render() {
		const { attributes, className, noReviewsPlaceholder } = this.props;
		const {
			categoryIds,
			productId,
			reviewsOnPageLoad,
			showProductName,
			showReviewDate,
			showReviewerName,
			showReviewContent,
			showReviewImage,
			showReviewRating,
		} = attributes;
		const { order, orderby } = getSortArgs( attributes.orderby );
		const isAllContentHidden =
			! showReviewContent &&
			! showReviewRating &&
			! showReviewDate &&
			! showReviewerName &&
			! showReviewImage &&
			! showProductName;

		if ( isAllContentHidden ) {
			return this.renderHiddenContentPlaceholder();
		}

		return (
			<div className={ getBlockClassName( className, attributes ) }>
				<EditorBlock
					attributes={ attributes }
					categoryIds={ categoryIds }
					delayFunction={ ( callback ) => debounce( callback, 400 ) }
					noReviewsPlaceholder={ noReviewsPlaceholder }
					orderby={ orderby }
					order={ order }
					productId={ productId }
					reviewsToDisplay={ reviewsOnPageLoad }
				/>
			</div>
		);
	}
}

EditorContainerBlock.propTypes = {
	attributes: PropTypes.object.isRequired,
	icon: PropTypes.node.isRequired,
	name: PropTypes.string.isRequired,
	noReviewsPlaceholder: PropTypes.func.isRequired,
	className: PropTypes.string,
};

export default EditorContainerBlock;

Youez - 2016 - github.com/yon3zu
LinuXploit