From 36ec981a375737d57dc4489df8d80fb9a9ddd95a Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Mon, 16 May 2022 18:51:12 -0400 Subject: [PATCH] Limit to 1 category on a card --- web/components/contract/contract-details.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/components/contract/contract-details.tsx b/web/components/contract/contract-details.tsx index 6800dd72..f83e5496 100644 --- a/web/components/contract/contract-details.tsx +++ b/web/components/contract/contract-details.tsx @@ -38,13 +38,13 @@ export function AbbrContractDetails(props: { creatorName, creatorUsername, closeTime, - outcomeType, tags, } = contract const { volumeLabel } = contractMetrics(contract) - const categories = tags.filter((tag) => - CATEGORY_LIST.includes(tag.toLowerCase()) - ) + // Show at most one category that this contract is tagged by + const categories = CATEGORY_LIST.filter((category) => + tags.map((t) => t.toLowerCase()).includes(category) + ).slice(0, 1) return (