feat: aspect-ratio instead of width measurer

This commit is contained in:
ner committed 2024-08-31 21:36:16 +03:00
1 parent 375ebf93d9
commit 279a61ddcd
15 files changed
+168 -313

No files matched your search

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