fix(market-card.tsx): add conditional rendering for username to prevent error when data.user_created.username is undefined

This commit is contained in:
cristhianzl 2023-11-16 11:47:39 -03:00
commit 8803e944ee

View file

@ -171,9 +171,12 @@ export const MarketCardComponent = ({
</div> </div>
</CardTitle> </CardTitle>
</div> </div>
<span className="text-xs text-primary"> {data.user_created.username && (
by <b>{data.user_created.username}</b> <span className="text-xs text-primary">
</span> by <b>{data.user_created.username}</b>
</span>
)}
<CardDescription className="pb-2 pt-2"> <CardDescription className="pb-2 pt-2">
<div className="truncate-doubleline">{data.description}</div> <div className="truncate-doubleline">{data.description}</div>
</CardDescription> </CardDescription>