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;
overflow: hidden;
color: $ui-orange;
font-weight: bold;
font-size: .875rem;
font-weight: bold;
align-self: center;
}

View file

@ -13,7 +13,8 @@
"project.comments.turnOff": "Turn off commenting",
"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.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.seeInsideButton": "See inside",
"project.remixButton": "Remix",

View file

@ -135,17 +135,28 @@ const PreviewPresentation = ({
message={embedCensorMessage(visibilityInfo.censorMessage)}
/>);
}
} else if (canShare && !isShared) {
banner = (<Banner
actionMessage={<FormattedMessage id="project.share.shareButton" />}
message={<FormattedMessage id="project.share.notShared" />}
onAction={onShare}
/>);
} else if (isShared && isNewScratcher) {
banner = (<Banner
className="banner-success"
message={<FormattedMessage id="project.share.shared" />}
/>);
} else if (canShare) {
if (isShared) {
if (justShared) {
if (isNewScratcher) {
banner = (<Banner
className="banner-success"
message={<FormattedMessage id="project.share.sharedLong" />}
/>);
} else {
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 (