Skip to content

Commit

Permalink
Post Featured Image: Remove withNotices HOC (#36596)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Nov 18, 2021
1 parent 4384d9c commit 0f77a12
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/block-library/src/post-featured-image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
ToggleControl,
PanelBody,
Placeholder,
withNotices,
Button,
} from '@wordpress/components';
import {
Expand Down Expand Up @@ -54,7 +53,6 @@ function PostFeaturedImageDisplay( {
attributes,
setAttributes,
context: { postId, postType, queryId },
noticeUI,
} ) {
const isDescendentOfQueryLoop = !! queryId;
const { isLink, height, width, scale } = attributes;
Expand Down Expand Up @@ -111,7 +109,6 @@ function PostFeaturedImageDisplay( {
allowedTypes={ ALLOWED_MEDIA_TYPES }
onError={ onUploadError }
placeholder={ placeholder }
notices={ noticeUI }
mediaLibraryButton={ ( { open } ) => {
return (
<Button
Expand Down Expand Up @@ -181,12 +178,10 @@ function PostFeaturedImageDisplay( {
);
}

const PostFeaturedImageWithNotices = withNotices( PostFeaturedImageDisplay );

export default function PostFeaturedImageEdit( props ) {
const blockProps = useBlockProps();
if ( ! props.context?.postId ) {
return <div { ...blockProps }>{ placeholderChip }</div>;
}
return <PostFeaturedImageWithNotices { ...props } />;
return <PostFeaturedImageDisplay { ...props } />;
}

0 comments on commit 0f77a12

Please sign in to comment.