feat: native carousel

This commit is contained in:
ner committed 2024-08-25 21:48:03 +03:00
1 parent 4ddaa89032
commit 5733bc0af0
20 files changed
+961 -534

No files matched your search

+7 -11
View File
@@ -13,7 +13,6 @@ import Card from '../Card';
import Actions from './components/Actions';
interface Props {
fit?: boolean;
movie?: Movie;
className?: string;
onClose?: () => void;
@@ -22,29 +21,27 @@ interface Props {
type?: ShowType;
}
const Preview: FC<Props> = ({ movie, className, onClose, children, card, fit, type = 'movie' }) => {
const Preview: FC<Props> = ({ movie, className, onClose, children, card, type = 'movie' }) => {
if (!movie) return null;
return (
<div className={cn('rounded-xl text-card-foreground', { 'p-2': Boolean(onClose) }, className)}>
<div className='flex flex-col lg:flex-row max-w-[100%] gap-2'>
{card || (
<div className='xs:w-[300px] w-full shrink-0 mx-auto'>
<Card fit={fit} movie={movie} />
</div>
)}
<div className='flex flex-col md:flex-row max-w-[100%] gap-2'>
{card || <Card className='mx-auto' movie={movie} />}
<div className='flex flex-col grow'>
{children && <div className='flex hover-none:hidden w-full max-sm:mb-0 mb-2 gap-2'>{children}</div>}
<div className='flex w-full gap-2'>
<Actions type={type} movie={movie} onClose={onClose} />
</div>
<Separator className='my-2' />
<p key={movie.id} className='leading-7'>
<p key={movie.id} className='leading-7 mb-3'>
{movie.overview}
</p>
<div className='mt-auto grid grid-cols-1 rounded-lg'>
<Credits type={type} movieId={movie.id} onPersonClick={onClose} />
</div>
</div>
</div>
<Credits type={type} movieId={movie.id} onPersonClick={onClose} />
</div>
);
};
@@ -52,7 +49,6 @@ const Preview: FC<Props> = ({ movie, className, onClose, children, card, fit, ty
export const showPreviewModal = create(({ onResolve, onClose, movie, type = 'movie' }: Props & InstanceProps<void>) => (
<Modal className='block p-0' onClose={onResolve}>
<Preview
fit
type={type}
movie={movie}
className='border-none'