show sats on full view pinned comments (#2071)

* show sats on full view pinned comments; simplify conditions; pass topLevel as full status for comments

* comment view: show Pin instead of Boost also for own items

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
This commit is contained in:
soxa 2025-04-15 21:57:01 +02:00 committed by GitHub
parent 719cb2d507
commit 22e4f8acf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 6 deletions

View File

@ -165,11 +165,13 @@ export default function Comment ({
<div className={`${itemStyles.item} ${styles.item}`}> <div className={`${itemStyles.item} ${styles.item}`}>
{item.outlawed && !me?.privates?.wildWestMode {item.outlawed && !me?.privates?.wildWestMode
? <Skull className={styles.dontLike} width={24} height={24} /> ? <Skull className={styles.dontLike} width={24} height={24} />
: pin
? <Pin width={22} height={22} className={styles.pin} />
: item.mine : item.mine
? <Boost item={item} className={styles.upvote} /> ? <Boost item={item} className={styles.upvote} />
: item.meDontLikeSats > item.meSats : item.meDontLikeSats > item.meSats
? <DownZap width={24} height={24} className={styles.dontLike} item={item} /> ? <DownZap width={24} height={24} className={styles.dontLike} item={item} />
: pin ? <Pin width={22} height={22} className={styles.pin} /> : <UpVote item={item} className={styles.upvote} collapsed={collapse === 'yep'} />} : <UpVote item={item} className={styles.upvote} collapsed={collapse === 'yep'} />}
<div className={`${itemStyles.hunk} ${styles.hunk}`}> <div className={`${itemStyles.hunk} ${styles.hunk}`}>
<div className='d-flex align-items-center'> <div className='d-flex align-items-center'>
{item.user?.meMute && !includeParent && collapse === 'yep' {item.user?.meMute && !includeParent && collapse === 'yep'
@ -182,6 +184,7 @@ export default function Comment ({
>reply from someone you muted >reply from someone you muted
</span>) </span>)
: <ItemInfo : <ItemInfo
full={topLevel}
item={item} item={item}
commentsText='replies' commentsText='replies'
commentTextSingular='reply' commentTextSingular='reply'

View File

@ -89,11 +89,14 @@ export default function ItemInfo ({
const myPost = (me && root && Number(me.id) === Number(root.user.id)) const myPost = (me && root && Number(me.id) === Number(root.user.id))
const rootReply = item.path.split('.').length === 2 const rootReply = item.path.split('.').length === 2
const canPin = (isPost && mySub) || (myPost && rootReply) const canPin = (isPost && mySub) || (myPost && rootReply)
const isPinnedPost = isPost && item.position && (pinnable || !item.subName)
const isPinnedSubReply = !isPost && item.position && !item.subName
const isAd = !item.parentId && Number(item.user?.id) === USER_ID.ad
const meSats = (me ? item.meSats : item.meAnonSats) || 0 const meSats = (me ? item.meSats : item.meAnonSats) || 0
return ( return (
<div className={className || `${styles.other}`}> <div className={className || `${styles.other}`}>
{!(item.position && (pinnable || !item.subName)) && !(!item.parentId && Number(item.user?.id) === USER_ID.ad) && {!isPinnedPost && !(isPinnedSubReply && !full) && !isAd &&
<> <>
<span title={itemTitle(item)}> <span title={itemTitle(item)}>
{numWithUnits(item.sats)} {numWithUnits(item.sats)}