fix: list animation

This commit is contained in:
ner committed 2023-12-29 18:49:31 +02:00
1 parent 345e7cfc90
commit 5f0dac673d
3 files changed
+14 -12

No files matched your search

+2 -4
View File
@@ -59,9 +59,8 @@ const List: FC<Props> = ({ pages, hasNextPage, fetchNextPage, withBottomGap = tr
<motion.ul
className='flex gap-3 flex-wrap justify-center grow'
variants={container}
initial='hidden'
initial={pages.length === 1 ? 'hidden' : false}
animate='visible'
layout
>
{pages.map((page) => (
<Fragment key={page.page}>
@@ -70,10 +69,9 @@ const List: FC<Props> = ({ pages, hasNextPage, fetchNextPage, withBottomGap = tr
key={movie.id}
variants={item}
className='flex basis-[300px] cursor-pointer'
onTap={() => setMovie(movie)}
ref={array.length / 2 !== index ? undefined : (element) => setLoader(element!)}
>
<Card movie={movie} className='grow flex flex-col' />
<Card movie={movie} className='grow flex flex-col' onClick={() => setMovie(movie)} />
</motion.li>
))}
</Fragment>