From 971b3dc2d1ac8147b614d305c416348c2a3c2fd6 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Tue, 22 Jan 2019 16:36:19 -0500 Subject: [PATCH] added autocensor-specific banner message --- src/views/preview/banner.scss | 4 +-- src/views/preview/l10n.json | 2 ++ src/views/preview/presentation.jsx | 53 +++++++++++++++++++----------- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/views/preview/banner.scss b/src/views/preview/banner.scss index 42ac02310..478b2e40d 100644 --- a/src/views/preview/banner.scss +++ b/src/views/preview/banner.scss @@ -2,7 +2,7 @@ $navigation-height: 50px; -.banner-outer{ +.banner-outer { display: flex; background-color: $ui-orange-25percent; width: 100%; @@ -32,7 +32,7 @@ $navigation-height: 50px; flex-wrap: nowrap; } -.banner-text{ +.banner-text { padding: .625rem 0; max-width: 50rem; line-height: 1.25rem; diff --git a/src/views/preview/l10n.json b/src/views/preview/l10n.json index bc02f8ce9..558750fa0 100644 --- a/src/views/preview/l10n.json +++ b/src/views/preview/l10n.json @@ -29,6 +29,8 @@ "project.credit": "Thanks to {userLink} for the original project {projectLink}.", "project.deletedBanner": "Note: This project is in the trash folder", "project.defaultCensoredMessage": "This project was removed by the Scratch Team because it was disrespectful, inappropriate for all ages, or otherwise breaks the Scratch community guidelines.", + "project.communityCensoredMessage": "Your project has been temporarily un-shared because multiple people reported it as inappropriate.", + "project.willReviewCensoredMessage": "The Scratch Team will review the project based on the {communityGuidelinesLink}, and either restore the project or confirm the censorship.", "project.tempCensoredMessage": "Please read the {communityGuidelinesLink} and be sure to edit the project to make sure it's respectful before resharing it.", "project.permCensoredMessage": "It cannot be reshared at any time in the future.", "project.communityGuidelines": "community guidelines", diff --git a/src/views/preview/presentation.jsx b/src/views/preview/presentation.jsx index 6a72ac670..8b8017208 100644 --- a/src/views/preview/presentation.jsx +++ b/src/views/preview/presentation.jsx @@ -148,27 +148,40 @@ const PreviewPresentation = ({ if (visibilityInfo.message) { // if message is present, set innerHTML with it censoredMessage = embedCensorMessage(visibilityInfo.message); } else { // if message is blank or missing, use default - censoredMessage = ( - - -
-
- {visibilityInfo.reshareable ? ( - - - - ) - }} - /> - ) : ( - - )} -
+ const communityGuidelinesLink = ( + + + ); + if (visibilityInfo.censoredByCommunity) { + censoredMessage = ( + + +
+
+ +
+ ); + } else { + censoredMessage = ( + + +
+
+ {visibilityInfo.reshareable ? ( + + ) : ( + + )} +
+ ); + } } banner = (