mirror of
https://github.com/wassname/talk.git
synced 2026-08-11 11:27:10 +08:00
show badges for suspended and premod users (#2895)
Co-authored-by: Kim Gardner <kgardnr@gmail.com>
This commit is contained in:
co-authored by
Kim Gardner
parent
0f9b2ba114
commit
44216221a4
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user