From 9c6b0318dc54090156d2408592ac8d9eb3080d59 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Tue, 1 Feb 2022 12:19:03 +0100 Subject: [PATCH] blocks: remove BlockIcon wrapper in multiple blocks. Follow-up from #13324 --- .../jetpack/changelog/update-block-icons | 4 +++ .../jetpack/extensions/blocks/amazon/edit.js | 9 ++---- .../extensions/blocks/business-hours/edit.js | 8 +---- .../extensions/blocks/calendly/edit.js | 4 +-- .../extensions/blocks/conversation/edit.js | 4 +-- .../extensions/blocks/eventbrite/edit.js | 4 +-- .../extensions/blocks/google-calendar/edit.js | 29 +++++++------------ .../extensions/blocks/opentable/edit.js | 4 +-- .../pinterest/components/edit-url-form.js | 7 +---- .../extensions/blocks/podcast-player/edit.js | 5 ++-- .../jetpack/extensions/blocks/revue/edit.js | 4 +-- .../extensions/blocks/slideshow/edit.js | 9 ++---- .../jetpack/extensions/blocks/story/edit.js | 4 +-- .../extensions/blocks/story/edit.native.js | 6 ++-- .../extensions/blocks/tiled-gallery/edit.js | 3 +- .../blocks/tiled-gallery/edit.native.js | 3 +- 16 files changed, 38 insertions(+), 69 deletions(-) create mode 100644 projects/plugins/jetpack/changelog/update-block-icons diff --git a/projects/plugins/jetpack/changelog/update-block-icons b/projects/plugins/jetpack/changelog/update-block-icons new file mode 100644 index 0000000000000..874186f820049 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-block-icons @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Blocks: remove BlockIcon wrapper for multiple blocks. diff --git a/projects/plugins/jetpack/extensions/blocks/amazon/edit.js b/projects/plugins/jetpack/extensions/blocks/amazon/edit.js index 6c4337042effa..326362874222e 100644 --- a/projects/plugins/jetpack/extensions/blocks/amazon/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/amazon/edit.js @@ -7,12 +7,7 @@ import { __ } from '@wordpress/i18n'; /** * WordPress dependencies */ -import { - BlockIcon, - ContrastChecker, - InspectorControls, - PanelColorSettings, -} from '@wordpress/block-editor'; +import { ContrastChecker, InspectorControls, PanelColorSettings } from '@wordpress/block-editor'; import { Button, ExternalLink, @@ -80,7 +75,7 @@ function AmazonEdit( { } + icon={ icon } notices={ noticeUI } // TODO >
diff --git a/projects/plugins/jetpack/extensions/blocks/business-hours/edit.js b/projects/plugins/jetpack/extensions/blocks/business-hours/edit.js index ea6c6af64f7c2..6d02b13691192 100644 --- a/projects/plugins/jetpack/extensions/blocks/business-hours/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/business-hours/edit.js @@ -5,7 +5,6 @@ import apiFetch from '@wordpress/api-fetch'; import classNames from 'classnames'; import { __ } from '@wordpress/i18n'; import { __experimentalGetSettings } from '@wordpress/date'; -import { BlockIcon } from '@wordpress/block-editor'; import { Component } from '@wordpress/element'; import { Placeholder } from '@wordpress/components'; @@ -60,12 +59,7 @@ class BusinessHours extends Component { const localizedWeek = days.concat( days.slice( 0, startOfWeek ) ).slice( startOfWeek ); if ( ! hasFetched ) { - return ( - } - label={ __( 'Loading business hours', 'jetpack' ) } - /> - ); + return ; } if ( ! isSelected ) { diff --git a/projects/plugins/jetpack/extensions/blocks/calendly/edit.js b/projects/plugins/jetpack/extensions/blocks/calendly/edit.js index 1091103dea43b..96406c12feee6 100644 --- a/projects/plugins/jetpack/extensions/blocks/calendly/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/calendly/edit.js @@ -8,7 +8,7 @@ import queryString from 'query-string'; /** * WordPress dependencies */ -import { BlockIcon, InnerBlocks } from '@wordpress/block-editor'; +import { InnerBlocks } from '@wordpress/block-editor'; import { Button, ExternalLink, Placeholder, Spinner, withNotices } from '@wordpress/components'; import { useEffect, useState } from '@wordpress/element'; import { __, _x } from '@wordpress/i18n'; @@ -128,7 +128,7 @@ export function CalendlyEdit( props ) { } + icon={ icon } notices={ noticeUI } > diff --git a/projects/plugins/jetpack/extensions/blocks/conversation/edit.js b/projects/plugins/jetpack/extensions/blocks/conversation/edit.js index 6e95a57097cd5..920a931860d65 100644 --- a/projects/plugins/jetpack/extensions/blocks/conversation/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/conversation/edit.js @@ -3,7 +3,7 @@ */ import { __ } from '@wordpress/i18n'; import { useCallback, useMemo, useState } from '@wordpress/element'; -import { InnerBlocks, InspectorControls, BlockIcon } from '@wordpress/block-editor'; +import { InnerBlocks, InspectorControls } from '@wordpress/block-editor'; import { Panel, PanelBody, @@ -199,7 +199,7 @@ function ConversationEdit( { } - icon={ } + icon={ icon } notices={ noticeUI } >
diff --git a/projects/plugins/jetpack/extensions/blocks/eventbrite/edit.js b/projects/plugins/jetpack/extensions/blocks/eventbrite/edit.js index 0e9aff5161a3c..874019574a53c 100644 --- a/projects/plugins/jetpack/extensions/blocks/eventbrite/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/eventbrite/edit.js @@ -11,7 +11,7 @@ import { ExternalLink, withNotices, } from '@wordpress/components'; -import { BlockControls, BlockIcon, InnerBlocks } from '@wordpress/block-editor'; +import { BlockControls, InnerBlocks } from '@wordpress/block-editor'; /** * Internal dependencies @@ -176,7 +176,7 @@ export class EventbriteEdit extends Component { 'Paste a link to an Eventbrite event to embed ticket checkout.', 'jetpack' ) } - icon={ } + icon={ icon } notices={ noticeUI } > diff --git a/projects/plugins/jetpack/extensions/blocks/google-calendar/edit.js b/projects/plugins/jetpack/extensions/blocks/google-calendar/edit.js index c2ee8b38c4500..ca7790adfc9c6 100644 --- a/projects/plugins/jetpack/extensions/blocks/google-calendar/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/google-calendar/edit.js @@ -3,15 +3,9 @@ */ import { __, _x } from '@wordpress/i18n'; import { useEffect, useState } from '@wordpress/element'; -import { - Placeholder, - SandBox, - Button, - ExternalLink, - withNotices, -} from '@wordpress/components'; +import { Placeholder, SandBox, Button, ExternalLink, withNotices } from '@wordpress/components'; import { compose } from '@wordpress/compose'; -import { BlockIcon, InspectorControls } from '@wordpress/block-editor'; +import { InspectorControls } from '@wordpress/block-editor'; import { withViewportMatch } from '@wordpress/viewport'; import { getBlockDefaultClassName } from '@wordpress/blocks'; @@ -67,7 +61,7 @@ export function GoogleCalendarEdit( props ) { ); }; - const handleEmbed = ( event ) => { + const handleEmbed = event => { if ( event ) { event.preventDefault(); } @@ -84,7 +78,7 @@ export function GoogleCalendarEdit( props ) { noticeOperations.removeAllNotices(); }; - const getEditForm = ( formClassName ) => ( + const getEditForm = formClassName => (