refactor: clean code and remove unnecessary dependencies
This commit is contained in:
1 parent
eceae6fec7
commit
ebf599eed6
92 files changed
+1152
-2842
No files matched your search
+15
-33
@@ -1,35 +1,17 @@
|
||||
'use client';
|
||||
import Random from '@/components/Random';
|
||||
import Trending from '@/components/Trending';
|
||||
|
||||
import Preview from '@/components/Movie/Preview';
|
||||
|
||||
import Carousel from './components/Carousel';
|
||||
import Trending from './components/Trending';
|
||||
import useRandomMovie from './useRandomMovie';
|
||||
|
||||
const Random = () => {
|
||||
const { movies, movie, index, onIndexChange, fetchNextPage } = useRandomMovie();
|
||||
|
||||
return (
|
||||
<Preview
|
||||
movie={movie}
|
||||
className='bg-background rounded-md'
|
||||
card={<Carousel index={index} movies={movies} onIndexChange={onIndexChange} onEndReached={fetchNextPage} />}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default function Container() {
|
||||
return (
|
||||
<div className='flex flex-col flex-1'>
|
||||
<div className='xs:mb-4'>
|
||||
<Random />
|
||||
<div className='w-full h-2' />
|
||||
</div>
|
||||
|
||||
<div className='xs:block hidden w-full rounded-lg'>
|
||||
<Trending />
|
||||
<div className='w-full h-2' />
|
||||
</div>
|
||||
const Container = () => (
|
||||
<div className='flex flex-col flex-1'>
|
||||
<div className='xs:mb-4'>
|
||||
<Random />
|
||||
<div className='w-full h-2' />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
<div className='xs:block hidden w-full rounded-lg'>
|
||||
<Trending />
|
||||
<div className='w-full h-2' />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default Container;
|
||||
Reference in new issue
Block a user