Show deleted banner if both deleted and censored.

This is because the user can take an action to remove the trash status, but not the censored status.
This commit is contained in:
Paul Kaplan 2018-11-21 10:36:27 -05:00
parent 0b8c13fb40
commit 2ed74a2682

View file

@ -108,7 +108,12 @@ const PreviewPresentation = ({
);
let banner;
if (visibilityInfo.censored) {
if (visibilityInfo.deleted) { // If both censored and deleted, prioritize deleted banner
banner = (<Banner
className="banner-danger"
message={<FormattedMessage id="project.deletedBanner" />}
/>);
} else if (visibilityInfo.censored) {
if (visibilityInfo.reshareable) {
banner = (<Banner
actionMessage={<FormattedMessage id="project.share.shareButton" />}
@ -122,11 +127,6 @@ const PreviewPresentation = ({
message={embedCensorMessage(visibilityInfo.censorMessage)}
/>);
}
} else if (visibilityInfo.deleted) {
banner = (<Banner
className="banner-danger"
message={<FormattedMessage id="project.deletedBanner" />}
/>);
} else if (canShare && !isShared) {
banner = (<Banner
actionMessage={<FormattedMessage id="project.share.shareButton" />}