Skip to content

Commit

Permalink
fix: CategoryBadge types
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio committed May 6, 2024
1 parent 61bc538 commit f3fb5de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions webapp/src/components/AssetPage/CategoryBadge/CategoryBadge.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo, useEffect } from 'react'
import { EmoteCategory } from '@dcl/schemas'
import { EmoteCategory, WearableCategory } from '@dcl/schemas'
import { t } from 'decentraland-dapps/dist/modules/translation/utils'
import { locations } from '../../../modules/routing/locations'
import { getSearchSection } from '../../../modules/routing/search'
Expand Down Expand Up @@ -27,7 +27,13 @@ const CategoryBadge = ({ category, assetType }: Props) => {
}
}, [section, category, isEmote])

return <IconBadge icon={isEmote ? undefined : category} text={t(`${isEmote ? 'emote' : 'wearable'}.category.${category}`)} href={href} />
return (
<IconBadge
icon={isEmote ? undefined : (category as WearableCategory)}
text={t(`${isEmote ? 'emote' : 'wearable'}.category.${category}`)}
href={href}
/>
)
}

export default React.memo(CategoryBadge)

0 comments on commit f3fb5de

Please sign in to comment.