fix: random movie index preservation

This commit is contained in:
ner committed 2024-09-01 14:57:24 +03:00
1 parent 9dc731299f
commit 9e4e1d62fd
7 files changed
+78 -74

No files matched your search

+2 -2
View File
@@ -6,14 +6,14 @@ import Carousel from './components/Carousel';
import useRandomMovie from './useRandomMovie';
export default function Container() {
const { movies, movie, index, onIndexChange } = useRandomMovie();
const { movies, movie, index, onIndexChange, fetchNextPage } = useRandomMovie();
return (
<>
<Preview
movie={movie}
className='bg-background rounded-md'
card={<Carousel index={index} movies={movies} onIndexChange={onIndexChange} />}
card={<Carousel index={index} movies={movies} onIndexChange={onIndexChange} onEndReached={fetchNextPage} />}
/>
<div className='w-full h-2' />
</>