Nightly: Kategorien-Buttons toggeln erneuter Klick deselektiert Kategorie
This commit is contained in:
parent
9cac96d644
commit
48a45515db
1 changed files with 7 additions and 1 deletions
|
|
@ -570,7 +570,13 @@ export default function App() {
|
|||
{categories.length > 0 && (
|
||||
<div className="flex flex-wrap gap-3 text-sm mt-3">
|
||||
{categories.map(cat => (
|
||||
<button key={cat.id} className={`tag-btn ${activeCategoryId===cat.id?'active':''}`} onClick={()=> setActiveCategoryId(cat.id)}>{cat.name}</button>
|
||||
<button
|
||||
key={cat.id}
|
||||
className={`tag-btn ${activeCategoryId===cat.id?'active':''}`}
|
||||
onClick={()=> setActiveCategoryId(prev => (prev === cat.id ? '' : cat.id))}
|
||||
>
|
||||
{cat.name}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue