Skip to content

show sats on full view pinned comments #2071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions components/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ export default function Comment ({
<div className={`${itemStyles.item} ${styles.item}`}>
{item.outlawed && !me?.privates?.wildWestMode
? <Skull className={styles.dontLike} width={24} height={24} />
: item.mine
? <Boost item={item} className={styles.upvote} />
: item.meDontLikeSats > item.meSats
? <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'} />}
: pin
? <Pin width={22} height={22} className={styles.pin} />
: item.mine
? <Boost item={item} className={styles.upvote} />
: item.meDontLikeSats > item.meSats
? <DownZap width={24} height={24} className={styles.dontLike} item={item} />
: <UpVote item={item} className={styles.upvote} collapsed={collapse === 'yep'} />}
<div className={`${itemStyles.hunk} ${styles.hunk}`}>
<div className='d-flex align-items-center'>
{item.user?.meMute && !includeParent && collapse === 'yep'
Expand All @@ -182,6 +184,7 @@ export default function Comment ({
>reply from someone you muted
</span>)
: <ItemInfo
full={topLevel}
item={item}
commentsText='replies'
commentTextSingular='reply'
Expand Down
5 changes: 4 additions & 1 deletion components/item-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ export default function ItemInfo ({
const myPost = (me && root && Number(me.id) === Number(root.user.id))
const rootReply = item.path.split('.').length === 2
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

return (
<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)}>
{numWithUnits(item.sats)}
Expand Down