Show multiple categories in contract description

This commit is contained in:
James Grugett 2022-05-12 19:25:32 -04:00
parent ee2570cc6b
commit 116557dd27

View File

@ -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 (
<div
@ -50,9 +52,9 @@ export function ContractDescription(props: {
>
<Linkify text={contract.description} />
{category && (
{categories.length > 0 && (
<div className="mt-4">
<TagsList tags={[category]} label="Category" />
<TagsList tags={categories} label="Category" />
</div>
)}