Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions packages/editor/src/components/post-publish-panel/prepublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,26 @@ import MaybePostFormatPanel from './maybe-post-format-panel';

function PostPublishPanelPrepublish( {
hasPublishAction,
isBeingScheduled,
children,
} ) {
let prePublishTitle, prePublishBodyText;

if ( ! hasPublishAction ) {
prePublishTitle = __( 'Are you ready to submit for review?' );
prePublishBodyText = __( 'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.' );
} else if ( isBeingScheduled ) {
prePublishTitle = __( 'Are you ready to schedule?' );
prePublishBodyText = __( 'Your post will be published at the specified date and time.' );
} else {
prePublishTitle = __( 'Are you ready to publish?' );
prePublishBodyText = __( 'Double-check your settings, then use the button to publish your post.' );
}

return (
<div className="editor-post-publish-panel__prepublish">
<div><strong>{ hasPublishAction ? __( 'Are you ready to publish?' ) : __( 'Are you ready to submit for review?' ) }</strong></div>
<p>{ hasPublishAction ? __( 'Double-check your settings, then use the button to publish your post.' ) : __( 'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.' ) }</p>
<div><strong>{ prePublishTitle }</strong></div>
<p>{ prePublishBodyText }</p>
{ hasPublishAction && (
<Fragment>
<PanelBody initialOpen={ false } title={ [
Expand All @@ -54,9 +68,13 @@ function PostPublishPanelPrepublish( {

export default withSelect(
( select ) => {
const { getCurrentPost } = select( 'core/editor' );
const {
getCurrentPost,
isEditedPostBeingScheduled,
} = select( 'core/editor' );
return {
hasPublishAction: get( getCurrentPost(), [ '_links', 'wp:action-publish' ], false ),
isBeingScheduled: isEditedPostBeingScheduled(),
};
}
)( PostPublishPanelPrepublish );