This commit is contained in:
Albert Juhé Lluveras 2019-08-27 12:01:35 +02:00 committed by GitHub
parent 20e3052d1c
commit a6bf6d7fc0
6 changed files with 39 additions and 15 deletions

View File

@ -8,11 +8,11 @@ import {
import { PanelBody, ToggleControl } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import PropTypes from 'prop-types';
import Gridicon from 'gridicons';
/**
* Internal dependencies
*/
import { IconAllReviews } from '../../../components/icons';
import EditorContainerBlock from '../editor-container-block.js';
import NoReviewsPlaceholder from './no-reviews-placeholder.js';
import { getSharedReviewContentControls, getSharedReviewListControls } from '../edit-utils.js';
@ -45,7 +45,7 @@ const AllReviewsEditor = ( { attributes, setAttributes } ) => {
<EditorContainerBlock
attributes={ attributes }
className="wc-block-all-reviews"
icon={ <Gridicon icon="list" /> }
icon={ <IconAllReviews className="block-editor-block-icon" /> }
name={ __( 'All Reviews', 'woo-gutenberg-products-block' ) }
noReviewsPlaceholder={ NoReviewsPlaceholder }
/>

View File

@ -3,13 +3,13 @@
*/
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import Gridicon from 'gridicons';
/**
* Internal dependencies
*/
import '../editor.scss';
import Editor from './edit';
import { IconAllReviews } from '../../../components/icons';
import sharedAttributes from '../attributes';
import save from '../save.js';
@ -19,7 +19,7 @@ import save from '../save.js';
registerBlockType( 'woocommerce/all-reviews', {
title: __( 'All Reviews', 'woo-gutenberg-products-block' ),
icon: {
src: <Gridicon icon="list" />,
src: <IconAllReviews className="block-editor-block-icon" />,
foreground: '#96588a',
},
category: 'woocommerce',

View File

@ -3,13 +3,17 @@
*/
import { __ } from '@wordpress/i18n';
import { Placeholder } from '@wordpress/components';
import Gridicon from 'gridicons';
/**
* Internal dependencies
*/
import { IconAllReviews } from '../../../components/icons';
const NoCategoryReviewsPlaceholder = () => {
return (
<Placeholder
className="wc-block-all-reviews"
icon={ <Gridicon icon="list" /> }
icon={ <IconAllReviews className="block-editor-block-icon" /> }
label={ __( 'All Reviews', 'woo-gutenberg-products-block' ) }
>
{ __( 'This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.', 'woo-gutenberg-products-block' ) }

View File

@ -0,0 +1,22 @@
/**
* External dependencies
*/
import { Icon } from '@wordpress/components';
export default ( { className, fillColor } ) => (
<Icon
className={ className }
icon={
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 22.41">
<g>
<g>
<path fill={ fillColor } d="M16.55 0H1.75C.56 0 0 .52 0 1.68v9.24c0 1.15.56 1.92 1.75 1.92H2V4.76a2.51 2.51 0 0 1 2.74-2.68H18v-.4A1.51 1.51 0 0 0 16.55 0z" />
<path fill={ fillColor } d="M19.54 3.11H4.74C3.55 3.11 3 3.64 3 4.79V14c0 1.19.55 2 1.74 2H5V7.88A2.51 2.51 0 0 1 7.73 5.2H21v-.41a1.51 1.51 0 0 0-1.46-1.68z" />
<path fill={ fillColor } d="M22.53 6.23H7.73C6.54 6.23 6 6.75 6 7.91v9.24c0 1.15.56 1.92 1.75 1.92h7a.59.59 0 0 1 .32.11l1.61 1.15 2.83 2a.31.31 0 0 0 .18.05.3.3 0 0 0 .31-.3v-2.73a.3.3 0 0 1 .28-.28h2.31A1.47 1.47 0 0 0 24 17.6V7.91a1.52 1.52 0 0 0-1.47-1.68z" />
<path fill="#ffffff" d="M10.2 10.92l1.06-2.14 1.05 2.14 2.37.35-1.71 1.66.4 2.36-2.11-1.11-.17.09-.52.27-.51.26-.92.49.18-1.02.09-.57.1-.56.03-.21-1.71-1.66 2.37-.35zM21.46 14.25h-4.4a.69.69 0 0 1-.69-.69.68.68 0 0 1 .69-.68h4.4a.68.68 0 0 1 .69.68.69.69 0 0 1-.69.69zM21.46 11.19h-4.4a.69.69 0 1 1 0-1.37h4.4a.69.69 0 1 1 0 1.37z" />
</g>
</g>
</svg>
}
/>
);

View File

@ -1,4 +1,5 @@
// Export each icon as a named component.
export { default as IconAllReviews } from './all-reviews';
export { default as IconCheckChecked } from './checkbox-checked';
export { default as IconCheckUnchecked } from './checkbox-unchecked';
export { default as IconFolder } from './folder';

View File

@ -7,15 +7,12 @@ export default ( { className, fillColor } ) => (
<Icon
className={ className }
icon={
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 22.41">
<g>
<g>
<path fill={ fillColor } d="M16.55 0H1.75C.56 0 0 .52 0 1.68v9.24c0 1.15.56 1.92 1.75 1.92H2V4.76a2.51 2.51 0 0 1 2.74-2.68H18v-.4A1.51 1.51 0 0 0 16.55 0z" />
<path fill={ fillColor } d="M19.54 3.11H4.74C3.55 3.11 3 3.64 3 4.79V14c0 1.19.55 2 1.74 2H5V7.88A2.51 2.51 0 0 1 7.73 5.2H21v-.41a1.51 1.51 0 0 0-1.46-1.68z" />
<path fill={ fillColor } d="M22.53 6.23H7.73C6.54 6.23 6 6.75 6 7.91v9.24c0 1.15.56 1.92 1.75 1.92h7a.59.59 0 0 1 .32.11l1.61 1.15 2.83 2a.31.31 0 0 0 .18.05.3.3 0 0 0 .31-.3v-2.73a.3.3 0 0 1 .28-.28h2.31A1.47 1.47 0 0 0 24 17.6V7.91a1.52 1.52 0 0 0-1.47-1.68z" />
<path fill="#ffffff" d="M10.2 10.92l1.06-2.14 1.05 2.14 2.37.35-1.71 1.66.4 2.36-2.11-1.11-.17.09-.52.27-.51.26-.92.49.18-1.02.09-.57.1-.56.03-.21-1.71-1.66 2.37-.35zM21.46 14.25h-4.4a.69.69 0 0 1-.69-.69.68.68 0 0 1 .69-.68h4.4a.68.68 0 0 1 .69.68.69.69 0 0 1-.69.69zM21.46 11.19h-4.4a.69.69 0 1 1 0-1.37h4.4a.69.69 0 1 1 0 1.37z" />
</g>
</g>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 23">
<path fill={ fillColor } d="M21.9943 7.0957H2.00638C0.807102 7.0957 -0.0923543 8.0951 0.0075853 9.29437L0.707162 20.3877C0.807102 21.487 1.70656 22.2865 2.70595 22.2865H21.1948C22.2941 22.2865 23.1936 21.487 23.1936 20.3877L23.9931 9.29437C24.093 8.0951 23.0936 7.0957 21.9943 7.0957Z" />
<path fill={ fillColor } d="M13.0921 2.39855V1.99879C13.0921 0.899456 12.1926 0 11.0933 0H4.7971C3.69777 0 2.79831 0.899456 2.79831 1.99879V5.39674H21.1872V4.49728C21.1872 3.39795 20.2877 2.49849 19.1884 2.49849H13.0921V2.39855Z" />
<path fill="white" d="M8.63115 17.126L6.5415 15.9449L4.361 17.126L4.72442 14.6729L2.99819 13.0376L5.45125 12.6742L6.5415 10.4937L7.5409 12.6742L9.99396 13.0376L8.26773 14.6729L8.63115 17.126Z" />
<path fill="white" d="M19.1907 13.5918H12.9899C12.547 13.5918 12.1926 13.1921 12.1926 12.6924C12.1926 12.1927 12.547 11.7929 12.9899 11.7929H19.1907C19.6336 11.7929 19.9879 12.1927 19.9879 12.6924C19.9879 13.1921 19.6336 13.5918 19.1907 13.5918Z" />
<path fill="white" d="M19.1907 17.1897H12.9899C12.547 17.1897 12.1926 16.7899 12.1926 16.2902C12.1926 15.7905 12.547 15.3907 12.9899 15.3907H19.1907C19.6336 15.3907 19.9879 15.7905 19.9879 16.2902C19.9879 16.7899 19.6336 17.1897 19.1907 17.1897Z" />
</svg>
}
/>