Skip to content

Commit

Permalink
♻️ Enhance PostPublishDialog wording for scheduled and private
Browse files Browse the repository at this point in the history
…story
  • Loading branch information
AnuragVasanwala committed Oct 18, 2023
1 parent 5ae0d73 commit 1a0ef82
Showing 1 changed file with 20 additions and 6 deletions.
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

0 comments on commit 1a0ef82

Please sign in to comment.