fix: order of tailwind classes

This commit is contained in:
ner committed 2024-10-05 17:23:37 +03:00
1 parent 5528a84ee7
commit 3b03df3ff5
33 files changed
+135 -1250

No files matched your search

@@ -22,12 +22,12 @@ export const MobileNavigation = () => {
<Menu size={19} />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className='w-44 flex flex-col gap-2 p-2'>
<DropdownMenuContent className='flex w-44 flex-col gap-2 p-2'>
{paths.map(({ path, title }) => (
<DropdownMenuItem key={path} asChild>
<Link href={path}>
<div>
<Button className='w-full relative' variant={currentPath === path ? 'default' : 'outline'}>
<Button className='relative w-full' variant={currentPath === path ? 'default' : 'outline'}>
{title}
</Button>
</div>
@@ -38,7 +38,7 @@ export const showSearchModal = create(({ onResolve }) => {
const isFetched = movies.isFetched && series.isFetched;
return (
<Modal className='block p-0 max-w-[932px]' onClose={onResolve} scrollRef={scrollRef}>
<Modal className='block max-w-[932px] p-0' onClose={onResolve} scrollRef={scrollRef}>
<div className='relative p-2'>
<Input
autoFocus
+2 -2
View File
@@ -8,11 +8,11 @@ import ToggleSearch from './components/Search';
import ToggleTheme from './components/ThemeToggle';
const Header: FC = () => (
<header className='flex justify-center bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 py-2'>
<header className='flex justify-center bg-background/95 py-2 backdrop-blur supports-[backdrop-filter]:bg-background/60'>
<div className='container'>
<div className='flex items-center justify-between gap-2 xs:flex-nowrap'>
<Link shallow href='/'>
<Badge className='whitespace-nowrap cursor-pointer font-normal'>Movie advisor</Badge>
<Badge className='cursor-pointer whitespace-nowrap font-normal'>Movie advisor</Badge>
</Link>
<DesktopNavigation />
<div className='flex items-center gap-2'>
+1 -1
View File
@@ -1,5 +1,5 @@
const NoResults = () => (
<div className='h-40 w-full flex items-center justify-center text-xl text-muted-foreground'>Nothing was found</div>
<div className='flex h-40 w-full items-center justify-center text-xl text-muted-foreground'>Nothing was found</div>
);
export default NoResults;
+4 -4
View File
@@ -15,13 +15,13 @@ const Actions = ({ onClose, show }: Props) => (
<>
<ToggleTrailer showType={show.type} showId={show.id}>
{({ onPlay, disabled }) => (
<Button className='h-8 flex-grow w-[50%]' onClick={onPlay} disabled={disabled}>
<Button className='h-8 w-1/2 grow' onClick={onPlay} disabled={disabled}>
Trailer
</Button>
)}
</ToggleTrailer>
<Button
className='h-8 flex-grow w-[50%]'
className='h-8 w-1/2 grow'
onClick={() =>
showTorrentsModal({
showId: show.id,
@@ -35,11 +35,11 @@ const Actions = ({ onClose, show }: Props) => (
Torrents
</Button>
<Link
className='flex w-[50%]'
className='flex w-1/2'
href={`/similar?id=${show.id}&title=${encodeURIComponent(show.title)}&type=${show.type}`}
onClick={onClose}
>
<Button className='h-8 flex-grow'>Similar</Button>
<Button className='h-8 grow'>Similar</Button>
</Link>
</>
);
+3 -3
View File
@@ -25,13 +25,13 @@ const Preview: FC<Props> = ({ show, className, onClose, children, card }) => {
return (
<div className={cn('flex flex-col md:flex-row gap-2 rounded-xl', { 'p-2': Boolean(onClose) }, className)}>
{card || <Card className='mx-auto' show={show} />}
<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 grow flex-col'>
{children && <div className='mb-2 flex w-full gap-2 hover-none:hidden max-sm:mb-0'>{children}</div>}
<div className='flex w-full gap-2'>
<Actions show={show} onClose={onClose} />
</div>
<Separator className='my-2' />
<p key={show.id} className='leading-7 mb-3'>
<p key={show.id} className='mb-3 leading-7'>
{show.overview}
</p>
<div className='mt-auto grid grid-cols-1 rounded-lg'>
@@ -43,7 +43,7 @@ const components: VirtuosoProps<Show, (index: number) => void>['components'] = {
}),
Scroller: forwardRef(function Scroller({ context, ...props }, ref) {
return (
<div {...props} ref={ref} className='overflow-hidden no-scrollbar snap-mandatory snap-x rounded-lg h-full' />
<div {...props} ref={ref} className='no-scrollbar h-full snap-x snap-mandatory overflow-hidden rounded-lg' />
);
})
};
+1 -1
View File
@@ -11,7 +11,7 @@ const Random = () => {
return (
<Preview
show={movie}
className='bg-background rounded-md'
className='rounded-md bg-background'
card={<Carousel index={index} shows={movies} onIndexChange={onIndexChange} onEndReached={fetchNextPage} />}
/>
);
+7 -7
View File
@@ -18,18 +18,18 @@ const Credits: FC<Props> = ({ showId, showType = 'movie', onPersonClick }) => {
return (
Boolean(credits?.length) && (
<ul className='flex gap-2 no-scrollbar overflow-auto rounded-lg snap-mandatory snap-x opacity-0 animate-fade-aside-slide-in'>
<ul className='no-scrollbar flex animate-fade-aside-slide-in snap-x snap-mandatory gap-2 overflow-auto rounded-lg opacity-0'>
{credits?.map((actor) => (
<li
key={`${actor.id}_${actor.cast_id}`}
title={actor.name}
className='bg-card text-card-foreground self-end max-w-[120px] w-full shrink-0 cursor-pointer transition-shadow hover:shadow-lg relative snap-start'
className='relative w-full max-w-[120px] shrink-0 cursor-pointer snap-start self-end bg-card text-card-foreground transition-shadow hover:shadow-lg'
>
<Link
href={`/starring?actorId=${actor.id}&title=${encodeURIComponent(actor.name)}`}
onClick={() => onPersonClick?.(actor.id.toString())}
>
<div className='rounded-lg overflow-hidden'>
<div className='overflow-hidden rounded-lg'>
{actor.profile_path ? (
<Image
unoptimized
@@ -39,15 +39,15 @@ const Credits: FC<Props> = ({ showId, showType = 'movie', onPersonClick }) => {
alt={actor.name}
/>
) : (
<div className='h-[180px] w-[120px] flex items-center justify-center rounded-lg'>
<div className='flex h-[180px] w-[120px] items-center justify-center rounded-lg'>
<User2 size={120} strokeWidth={1} />
</div>
)}
</div>
<div className='text-white text-sm absolute w-full h-full top-0 left-0 rounded-md flex flex-col justify-between p-2 py-1 bg-vignette'>
<p className=' overflow-ellipsis whitespace-nowrap overflow-hidden'>{actor.name}</p>
<div className='absolute left-0 top-0 flex size-full flex-col justify-between rounded-md bg-vignette p-2 py-1 text-sm text-white'>
<p className=' truncate'>{actor.name}</p>
{Boolean(actor.character) && (
<p className='overflow-ellipsis whitespace-nowrap overflow-hidden'>{actor.character}</p>
<p className='truncate'>{actor.character}</p>
)}
</div>
</Link>
@@ -12,7 +12,7 @@ interface Props {
const Handlers: FC<Props> = ({ onClick, show }) => {
const { toggle } = useFavoriteToggle(show);
return <div onClick={onClick} onDoubleClick={toggle} className='absolute top-0 left-0 w-full h-full' />;
return <div onClick={onClick} onDoubleClick={toggle} className='absolute left-0 top-0 size-full' />;
};
export default Handlers;
+2 -2
View File
@@ -8,9 +8,9 @@ interface Props {
const Poster: FC<Props> = ({ title, poster }) => {
return poster ? (
<img className='rounded-lg w-full h-full object-cover' src={poster} alt={title} />
<img className='size-full rounded-lg object-cover' src={poster} alt={title} />
) : (
<div className='w-full flex items-center justify-center rounded-lg grow'>
<div className='flex w-full grow items-center justify-center rounded-lg'>
<ImageOff size={100} strokeWidth={1} color='hsl(215.4 16.3% 46.9%)' />
</div>
);
@@ -9,7 +9,7 @@ const showHostManagerModal = create<InstanceProps<string>>(({ onResolve, onRejec
const setPrefix = useSetPrefix();
return (
<Modal className='p-2 max-w-[200px] m-auto' onClose={onReject}>
<Modal className='m-auto max-w-[200px] p-2' onClose={onReject}>
<Input
autoFocus
placeholder='Enter address of your torrents streamer'
@@ -37,7 +37,7 @@ const showPlayer = create(({ onResolve, magnet, backdrop }: Props) => {
return (
<Modal
className='p-0 border-none rounded-lg overflow-hidden flex items-center justify-center relative'
className='relative flex items-center justify-center overflow-hidden rounded-lg border-none p-0'
style={{ aspectRatio: '16/9' }}
onClose={onResolve}
>
@@ -62,7 +62,7 @@ const showPlayer = create(({ onResolve, magnet, backdrop }: Props) => {
</Player>
{isLoading && (
<>
<div className='w-full h-full left-0 top-0 absolute flex items-center justify-center bg-black/70'>
<div className='absolute left-0 top-0 flex size-full items-center justify-center bg-black/70'>
<div className='animate-spin'>
<Loader color='white' />
</div>
@@ -19,10 +19,10 @@ const TableHeadSortable: FC<Props> = ({ title, sort, value, sortable, onChange }
return (
<TableHead onClick={handleSort} className={cn('select-none px-2', sortable && 'cursor-pointer')}>
<div className='flex gap-1 items-center'>
<div className='flex items-center gap-1'>
<span>{title}</span>
{sortable &&
(sort === value ? <ArrowDownIcon className='ml-2 h-4 w-4' /> : <CaretSortIcon className='ml-2 h-4 w-4' />)}
(sort === value ? <ArrowDownIcon className='ml-2 size-4' /> : <CaretSortIcon className='ml-2 size-4' />)}
</div>
</TableHead>
);
+12 -12
View File
@@ -49,12 +49,12 @@ const showTorrentsModal = create(({ title, year, showType, showId, backdrop, onR
return (
<Modal className='p-0' onClose={onResolve}>
<Table className='rounded-xl overflow-hidden'>
<Table className='overflow-hidden rounded-xl'>
<TableHeader>
<TableRow className='!border-b-0'>
<TableHead className='px-2' colSpan={4}>
<div className='grid grid-cols-[1fr_auto] items-center gap-3'>
<span className='overflow-ellipsis overflow-hidden text-base whitespace-nowrap'>{title}</span>
<span className='truncate text-base'>{title}</span>
<Button
className='h-6 p-2'
variant={withYear ? 'default' : 'ghost'}
@@ -82,7 +82,7 @@ const showTorrentsModal = create(({ title, year, showType, showId, backdrop, onR
{!isMobile && <TableHead className='px-2'>Title</TableHead>}
<TableHeadSortable sortable={sortable} title='Size' sort={Sort.size} value={sort} onChange={setSort} />
<TableHeadSortable sortable={sortable} title='Seeders' sort={Sort.seeds} value={sort} onChange={setSort} />
<TableHead className='px-2 cursor-pointer select-none' onClick={() => showHostManagerModal()} />
<TableHead className='cursor-pointer select-none px-2' onClick={() => showHostManagerModal()} />
</TableRow>
</TableHeader>
<TableBody>
@@ -102,24 +102,24 @@ const showTorrentsModal = create(({ title, year, showType, showId, backdrop, onR
</TableCell>
)}
<TableCell className='p-2'>
<div className='flex items-center gap-1 shrink-0'>{torrent.size}</div>
<div className='flex shrink-0 items-center gap-1'>{torrent.size}</div>
</TableCell>
<TableCell className='p-2'>{torrent.seeders}</TableCell>
<TableCell className='text-center p-1 pr-2'>
<div className='flex gap-2 justify-end'>
<TableCell className='p-1 pr-2 text-center'>
<div className='flex justify-end gap-2'>
{Boolean(key === providers.yts.key && torrent.seeders) && (
<div
className='flex items-center justify-center h-8 w-8 border rounded-lg cursor-pointer'
className='flex size-8 cursor-pointer items-center justify-center rounded-lg border'
onClick={() => showPlayer({ magnet: torrent.magnet, backdrop })}
>
<Play size={20} />
</div>
)}
<a href={torrent.magnet} className='flex items-center justify-center h-8 w-8 border rounded-lg'>
<a href={torrent.magnet} className='flex size-8 items-center justify-center rounded-lg border'>
<Magnet size={20} />
</a>
<div
className='flex items-center justify-center h-8 w-8 border rounded-lg cursor-pointer'
className='flex size-8 cursor-pointer items-center justify-center rounded-lg border'
onClick={() => navigator.clipboard.writeText(torrent.magnet)}
>
<Copy size={20} />
@@ -127,7 +127,7 @@ const showTorrentsModal = create(({ title, year, showType, showId, backdrop, onR
{prefix && !prefix.includes('{host}') && (
<div
onClick={() => cast(torrent.magnet!)}
className='flex items-center justify-center h-8 w-8 border rounded-lg cursor-pointer'
className='flex size-8 cursor-pointer items-center justify-center rounded-lg border'
>
<Cast size={20} />
</div>
@@ -140,7 +140,7 @@ const showTorrentsModal = create(({ title, year, showType, showId, backdrop, onR
{isLoading && (
<TableRow>
<TableCell colSpan={4}>
<div className='h-40 w-full flex items-center justify-center'>
<div className='flex h-40 w-full items-center justify-center'>
<Loader className='animate-spin' />
</div>
</TableCell>
@@ -149,7 +149,7 @@ const showTorrentsModal = create(({ title, year, showType, showId, backdrop, onR
{!isLoading && isFetched && !torrents?.length && (
<TableRow>
<TableCell colSpan={4}>
<div className='h-40 w-full flex items-center justify-center text-xl text-muted-foreground'>
<div className='flex h-40 w-full items-center justify-center text-xl text-muted-foreground'>
Nothing was found
</div>
</TableCell>
+2 -2
View File
@@ -17,11 +17,11 @@ const showTrailerModal = create(({ trailerKey, onResolve }: { trailerKey?: strin
if (!trailerKey) return;
return (
<Modal className='block p-0 max-w-[930px] border-none bg-black' style={{ aspectRatio: '16/9' }} onClose={onResolve}>
<Modal className='block max-w-[930px] border-none bg-black p-0' style={{ aspectRatio: '16/9' }} onClose={onResolve}>
<iframe
allowFullScreen
allow='autoplay'
className='border-none rounded-lg'
className='rounded-lg border-none'
width='100%'
height='100%'
src={`//www.youtube.com/embed/${trailerKey}?autoplay=1`}
+6 -6
View File
@@ -25,17 +25,17 @@ const Show: FC<Props> = ({ show, onClick, className, containerProps }) => {
className
)}
>
<div className='flex w-full h-full'>
<div className='flex size-full'>
<Poster title={show.title} poster={show.poster} />
</div>
<div className='text-white absolute w-full h-full top-0 left-0 rounded-md flex flex-col justify-between p-2 bg-vignette'>
<div className='absolute left-0 top-0 flex size-full flex-col justify-between rounded-md bg-vignette p-2 text-white'>
<Handlers show={show} onClick={onClick} />
<div className='grid grid-cols-[1fr_auto] opacity-75 gap-2'>
<span className='overflow-ellipsis overflow-hidden whitespace-nowrap'>{show.title}</span>
<div className='grid grid-cols-[1fr_auto] gap-2 opacity-75'>
<span className='truncate'>{show.title}</span>
{Boolean(show.release) && <span>{new Date(show.release).getFullYear()}</span>}
</div>
<div className='opacity-75 mb-[-5px]'>
<span className='select-none flex w-full items-center ml-auto gap-1 mt-[-8px] justify-between z-[1]'>
<div className='mb-[-5px] opacity-75'>
<span className='z-[1] ml-auto mt-[-8px] flex w-full select-none items-center justify-between gap-1'>
<Favorite show={show} />
<Rating rating={show.rating} />
</span>
@@ -8,7 +8,7 @@ interface Props {
}
const Marquee: FC<Props> = ({ shows }) => (
<ul className='flex overflow-auto gap-2 rounded-lg snap-mandatory snap-x no-scrollbar opacity-0 animate-fade-aside-slide-in'>
<ul className='no-scrollbar flex animate-fade-aside-slide-in snap-x snap-mandatory gap-2 overflow-auto rounded-lg opacity-0'>
{shows.map((show) => (
<li key={show.id} className='snap-start'>
<Card className='!h-[350px] !w-[230px] text-sm' show={show} onClick={() => showPreviewModal({ show })} />
+2 -2
View File
@@ -8,7 +8,7 @@ const buttonVariants = cva(
{
variants: {
variant: {
default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm active:shadow',
default: 'bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:shadow',
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
@@ -19,7 +19,7 @@ const buttonVariants = cva(
default: 'h-10 px-4 py-2',
sm: 'h-9 rounded-md px-3',
lg: 'h-11 rounded-md px-8',
icon: 'h-10 w-10'
icon: 'size-10'
}
},
defaultVariants: {
+2 -2
View File
@@ -90,7 +90,7 @@ const DialogContent = React.forwardRef<
return (
<DialogPortal>
<div className='fixed inset-0 w-full h-full bg-black/50 z-50' ref={wrapperRef}>
<div className='fixed inset-0 z-50 size-full bg-black/50' ref={wrapperRef}>
<DialogOverlay
ref={(element) => {
if (!element) return;
@@ -115,7 +115,7 @@ const DialogContent = React.forwardRef<
)}
>
{children}
<div className='absolute top-full block w-10 h-[20vh] pointer-events-none' />
<div className='pointer-events-none absolute top-full block h-[20vh] w-10' />
</DialogPrimitive.Content>
</DialogOverlay>
</div>
+5 -5
View File
@@ -34,7 +34,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
{...props}
>
{children}
<ChevronRight className='ml-auto h-4 w-4' />
<ChevronRight className='ml-auto size-4' />
</DropdownMenuPrimitive.SubTrigger>
));
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
@@ -103,9 +103,9 @@ const DropdownMenuCheckboxItem = React.forwardRef<
checked={checked}
{...props}
>
<span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
<span className='absolute left-2 flex size-3.5 items-center justify-center'>
<DropdownMenuPrimitive.ItemIndicator>
<Check className='h-4 w-4' />
<Check className='size-4' />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
@@ -125,9 +125,9 @@ const DropdownMenuRadioItem = React.forwardRef<
)}
{...props}
>
<span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
<span className='absolute left-2 flex size-3.5 items-center justify-center'>
<DropdownMenuPrimitive.ItemIndicator>
<Circle className='h-2 w-2 fill-current' />
<Circle className='size-2 fill-current' />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
+1 -1
View File
@@ -8,7 +8,7 @@ type CursorProps = { left: number; width: number; opacity: number };
const Cursor: FC<CursorProps> = ({ width, left, opacity }) => (
<li
className='pointer-events-none absolute bg-primary rounded-2xl h-full z-0 transition-all'
className='pointer-events-none absolute z-0 h-full rounded-2xl bg-primary transition-all'
style={{ width, left, opacity }}
/>
);
+1 -1
View File
@@ -83,7 +83,7 @@ const ToastClose = React.forwardRef<
toast-close=""
{...props}
>
<X className="h-4 w-4" />
<X className="size-4" />
</ToastPrimitives.Close>
))
ToastClose.displayName = ToastPrimitives.Close.displayName