allow pins to be zapped but not from pin position
This commit is contained in:
parent
cb5c12b82d
commit
c23f1f82bc
@ -369,7 +369,6 @@ export default {
|
|||||||
${relationClause(type)}
|
${relationClause(type)}
|
||||||
${joinZapRankPersonalView(me, models)}
|
${joinZapRankPersonalView(me, models)}
|
||||||
${whereClause(
|
${whereClause(
|
||||||
'"Item"."pinId" IS NULL',
|
|
||||||
'"Item"."deletedAt" IS NULL',
|
'"Item"."deletedAt" IS NULL',
|
||||||
subClause(sub, 5, subClauseTable(type), me),
|
subClause(sub, 5, subClauseTable(type), me),
|
||||||
typeClause(type),
|
typeClause(type),
|
||||||
@ -389,7 +388,6 @@ export default {
|
|||||||
${selectClause(type)}
|
${selectClause(type)}
|
||||||
${relationClause(type)}
|
${relationClause(type)}
|
||||||
${whereClause(
|
${whereClause(
|
||||||
'"Item"."pinId" IS NULL',
|
|
||||||
'"Item"."deletedAt" IS NULL',
|
'"Item"."deletedAt" IS NULL',
|
||||||
subClause(sub, 5, subClauseTable(type), me),
|
subClause(sub, 5, subClauseTable(type), me),
|
||||||
typeClause(type),
|
typeClause(type),
|
||||||
|
@ -25,7 +25,7 @@ import { MuteSubDropdownItem, PinSubDropdownItem } from './territory-header'
|
|||||||
export default function ItemInfo ({
|
export default function ItemInfo ({
|
||||||
item, full, commentsText = 'comments',
|
item, full, commentsText = 'comments',
|
||||||
commentTextSingular = 'comment', className, embellishUser, extraInfo, onEdit, editText,
|
commentTextSingular = 'comment', className, embellishUser, extraInfo, onEdit, editText,
|
||||||
onQuoteReply, nofollow, extraBadges, nested
|
onQuoteReply, nofollow, extraBadges, nested, pinnable
|
||||||
}) {
|
}) {
|
||||||
const editThreshold = new Date(item.createdAt).getTime() + 10 * 60000
|
const editThreshold = new Date(item.createdAt).getTime() + 10 * 60000
|
||||||
const me = useMe()
|
const me = useMe()
|
||||||
@ -57,7 +57,7 @@ export default function ItemInfo ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={className || `${styles.other}`}>
|
<div className={className || `${styles.other}`}>
|
||||||
{!item.position && !(!item.parentId && Number(item.user?.id) === AD_USER_ID) &&
|
{!(item.position && (pinnable || !item.subName)) && !(!item.parentId && Number(item.user?.id) === AD_USER_ID) &&
|
||||||
<>
|
<>
|
||||||
<span title={`from ${numWithUnits(item.upvotes, {
|
<span title={`from ${numWithUnits(item.upvotes, {
|
||||||
abbreviate: false,
|
abbreviate: false,
|
||||||
|
@ -24,7 +24,7 @@ export function SearchTitle ({ title }) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Item ({ item, rank, belowTitle, right, full, children, siblingComments, onQuoteReply }) {
|
export default function Item ({ item, rank, belowTitle, right, full, children, siblingComments, onQuoteReply, pinnable }) {
|
||||||
const titleRef = useRef()
|
const titleRef = useRef()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ export default function Item ({ item, rank, belowTitle, right, full, children, s
|
|||||||
</div>)
|
</div>)
|
||||||
: <div />}
|
: <div />}
|
||||||
<div className={`${styles.item} ${siblingComments ? 'pt-3' : ''}`}>
|
<div className={`${styles.item} ${siblingComments ? 'pt-3' : ''}`}>
|
||||||
{item.position
|
{item.position && (pinnable || !item.subName)
|
||||||
? <Pin width={24} height={24} className={styles.pin} />
|
? <Pin width={24} height={24} className={styles.pin} />
|
||||||
: item.meDontLikeSats > item.meSats
|
: item.meDontLikeSats > item.meSats
|
||||||
? <DownZap width={24} height={24} className={styles.dontLike} id={item.id} meDontLikeSats={item.meDontLikeSats} />
|
? <DownZap width={24} height={24} className={styles.dontLike} id={item.id} meDontLikeSats={item.meDontLikeSats} />
|
||||||
@ -95,6 +95,7 @@ export default function Item ({ item, rank, belowTitle, right, full, children, s
|
|||||||
full={full} item={item}
|
full={full} item={item}
|
||||||
onQuoteReply={onQuoteReply}
|
onQuoteReply={onQuoteReply}
|
||||||
nofollow={nofollow}
|
nofollow={nofollow}
|
||||||
|
pinnable={pinnable}
|
||||||
extraBadges={Number(item?.user?.id) === AD_USER_ID && <Badge className={styles.newComment} bg={null}>AD</Badge>}
|
extraBadges={Number(item?.user?.id) === AD_USER_ID && <Badge className={styles.newComment} bg={null}>AD</Badge>}
|
||||||
/>
|
/>
|
||||||
{belowTitle}
|
{belowTitle}
|
||||||
|
@ -49,7 +49,7 @@ export default function Items ({ ssrData, variables = {}, query, destructureData
|
|||||||
<>
|
<>
|
||||||
<div className={styles.grid}>
|
<div className={styles.grid}>
|
||||||
{itemsWithPins.filter(filter).map((item, i) => (
|
{itemsWithPins.filter(filter).map((item, i) => (
|
||||||
<ListItem key={item.id} item={item} rank={rank && i + 1} siblingComments={variables.includeComments} />
|
<ListItem key={item.id} item={item} rank={rank && i + 1} siblingComments={variables.includeComments} pinnable={pins?.length > 0} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<Foooter
|
<Foooter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user