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

Improve dialog shown after publishing scheduled/private stories #13478

Merged
merged 3 commits into from
Oct 27, 2023
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
26 changes: 20 additions & 6 deletions packages/wp-story-editor/src/components/postPublishDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ function PostPublishDialog() {
embedPostLink: confirmURL,
link: storyURL,
isFreshlyPublished,
status,
} = useStory(
({
state: {
story: { embedPostLink, link },
story: { embedPostLink, link, status },
meta: { isFreshlyPublished },
},
}) => ({
embedPostLink,
link,
isFreshlyPublished,
status,
})
);

Expand All @@ -61,12 +63,19 @@ function PostPublishDialog() {

const primaryText = confirmURL ? __('Add to new post', 'web-stories') : '';

const dialogTitle =
status === 'private'
? __('Story published privately.', 'web-stories')
: status === 'future'
? __('Story scheduled.', 'web-stories')
: __('Story published.', 'web-stories');

return (
<Dialog
isOpen={isOpen}
onClose={onClose}
// Same as item_published post type label.
title={__('Story published.', 'web-stories')}
title={dialogTitle}
secondaryText={__('Dismiss', 'web-stories')}
primaryText={primaryText}
onPrimary={onAddToPostClick}
Expand All @@ -87,10 +96,15 @@ function PostPublishDialog() {
),
}}
>
{__(
'Your story has been successfully published! <a>View story</a>.',
'web-stories'
)}
{status === 'future'
? __(
'Your story has been successfully scheduled! <a>View story</a>.',
'web-stories'
)
: __(
'Your story has been successfully published! <a>View story</a>.',
'web-stories'
)}
</TranslateWithMarkup>
</Text.Paragraph>
{confirmURL && (
Expand Down
Loading