indicate commenter is part of forwarded group

This commit is contained in:
keyan 2023-09-25 16:47:24 -05:00
parent 2a7267a35a
commit 374cc26224
1 changed files with 5 additions and 1 deletions

View File

@ -131,6 +131,10 @@ export default function Comment ({
const bottomedOut = depth === COMMENT_DEPTH_LIMIT const bottomedOut = depth === COMMENT_DEPTH_LIMIT
// Don't show OP badge when anon user comments on anon user posts // Don't show OP badge when anon user comments on anon user posts
const op = root.user.name === item.user.name && Number(item.user.id) !== ANON_USER_ID const op = root.user.name === item.user.name && Number(item.user.id) !== ANON_USER_ID
? 'OP'
: root.forwards.some(f => f.user.name === item.user.name) && Number(item.user.id) !== ANON_USER_ID
? 'OPG'
: null
const bountyPaid = root.bountyPaidTo?.includes(Number(item.id)) const bountyPaid = root.bountyPaidTo?.includes(Number(item.id))
return ( return (
@ -151,7 +155,7 @@ export default function Comment ({
commentsText='replies' commentsText='replies'
commentTextSingular='reply' commentTextSingular='reply'
className={`${itemStyles.other} ${styles.other}`} className={`${itemStyles.other} ${styles.other}`}
embellishUser={op && <><span> </span><Badge bg='boost' className={`${styles.op} bg-opacity-75`}>OP</Badge></>} embellishUser={op && <><span> </span><Badge bg='boost' className={`${styles.op} bg-opacity-75`}>{op}</Badge></>}
extraInfo={ extraInfo={
<> <>
{includeParent && <Parent item={item} rootText={rootText} />} {includeParent && <Parent item={item} rootText={rootText} />}