Skip to content

Commit

Permalink
Add PostFeaturedImage to PrePublishPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 committed Aug 25, 2021
1 parent d41e10c commit cb979f8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27,307 deletions.
29 changes: 17 additions & 12 deletions assets/src/common/components/pre-publish-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
* WordPress dependencies
*/
import { Notice } from '@wordpress/components';
import { PostFeaturedImage } from '@wordpress/editor';
import { PluginPrePublishPanel } from '@wordpress/edit-post';
import { withSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
Expand Down Expand Up @@ -37,18 +38,22 @@ const PrePublishPanel = ( { featuredMedia, dimensions, required } ) => {
title={ __( 'Featured Image', 'amp' ) }
initialOpen="true"
>
<Notice
status={ required ? 'warning' : 'notice' }
isDismissible={ false }
>
{ errors.map( ( errorMessage, index ) => {
return (
<p key={ `error-${ index }` }>
{ errorMessage }
</p>
);
} ) }
</Notice>
<PostFeaturedImage
noticeUI={
<Notice
status={ required ? 'warning' : 'notice' }
isDismissible={ false }
>
{ errors.map( ( errorMessage, index ) => {
return (
<p key={ `error-${ index }` }>
{ errorMessage }
</p>
);
} ) }r
</Notice>
}
/>
</PluginPrePublishPanel>
);
};
Expand Down
Loading

0 comments on commit cb979f8

Please sign in to comment.