long and short shared messages; clarified logic around which banner to show

This commit is contained in:
Ben Wheeler 2018-11-28 17:58:37 -08:00
parent 3af745eede
commit a6a5ef7941
3 changed files with 25 additions and 13 deletions

View file

@ -9,8 +9,8 @@ $navigation-height: 50px;
min-height: 3.75rem; min-height: 3.75rem;
overflow: hidden; overflow: hidden;
color: $ui-orange; color: $ui-orange;
font-weight: bold;
font-size: .875rem; font-size: .875rem;
font-weight: bold;
align-self: center; align-self: center;
} }

View file

@ -13,7 +13,8 @@
"project.comments.turnOff": "Turn off commenting", "project.comments.turnOff": "Turn off commenting",
"project.comments.turnedOff": "Sorry, comment posting has been turned off for this project.", "project.comments.turnedOff": "Sorry, comment posting has been turned off for this project.",
"project.share.notShared": "This project is not shared — so only you can see it. Click share to let everyone see it!", "project.share.notShared": "This project is not shared — so only you can see it. Click share to let everyone see it!",
"project.share.shared": "Congratulations on sharing your project! Other people can now try it out, give comments, and remix it.", "project.share.sharedLong": "Congratulations on sharing your project! Other people can now try it out, give comments, and remix it.",
"project.share.sharedShort": "Your project is now shared.",
"project.share.shareButton": "Share", "project.share.shareButton": "Share",
"project.seeInsideButton": "See inside", "project.seeInsideButton": "See inside",
"project.remixButton": "Remix", "project.remixButton": "Remix",

View file

@ -135,17 +135,28 @@ const PreviewPresentation = ({
message={embedCensorMessage(visibilityInfo.censorMessage)} message={embedCensorMessage(visibilityInfo.censorMessage)}
/>); />);
} }
} else if (canShare && !isShared) { } else if (canShare) {
banner = (<Banner if (isShared) {
actionMessage={<FormattedMessage id="project.share.shareButton" />} if (justShared) {
message={<FormattedMessage id="project.share.notShared" />} if (isNewScratcher) {
onAction={onShare} banner = (<Banner
/>); className="banner-success"
} else if (isShared && isNewScratcher) { message={<FormattedMessage id="project.share.sharedLong" />}
banner = (<Banner />);
className="banner-success" } else {
message={<FormattedMessage id="project.share.shared" />} banner = (<Banner
/>); className="banner-success"
message={<FormattedMessage id="project.share.sharedShort" />}
/>);
}
} // if was shared a while ago, don't show any share banner
} else {
banner = (<Banner
actionMessage={<FormattedMessage id="project.share.shareButton" />}
message={<FormattedMessage id="project.share.notShared" />}
onAction={onShare}
/>);
}
} }
return ( return (