feat: animations

This commit is contained in:
ner committed 2023-12-29 17:18:06 +02:00
1 parent e4788ae384
commit 7b55619cf5
16 files changed
+643 -320

No files matched your search

+22 -18
View File
@@ -1,29 +1,33 @@
import { FC } from 'react';
import { create, InstanceProps } from 'react-modal-promise';
import { Dialog, DialogContent } from '@/components/ui/dialog';
import { Modal } from '@/components/ui/dialog';
interface Props {
interface Props extends InstanceProps<void> {
trailerKey?: string;
onClose: () => void;
}
const Trailer: FC<Props> = ({ trailerKey, onClose }) => {
const Trailer: FC<Props> = ({ trailerKey, onResolve, isOpen }) => {
if (!trailerKey) return;
return (
trailerKey && (
<Dialog defaultOpen={true} onOpenChange={(isOpen) => !isOpen && onClose()}>
<DialogContent className='block p-0 min-h-[400px] border-none aspect-w-16 aspect-h-9' onClose={onClose}>
<iframe
allow='autoplay'
className='border-none rounded-lg'
width='100%'
height='100%'
src={`//www.youtube.com/embed/${trailerKey}?autoplay=1`}
allowFullScreen
/>
</DialogContent>
</Dialog>
)
<Modal
className='block p-0 min-h-[400px] border-none aspect-w-16 aspect-h-9'
onClose={() => onResolve()}
isOpen={isOpen}
>
<iframe
allow='autoplay'
className='border-none rounded-lg'
width='100%'
height='100%'
src={`//www.youtube.com/embed/${trailerKey}?autoplay=1`}
allowFullScreen
/>
</Modal>
);
};
export const showTrailerModal = create(Trailer);
export default Trailer;