From 8c8a9be6a118cfac841286bc183c44d41e9b80f5 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 20 Apr 2022 17:25:29 -0500 Subject: [PATCH] Show new label instead of 0 volume --- web/components/feed/feed-items.tsx | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/web/components/feed/feed-items.tsx b/web/components/feed/feed-items.tsx index e2def4d4..2200bbbb 100644 --- a/web/components/feed/feed-items.tsx +++ b/web/components/feed/feed-items.tsx @@ -9,6 +9,7 @@ import { UserIcon, UsersIcon, XIcon, + SparklesIcon, } from '@heroicons/react/solid' import clsx from 'clsx' import Textarea from 'react-expanding-textarea' @@ -46,6 +47,7 @@ import { useSaveSeenContract } from '../../hooks/use-seen-contracts' import { User } from '../../../common/user' import { Modal } from '../layout/modal' import { trackClick } from '../../lib/firebase/tracking' +import { DAY_MS } from '../../../common/util/time' export function FeedItems(props: { contract: Contract @@ -307,10 +309,18 @@ export function FeedQuestion(props: { contractPath?: string }) { const { contract, showDescription } = props - const { creatorName, creatorUsername, question, resolution, outcomeType } = - contract + const { + creatorName, + creatorUsername, + question, + resolution, + outcomeType, + volume, + createdTime, + } = contract const { volumeLabel } = contractMetrics(contract) const isBinary = outcomeType === 'BINARY' + const isNew = createdTime > Date.now() - DAY_MS // const closeMessage = // contract.isResolved || !contract.closeTime ? null : ( @@ -336,10 +346,18 @@ export function FeedQuestion(props: { />{' '} asked {/* Currently hidden on mobile; ideally we'd fit this in somewhere. */} - - {volumeLabel} - {/* {closeMessage} */} - +
+ {isNew || volume === 0 ? ( + + + ) : ( + + {volumeLabel} + {/* {closeMessage} */} + + )} +