Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine "preview" and "publish" Tips copy #16131

Closed
wants to merge 10 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export default function( { postId } ) {
'core/editor.inserter',
'core/editor.settings',
'core/editor.preview',
'core/editor.publish',
] );
}, [ triggerGuide ] );
return null;
Expand Down
21 changes: 13 additions & 8 deletions packages/edit-post/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,19 @@ function Header( {
forceIsSaving={ isSaving }
/>
) }
<PostPreviewButton
forceIsAutosaveable={ hasActiveMetaboxes }
forcePreviewLink={ isSaving ? null : undefined }
/>
<PostPublishButtonOrToggle
forceIsDirty={ hasActiveMetaboxes }
forceIsSaving={ isSaving }
/>
<div>
<PostPreviewButton
forceIsAutosaveable={ hasActiveMetaboxes }
forcePreviewLink={ isSaving ? null : undefined }
/>
<PostPublishButtonOrToggle
forceIsDirty={ hasActiveMetaboxes }
forceIsSaving={ isSaving }
/>
<DotTip tipId="core/editor.preview">
{ __( 'Want to see how your work will be displayed? Use the “Preview” button. When you’re ready to publish or schedule, use the “Publish” button.' ) }
</DotTip>
</div>
<div>
<IconButton
icon="admin-generic"
Expand Down
4 changes: 0 additions & 4 deletions packages/editor/src/components/post-preview-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { Component, renderToString } from '@wordpress/element';
import { Button, Path, SVG } from '@wordpress/components';
import { __, _x } from '@wordpress/i18n';
import { withSelect, withDispatch } from '@wordpress/data';
import { DotTip } from '@wordpress/nux';
import { ifCondition, compose } from '@wordpress/compose';
import { applyFilters } from '@wordpress/hooks';

Expand Down Expand Up @@ -191,9 +190,6 @@ export class PostPreviewButton extends Component {
__( '(opens in a new tab)' )
}
</span>
<DotTip tipId="core/editor.preview">
{ __( 'Click “Preview” to load a preview of this page, so you can make sure you’re happy with your blocks.' ) }
</DotTip>
</Button>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ exports[`PostPreviewButton render() should render currentPostLink otherwise 1`]
>
(opens in a new tab)
</span>
<WithSelect(WithDispatch(DotTip))
tipId="core/editor.preview"
>
Click “Preview” to load a preview of this page, so you can make sure you’re happy with your blocks.
</WithSelect(WithDispatch(DotTip))>
</ForwardRef(Button)>
`;

Expand All @@ -38,10 +33,5 @@ exports[`PostPreviewButton render() should render previewLink if provided 1`] =
>
(opens in a new tab)
</span>
<WithSelect(WithDispatch(DotTip))
tipId="core/editor.preview"
>
Click “Preview” to load a preview of this page, so you can make sure you’re happy with your blocks.
</WithSelect(WithDispatch(DotTip))>
</ForwardRef(Button)>
`;
9 changes: 1 addition & 8 deletions packages/editor/src/components/post-publish-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Component, createRef } from '@wordpress/element';
import { withSelect, withDispatch } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { __ } from '@wordpress/i18n';
import { DotTip } from '@wordpress/nux';

/**
* Internal dependencies
Expand Down Expand Up @@ -111,14 +110,8 @@ export class PostPublishButton extends Component {
const componentProps = isToggle ? toggleProps : buttonProps;
const componentChildren = isToggle ? toggleChildren : buttonChildren;
return (
<Button
ref={ this.buttonNode }
{ ...componentProps }
>
<Button ref={ this.buttonNode } { ...componentProps }>
{ componentChildren }
<DotTip tipId="core/editor.publish">
{ __( 'Finished writing? That’s great, let’s get this published right now. Just click “Publish” and you’re good to go.' ) }
</DotTip>
</Button>
);
}
Expand Down