diff --git a/web/components/contract/contract-card.tsx b/web/components/contract/contract-card.tsx index d1c7dd31..8f287bdf 100644 --- a/web/components/contract/contract-card.tsx +++ b/web/components/contract/contract-card.tsx @@ -9,7 +9,6 @@ import { getBinaryProbPercent, } from 'web/lib/firebase/contracts' import { Col } from '../layout/col' -import { Spacer } from '../layout/spacer' import { Binary, CPMM, @@ -25,6 +24,8 @@ import { } from '../outcome-label' import { getOutcomeProbability, getTopAnswer } from 'common/calculate' import { AbbrContractDetails } from './contract-details' +import { TagsList } from '../tags-list' +import { CATEGORY_LIST } from 'common/categories' export function ContractCard(props: { contract: Contract @@ -35,11 +36,16 @@ export function ContractCard(props: { const { contract, showHotVolume, showCloseTime, className } = props const { question, outcomeType, resolution } = contract + const { tags } = contract + const categories = tags.filter((tag) => + CATEGORY_LIST.includes(tag.toLowerCase()) + ) + return (
-
@@ -52,35 +58,39 @@ export function ContractCard(props: { showHotVolume={showHotVolume} showCloseTime={showCloseTime} /> - - -

- {question} -

+ + +

+ {question} +

+ {outcomeType !== 'FREE_RESPONSE' && categories.length > 0 && ( + + )} + {outcomeType === 'BINARY' && ( )} - {outcomeType === 'FREE_RESPONSE' && ( - } - truncate="long" - /> - )}
-
+ + {outcomeType === 'FREE_RESPONSE' && ( + } + truncate="long" + /> + )} + + {outcomeType === 'FREE_RESPONSE' && categories.length > 0 && ( + + )} +
) } diff --git a/web/components/contract/contract-description.tsx b/web/components/contract/contract-description.tsx index dd748f50..d1ffdaae 100644 --- a/web/components/contract/contract-description.tsx +++ b/web/components/contract/contract-description.tsx @@ -39,7 +39,9 @@ export function ContractDescription(props: { if (!isCreator && !contract.description.trim()) return null const { tags } = contract - const category = tags.find((tag) => CATEGORY_LIST.includes(tag.toLowerCase())) + const categories = tags.filter((tag) => + CATEGORY_LIST.includes(tag.toLowerCase()) + ) return (
- {category && ( + {categories.length > 0 && (
- +
)}