feat: aspect-ratio instead of width measurer
This commit is contained in:
1 parent
375ebf93d9
commit
279a61ddcd
15 files changed
+168
-313
No files matched your search
@@ -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' />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user