fix: modal frame

This commit is contained in:
ner committed 2024-10-19 23:31:45 +03:00
1 parent 9702f027ed
commit dc8dde4dbb
9 files changed
+17 -23

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ const Container = () => (
<Random /> <Random />
<div className='h-2 w-full' /> <div className='h-2 w-full' />
</div> </div>
<div className='hidden w-full rounded-xl xs:block'> <div className='hidden w-full rounded-lg xs:block'>
<Trending /> <Trending />
<div className='h-2 w-full' /> <div className='h-2 w-full' />
</div> </div>
@@ -21,7 +21,7 @@ const showTrailerModal = create(({ trailerKey, onResolve }: { trailerKey?: strin
<iframe <iframe
allowFullScreen allowFullScreen
allow='autoplay' allow='autoplay'
className='rounded-xl border-none' className='rounded-lg border-none'
width='100%' width='100%'
height='100%' height='100%'
src={`//www.youtube.com/embed/${trailerKey}?autoplay=1`} src={`//www.youtube.com/embed/${trailerKey}?autoplay=1`}
+2 -2
View File
@@ -18,10 +18,10 @@ const Poster: FC<Props> = ({ show, onClick, className, rounded, containerProps }
return ( return (
<div <div
{...(containerProps || {})} {...(containerProps || {})}
className={cn('card-aspect-ratio relative bg-black overflow-hidden rounded-xl text-lg', className, rounded)} className={cn('card-aspect-ratio relative bg-black overflow-hidden rounded-lg text-lg', className, rounded)}
> >
<div className='flex size-full'> <div className='flex size-full'>
<img className={cn('size-full rounded-xl object-cover', rounded)} src={show.poster} alt={show.title} /> <img className={cn('size-full rounded-lg object-cover', rounded)} src={show.poster} alt={show.title} />
</div> </div>
<div <div
className={cn( className={cn(
@@ -40,7 +40,7 @@ const showPlayer = create(({ onResolve, magnet, backdrop, title }: Props) => {
} }
return ( return (
<Modal className='max-w-[932px] overflow-hidden border-none bg-black p-0' onClose={onResolve}> <Modal className='overflow-hidden border-none bg-black p-0' onClose={onResolve}>
<div className='relative w-full overflow-hidden pt-[56.25%]'> <div className='relative w-full overflow-hidden pt-[56.25%]'>
<div className='absolute left-0 top-0 size-full'> <div className='absolute left-0 top-0 size-full'>
<Player subtitles={subtitles} videos={videos} onReady={() => setIsReady(true)} /> <Player subtitles={subtitles} videos={videos} onReady={() => setIsReady(true)} />
@@ -84,7 +84,7 @@ const TorrentsTable: FC<Props> = ({ title, torrents, backdrop, sort, sortable, p
<div className='no-scrollbar flex max-w-full justify-end gap-2 overflow-auto'> <div className='no-scrollbar flex max-w-full justify-end gap-2 overflow-auto'>
{supportedForStream && ( {supportedForStream && (
<div <div
className='flex size-8 cursor-pointer items-center justify-center rounded-xl border' className='flex size-8 cursor-pointer items-center justify-center rounded-md border'
onClick={() => showPlayer({ magnet: torrent.magnet, backdrop, title })} onClick={() => showPlayer({ magnet: torrent.magnet, backdrop, title })}
title='Play show' title='Play show'
> >
@@ -95,20 +95,20 @@ const TorrentsTable: FC<Props> = ({ title, torrents, backdrop, sort, sortable, p
href={`${process.env.NEXT_PUBLIC_TORRENT_PROXY}/stream?m3u&link=${encodeURIComponent( href={`${process.env.NEXT_PUBLIC_TORRENT_PROXY}/stream?m3u&link=${encodeURIComponent(
torrent.magnet torrent.magnet
)}`} )}`}
className='flex size-8 items-center justify-center rounded-xl border' className='flex size-8 items-center justify-center rounded-md border'
title='Open using you native video player' title='Open using you native video player'
> >
<ListVideo size={20} /> <ListVideo size={20} />
</a> </a>
<a <a
href={torrent.magnet} href={torrent.magnet}
className='flex size-8 items-center justify-center rounded-xl border' className='flex size-8 items-center justify-center rounded-md border'
title='Download magnet' title='Download magnet'
> >
<Magnet size={20} /> <Magnet size={20} />
</a> </a>
<div <div
className='flex size-8 cursor-pointer items-center justify-center rounded-xl border' className='flex size-8 cursor-pointer items-center justify-center rounded-md border'
onClick={() => navigator.clipboard.writeText(torrent.magnet)} onClick={() => navigator.clipboard.writeText(torrent.magnet)}
title='Copy magnet into clipboard' title='Copy magnet into clipboard'
> >
@@ -117,7 +117,7 @@ const TorrentsTable: FC<Props> = ({ title, torrents, backdrop, sort, sortable, p
{supportedForCast && ( {supportedForCast && (
<div <div
onClick={() => cast(torrent.magnet!)} onClick={() => cast(torrent.magnet!)}
className='flex size-8 cursor-pointer items-center justify-center rounded-xl border' className='flex size-8 cursor-pointer items-center justify-center rounded-md border'
> >
<Cast size={20} /> <Cast size={20} />
</div> </div>
+4 -10
View File
@@ -31,18 +31,12 @@ const Preview: FC<Props> = ({ show: baseShow, className, onClose, poster }) => {
<div <div
className={cn( className={cn(
'flex flex-col md:flex-row gap-2 rounded-xl overflow-hidden', 'flex flex-col md:flex-row gap-2 rounded-xl overflow-hidden',
{ 'gap-0 xs:pt-2 md:pt-0 pt-0': isModal }, { 'gap-0 md:p-0 p-2': isModal },
className className
)} )}
> >
{poster || ( {poster || <Poster className='mx-auto' rounded='md:rounded-none md:rounded-l-xl' show={show} />}
<Poster <div className={cn('flex grow flex-col bg-background', { 'p-0 pt-1 md:p-2': isModal })}>
className='mx-auto'
rounded='rounded-none rounded-t-xl md:rounded-xl sm:rounded-xl md:rounded-none md:rounded-l-xl'
show={show}
/>
)}
<div className={cn('flex grow flex-col bg-background', { 'p-2': isModal })}>
<span className='order-3 mb-4 text-3xl md:order-1 md:line-clamp-2'>{show.title}</span> <span className='order-3 mb-4 text-3xl md:order-1 md:line-clamp-2'>{show.title}</span>
<div className='order-3 mb-4 flex w-full flex-wrap gap-5 whitespace-nowrap text-sm md:order-2'> <div className='order-3 mb-4 flex w-full flex-wrap gap-5 whitespace-nowrap text-sm md:order-2'>
@@ -70,7 +64,7 @@ const Preview: FC<Props> = ({ show: baseShow, className, onClose, poster }) => {
}; };
export const showPreviewModal = create(({ onResolve, onClose, show }: Props & InstanceProps<void>) => ( export const showPreviewModal = create(({ onResolve, onClose, show }: Props & InstanceProps<void>) => (
<Modal className='block max-w-[932px] bg-black p-0 sm:bg-background md:bg-black' onClose={onResolve}> <Modal className='block bg-background p-0 md:bg-black' onClose={onResolve}>
<Preview <Preview
show={show} show={show}
onClose={() => { onClose={() => {
@@ -68,7 +68,7 @@ const components: VirtuosoProps<Show, (index: number) => void>['components'] = {
<div <div
{...props} {...props}
ref={handleRef(ref, setRef)} ref={handleRef(ref, setRef)}
className={cn('no-scrollbar h-full overflow-hidden rounded-xl', { className={cn('no-scrollbar h-full overflow-hidden rounded-lg', {
'snap-x snap-mandatory ': !isArrowHovered 'snap-x snap-mandatory ': !isArrowHovered
})} })}
/> />
@@ -13,7 +13,7 @@ const Gallery: FC<Props> = ({ shows }) => (
{(setRef) => ( {(setRef) => (
<ul <ul
ref={setRef} ref={setRef}
className='no-scrollbar flex animate-fade-aside-slide-in snap-x snap-mandatory gap-2 overflow-auto rounded-xl opacity-0' className='no-scrollbar flex animate-fade-aside-slide-in snap-x snap-mandatory gap-2 overflow-auto rounded-lg opacity-0'
> >
{shows.map((show) => ( {shows.map((show) => (
<li key={show.id} className='snap-start'> <li key={show.id} className='snap-start'>
+1 -1
View File
@@ -102,7 +102,7 @@ const DialogContent = React.forwardRef<
return ( return (
<DialogPortal> <DialogPortal>
<div className='fixed inset-0 z-50 size-full bg-black/65' data-overlay ref={wrapperRef}> <div className='fixed inset-0 z-50 size-full bg-black/80' data-overlay ref={wrapperRef}>
<DialogOverlay <DialogOverlay
ref={(element) => { ref={(element) => {
if (!element) return; if (!element) return;