Show new label instead of 0 volume
This commit is contained in:
		
							parent
							
								
									e1b5b595e7
								
							
						
					
					
						commit
						8c8a9be6a1
					
				|  | @ -9,6 +9,7 @@ import { | ||||||
|   UserIcon, |   UserIcon, | ||||||
|   UsersIcon, |   UsersIcon, | ||||||
|   XIcon, |   XIcon, | ||||||
|  |   SparklesIcon, | ||||||
| } from '@heroicons/react/solid' | } from '@heroicons/react/solid' | ||||||
| import clsx from 'clsx' | import clsx from 'clsx' | ||||||
| import Textarea from 'react-expanding-textarea' | import Textarea from 'react-expanding-textarea' | ||||||
|  | @ -46,6 +47,7 @@ import { useSaveSeenContract } from '../../hooks/use-seen-contracts' | ||||||
| import { User } from '../../../common/user' | import { User } from '../../../common/user' | ||||||
| import { Modal } from '../layout/modal' | import { Modal } from '../layout/modal' | ||||||
| import { trackClick } from '../../lib/firebase/tracking' | import { trackClick } from '../../lib/firebase/tracking' | ||||||
|  | import { DAY_MS } from '../../../common/util/time' | ||||||
| 
 | 
 | ||||||
| export function FeedItems(props: { | export function FeedItems(props: { | ||||||
|   contract: Contract |   contract: Contract | ||||||
|  | @ -307,10 +309,18 @@ export function FeedQuestion(props: { | ||||||
|   contractPath?: string |   contractPath?: string | ||||||
| }) { | }) { | ||||||
|   const { contract, showDescription } = props |   const { contract, showDescription } = props | ||||||
|   const { creatorName, creatorUsername, question, resolution, outcomeType } = |   const { | ||||||
|     contract |     creatorName, | ||||||
|  |     creatorUsername, | ||||||
|  |     question, | ||||||
|  |     resolution, | ||||||
|  |     outcomeType, | ||||||
|  |     volume, | ||||||
|  |     createdTime, | ||||||
|  |   } = contract | ||||||
|   const { volumeLabel } = contractMetrics(contract) |   const { volumeLabel } = contractMetrics(contract) | ||||||
|   const isBinary = outcomeType === 'BINARY' |   const isBinary = outcomeType === 'BINARY' | ||||||
|  |   const isNew = createdTime > Date.now() - DAY_MS | ||||||
| 
 | 
 | ||||||
|   // const closeMessage =
 |   // const closeMessage =
 | ||||||
|   //   contract.isResolved || !contract.closeTime ? null : (
 |   //   contract.isResolved || !contract.closeTime ? null : (
 | ||||||
|  | @ -336,10 +346,18 @@ export function FeedQuestion(props: { | ||||||
|           />{' '} |           />{' '} | ||||||
|           asked |           asked | ||||||
|           {/* Currently hidden on mobile; ideally we'd fit this in somewhere. */} |           {/* Currently hidden on mobile; ideally we'd fit this in somewhere. */} | ||||||
|           <span className="float-right hidden text-gray-400 sm:inline"> |           <div className="relative -top-2 float-right text-gray-400"> | ||||||
|  |             {isNew || volume === 0 ? ( | ||||||
|  |               <Row className="gap-1"> | ||||||
|  |                 <SparklesIcon className="h-5 w-5" aria-hidden="true" /> New | ||||||
|  |               </Row> | ||||||
|  |             ) : ( | ||||||
|  |               <span className="hidden sm:inline"> | ||||||
|                 {volumeLabel} |                 {volumeLabel} | ||||||
|                 {/* {closeMessage} */} |                 {/* {closeMessage} */} | ||||||
|               </span> |               </span> | ||||||
|  |             )} | ||||||
|  |           </div> | ||||||
|         </div> |         </div> | ||||||
|         <Col className="items-start justify-between gap-2 sm:flex-row sm:gap-4"> |         <Col className="items-start justify-between gap-2 sm:flex-row sm:gap-4"> | ||||||
|           <Col> |           <Col> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user