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 and noisysocks committed Nov 22, 2021
1 parent e53ef2b commit a829564
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 @@ -7,7 +7,6 @@ import {
ToggleControl,
PanelBody,
Placeholder,
withNotices,
Button,
} from '@wordpress/components';
import {
Expand Down Expand Up @@ -53,7 +52,6 @@ function PostFeaturedImageDisplay( {
attributes,
setAttributes,
context: { postId, postType, queryId },
noticeUI,
} ) {
const isDescendentOfQueryLoop = !! queryId;
const { isLink, height, width, scale } = attributes;
Expand Down Expand Up @@ -110,7 +108,6 @@ function PostFeaturedImageDisplay( {
allowedTypes={ ALLOWED_MEDIA_TYPES }
onError={ onUploadError }
placeholder={ placeholder }
notices={ noticeUI }
mediaLibraryButton={ ( { open } ) => {
return (
<Button
Expand Down Expand Up @@ -176,12 +173,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 a829564

Please sign in to comment.