Fix Category missing key + Fix button cannot be inside button

This commit is contained in:
Eric NGUYEN 2022-09-16 14:53:13 +02:00
parent e94671d1d8
commit ce65d448c9
3 changed files with 14 additions and 10 deletions

View file

@ -12,8 +12,8 @@ export function Category(props: ICategoryProps): JSX.Element {
if (isOpen) {
return (
<button type="button"
className='overflow-hidden h-full transition-all'
<div
className='overflow-hidden h-full transition-all text-center cursor-pointer'
key={props.category}
id={props.category}
title={props.category}
@ -32,13 +32,13 @@ export function Category(props: ICategoryProps): JSX.Element {
<div className='transition-all grid gap-2 p-2 bg-slate-400/80 overflow-auto rounded-b-lg visible'>
{ props.children }
</div>
</button>
</div>
);
}
return (
<button type="button"
className='overflow-visible h-16 group transition-all'
<div
className='overflow-visible h-16 group transition-all text-center cursor-pointer'
key={props.category}
id={props.category}
title={props.category}
@ -55,6 +55,6 @@ export function Category(props: ICategoryProps): JSX.Element {
<div className='transition-all overflow-hidden rounded-b-lg hidden'>
{ props.children }
</div>
</button>
</div>
);
}