show badges for suspended and premod users (#2895)

Co-authored-by: Kim Gardner <kgardnr@gmail.com>
This commit is contained in:
Tessa Thornton
2020-03-26 20:34:14 -04:00
committed by GitHub
co-authored by Kim Gardner
parent 0f9b2ba114
commit 44216221a4
2 changed files with 37 additions and 6 deletions
@@ -13,16 +13,39 @@ interface Props {
}
const CommentAuthorContainer: FunctionComponent<Props> = ({ comment }) => {
if (!comment.author || !comment.author.status.ban.active) {
if (
!comment.author ||
!(
comment.author.status.ban.active ||
comment.author.status.premod.active ||
comment.author.status.suspension.active
)
) {
return null;
}
return (
<>
<div className={styles.authorStatus}>
<Localized id="commentAuthor-status-banned">
<Tag color="error">BANNED</Tag>
</Localized>
</div>
{comment.author.status.ban.active && (
<div className={styles.authorStatus}>
<Localized id="commentAuthor-status-banned">
<Tag color="error">BANNED</Tag>
</Localized>
</div>
)}
{comment.author.status.suspension.active && (
<div className={styles.authorStatus}>
<Localized id="commentAuthor-status-suspended">
<Tag color="error">SUSPENDED</Tag>
</Localized>
</div>
)}
{comment.author.status.premod.active && (
<div className={styles.authorStatus}>
<Localized id="commentAuthor-status-premod">
<Tag color="grey">PRE-MOD</Tag>
</Localized>
</div>
)}
</>
);
};
@@ -34,6 +57,12 @@ const enhanced = withFragmentContainer<Props>({
id
username
status {
suspension {
active
}
premod {
active
}
ban {
active
}
+2
View File
@@ -1092,6 +1092,8 @@ configure-advanced-stories-custom-user-agent-detail =
scrape request.
commentAuthor-status-banned = Banned
commentAuthor-status-premod = Pre-mod
commentAuthor-status-suspended = Suspended
hotkeysModal-title = Keyboard shortcuts
hotkeysModal-navigation-shortcuts = Navigation shortcuts