Limit to 1 category on a card

This commit is contained in:
Austin Chen 2022-05-16 18:51:12 -04:00
parent ee213ddb84
commit 36ec981a37

View File

@ -38,13 +38,13 @@ export function AbbrContractDetails(props: {
creatorName, creatorName,
creatorUsername, creatorUsername,
closeTime, closeTime,
outcomeType,
tags, tags,
} = contract } = contract
const { volumeLabel } = contractMetrics(contract) const { volumeLabel } = contractMetrics(contract)
const categories = tags.filter((tag) => // Show at most one category that this contract is tagged by
CATEGORY_LIST.includes(tag.toLowerCase()) const categories = CATEGORY_LIST.filter((category) =>
) tags.map((t) => t.toLowerCase()).includes(category)
).slice(0, 1)
return ( return (
<Col className={clsx('gap-2 text-sm text-gray-500')}> <Col className={clsx('gap-2 text-sm text-gray-500')}>