This commit is contained in:
tangly1024
2022-04-13 14:54:58 +08:00
parent 67506c4644
commit a23810fa59
7 changed files with 20 additions and 21 deletions

View File

@@ -8,9 +8,9 @@ const CategoryGroup = ({ currentCategory, categories }) => {
return <div id='category-list' className='pt-4'>
<div className='mb-2'><i className='mr-2 fas fa-th' />分类</div>
<div className='flex flex-wrap'>
{categories.map(category => {
{categories?.map(category => {
const selected = currentCategory === category.name
return <CategoryItem key={category.name} selected={selected} category={category.name} categoryCount={category.count}/>
return <CategoryItem key={category.name} selected={selected} category={category.name} categoryCount={category.count} />
})}
</div>
</div>