show dead jobs

This commit is contained in:
keyan 2022-06-02 18:25:21 -05:00
parent c061f4a6f0
commit 8713bf178a
3 changed files with 12 additions and 5 deletions

View File

@ -77,7 +77,7 @@ export default {
} }
const activeOrMine = () => { const activeOrMine = () => {
return me ? ` AND (status = 'ACTIVE' OR "userId" = ${me.id}) ` : ' AND status = \'ACTIVE\' ' return me ? ` AND (status <> 'STOPPED' OR "userId" = ${me.id}) ` : ' AND status <> \'STOPPED\' '
} }
switch (sort) { switch (sort) {
@ -140,8 +140,8 @@ export default {
WHERE "parentId" IS NULL AND created_at <= $1 WHERE "parentId" IS NULL AND created_at <= $1
AND "pinId" IS NULL AND "pinId" IS NULL
${subClause(3)} ${subClause(3)}
AND status = 'ACTIVE' AND status <> 'STOPPED'
ORDER BY "maxBid" DESC, created_at ASC ORDER BY (CASE WHEN status = 'ACTIVE' THEN "maxBid" ELSE 0 END) DESC, created_at ASC
OFFSET $2 OFFSET $2
LIMIT ${LIMIT}`, decodedCursor.time, decodedCursor.offset, sub) LIMIT ${LIMIT}`, decodedCursor.time, decodedCursor.offset, sub)
break break

View File

@ -28,7 +28,7 @@ export function ItemJob ({ item, rank, children }) {
{rank} {rank}
</div>) </div>)
: <div />} : <div />}
<div className={`${styles.item}`}> <div className={`${styles.item} ${item.status === 'NOSATS' && !item.mine ? styles.itemDead : ''}`}>
<Briefcase width={24} height={24} className={styles.case} /> <Briefcase width={24} height={24} className={styles.case} />
<div className={styles.hunk}> <div className={styles.hunk}>
<div className={`${styles.main} flex-wrap d-inline`}> <div className={`${styles.main} flex-wrap d-inline`}>
@ -60,7 +60,9 @@ export function ItemJob ({ item, rank, children }) {
</a> </a>
</div> </div>
<div className={`${styles.other}`}> <div className={`${styles.other}`}>
<span>{formatSats(item.maxBid)} sats per min</span> {item.status !== 'NOSATS'
? <span>{formatSats(item.maxBid)} sats per min</span>
: <span>expired</span>}
<span> \ </span> <span> \ </span>
<Link href={`/items/${item.id}`} passHref> <Link href={`/items/${item.id}`} passHref>
<a className='text-reset'>{item.ncomments} comments</a> <a className='text-reset'>{item.ncomments} comments</a>

View File

@ -50,6 +50,11 @@ a.link:visited {
min-width: 0; min-width: 0;
} }
.itemDead {
pointer-events: none;
opacity: .5;
}
.item .cover { .item .cover {
top: 4px; top: 4px;
} }