feat: animations
This commit is contained in:
1 parent
e4788ae384
commit
7b55619cf5
16 files changed
+508
-185
No files matched your search
@@ -1,5 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useAtom } from 'jotai';
|
||||
import { atomWithStorage } from 'jotai/utils';
|
||||
import { ArrowLeft, ArrowRight, SlidersHorizontal } from 'lucide-react';
|
||||
@@ -15,12 +16,21 @@ const isShowFilterAtom = atomWithStorage('is-show-filters', false);
|
||||
export default function Container() {
|
||||
const [isShowFilter, setIsShowFilter] = useAtom(isShowFilterAtom);
|
||||
const { movie, next, previous, hasPrevious } = useRandomMovie();
|
||||
const [direction, setDirection] = useState(0);
|
||||
|
||||
return (
|
||||
<>
|
||||
{isShowFilter && <Filter />}
|
||||
<div className='gap-2 flex bg-background mb-2 lg:static max-sm:z-10 max-sm:fixed max-sm:bottom-0 max-sm:left-0 max-sm:w-full max-sm:p-2 max-sm:px-[12px] max-sm:mb-0'>
|
||||
<Button className='p-2' onClick={previous} disabled={!hasPrevious} title='Previous movie'>
|
||||
<Button
|
||||
className='p-2'
|
||||
onClick={() => {
|
||||
previous();
|
||||
setDirection(-1);
|
||||
}}
|
||||
disabled={!hasPrevious}
|
||||
title='Previous movie'
|
||||
>
|
||||
<ArrowLeft size={24} strokeWidth={1} />
|
||||
</Button>
|
||||
<Button
|
||||
@@ -31,11 +41,19 @@ export default function Container() {
|
||||
>
|
||||
<SlidersHorizontal size={24} strokeWidth={1} />
|
||||
</Button>
|
||||
<Button className='w-full p-2 grow' onClick={next} title='Next movie'>
|
||||
<Button
|
||||
className='w-full p-2 grow'
|
||||
variant='default'
|
||||
onClick={() => {
|
||||
next();
|
||||
setDirection(1);
|
||||
}}
|
||||
title='Next movie'
|
||||
>
|
||||
<ArrowRight size={24} strokeWidth={1} />
|
||||
</Button>
|
||||
</div>
|
||||
<Movie key={movie?.id} movie={movie} />
|
||||
<Movie movie={movie} direction={direction} />
|
||||
<div className='w-full h-2 max-sm:h-20' />
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { ChangeEvent, useRef, useState } from 'react';
|
||||
import { Search as SearchIcon, XCircle } from 'lucide-react';
|
||||
import { ChangeEvent, FC, useRef, useState } from 'react';
|
||||
import { create, InstanceProps } from 'react-modal-promise';
|
||||
import { XCircle } from 'lucide-react';
|
||||
|
||||
import List from '@/components/Movie/List';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Dialog, DialogContent } from '@/components/ui/dialog';
|
||||
import { Modal } from '@/components/ui/dialog';
|
||||
import { Input } from '@/components/ui/input';
|
||||
|
||||
import useSearch from './useSearch';
|
||||
|
||||
const Search = () => {
|
||||
const [isShow, setIsShow] = useState(false);
|
||||
const Search: FC<InstanceProps<void>> = ({ isOpen, onResolve }) => {
|
||||
const [title, setTitle] = useState('');
|
||||
const [query, setQuery] = useState('');
|
||||
const timeout = useRef<NodeJS.Timeout>();
|
||||
@@ -31,18 +31,11 @@ const Search = () => {
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setIsShow(false);
|
||||
handleReset();
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button variant='outline' size='icon' onClick={() => setIsShow(true)}>
|
||||
<SearchIcon />
|
||||
</Button>
|
||||
{isShow && (
|
||||
<Dialog defaultOpen={true} onOpenChange={handleClose}>
|
||||
<DialogContent className='block p-3 max-w-[950px]' onClose={() => setIsShow(false)}>
|
||||
<Modal className='block p-3 max-w-[950px]' isOpen={isOpen} onClose={() => onResolve()}>
|
||||
<div className='relative'>
|
||||
<Input
|
||||
ref={inputRef}
|
||||
@@ -62,7 +55,6 @@ const Search = () => {
|
||||
<XCircle />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{Boolean(results?.pages.length) && (
|
||||
<div className='mt-3'>
|
||||
<List
|
||||
@@ -74,11 +66,10 @@ const Search = () => {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)}
|
||||
</>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export const showSearchModal = create(Search);
|
||||
|
||||
export default Search;
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { FC } from 'react';
|
||||
import { Moon, Sun } from 'lucide-react';
|
||||
import { Moon, Search as SearchIcon, Sun } from 'lucide-react';
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { useTheme } from '@/hooks/useTheme';
|
||||
|
||||
import Search from './components/Search';
|
||||
import { showSearchModal } from './components/Search';
|
||||
|
||||
const Header: FC = () => {
|
||||
const path = usePathname();
|
||||
@@ -26,7 +26,9 @@ const Header: FC = () => {
|
||||
<Button variant='outline' size='icon' onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>
|
||||
{theme === 'light' ? <Moon /> : <Sun />}
|
||||
</Button>
|
||||
<Search />
|
||||
<Button variant='outline' size='icon' onClick={() => showSearchModal()}>
|
||||
<SearchIcon />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Tabs value={path} className='flex-grow mt-2'>
|
||||
@@ -36,7 +38,7 @@ const Header: FC = () => {
|
||||
['/top', 'Top'],
|
||||
['/favorites', 'Favorites']
|
||||
].map(([path, label]) => (
|
||||
<Link href={path} className='w-full' key={path} prefetch>
|
||||
<Link href={path} className='w-full' key={path}>
|
||||
<TabsTrigger className='w-full' value={path}>
|
||||
{label}
|
||||
</TabsTrigger>
|
||||
|
||||
+33
-10
@@ -1,8 +1,9 @@
|
||||
import { FC, Fragment, useLayoutEffect, useState } from 'react';
|
||||
import { motion } from 'framer-motion';
|
||||
|
||||
import Card from '@/components/Movie/Card';
|
||||
import Preview from '@/components/Movie/Preview';
|
||||
import { Dialog, DialogContent } from '@/components/ui/dialog';
|
||||
import { Modal } from '@/components/ui/dialog';
|
||||
import filterUnknownMovies from '@/lib/filterUnknownMovies';
|
||||
|
||||
interface Props {
|
||||
@@ -13,6 +14,23 @@ interface Props {
|
||||
onPreviewClose?: () => void;
|
||||
}
|
||||
|
||||
const container = {
|
||||
hidden: {},
|
||||
visible: {
|
||||
transition: {
|
||||
staggerChildren: 0.15
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const item = {
|
||||
hidden: { y: -20, opacity: 0 },
|
||||
visible: {
|
||||
y: 0,
|
||||
opacity: 1
|
||||
}
|
||||
};
|
||||
|
||||
const List: FC<Props> = ({ pages, hasNextPage, fetchNextPage, withBottomGap = true, onPreviewClose }) => {
|
||||
const [movie, setMovie] = useState<Movie | null>(null);
|
||||
const [loader, setLoader] = useState<HTMLLIElement>();
|
||||
@@ -38,26 +56,32 @@ const List: FC<Props> = ({ pages, hasNextPage, fetchNextPage, withBottomGap = tr
|
||||
|
||||
return (
|
||||
<>
|
||||
<ul className='flex gap-3 flex-wrap justify-center grow'>
|
||||
<motion.ul
|
||||
className='flex gap-3 flex-wrap justify-center grow'
|
||||
variants={container}
|
||||
initial='hidden'
|
||||
animate='visible'
|
||||
layout
|
||||
>
|
||||
{pages.map((page) => (
|
||||
<Fragment key={page.page}>
|
||||
{filterUnknownMovies(page.results)?.map((movie, index, array) => (
|
||||
<li
|
||||
<motion.li
|
||||
key={movie.id}
|
||||
variants={item}
|
||||
className='flex basis-[300px] cursor-pointer'
|
||||
onClick={() => setMovie(movie)}
|
||||
onTap={() => setMovie(movie)}
|
||||
ref={array.length / 2 !== index ? undefined : (element) => setLoader(element!)}
|
||||
>
|
||||
<Card movie={movie} className='grow flex flex-col' />
|
||||
</li>
|
||||
</motion.li>
|
||||
))}
|
||||
</Fragment>
|
||||
))}
|
||||
</ul>
|
||||
</motion.ul>
|
||||
{withBottomGap && <div className='h-4 w-full' />}
|
||||
<Modal isOpen={Boolean(movie)} onClose={() => setMovie(null)} className='block p-0'>
|
||||
{movie && (
|
||||
<Dialog defaultOpen={true} onOpenChange={(isOpen) => !isOpen && setMovie(null)}>
|
||||
<DialogContent className='block p-0' onClose={() => setMovie(null)}>
|
||||
<Preview
|
||||
key={movie.id}
|
||||
movie={movie}
|
||||
@@ -68,9 +92,8 @@ const List: FC<Props> = ({ pages, hasNextPage, fetchNextPage, withBottomGap = tr
|
||||
onPreviewClose?.();
|
||||
}}
|
||||
/>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)}
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,49 +1,73 @@
|
||||
import { FC, useState } from 'react';
|
||||
import { FC } from 'react';
|
||||
import { AnimatePresence, motion } from 'framer-motion';
|
||||
import { Play } from 'lucide-react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
import useTrailer from '@/app/(site)/useTrailer';
|
||||
import Credits from '@/components/Movie/components/Credits';
|
||||
import Trailer from '@/components/Movie/components/Trailer';
|
||||
import { showTrailerModal } from '@/components/Movie/components/Trailer';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
|
||||
import { Button } from '../ui/button';
|
||||
|
||||
import Torrents from './components/Torrents';
|
||||
import { showTorrentsModal } from './components/Torrents';
|
||||
import Card from './Card';
|
||||
|
||||
interface Props {
|
||||
movie?: Movie;
|
||||
className?: string;
|
||||
direction?: number;
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
const Preview: FC<Props> = ({ movie, className, onClose }) => {
|
||||
const [isShowTrailer, setIsShowTrailer] = useState(false);
|
||||
const [isShowTorrents, setIsShowTorrents] = useState(false);
|
||||
const variants = {
|
||||
enter: (direction: number) => ({
|
||||
scale: 0.8,
|
||||
opacity: 0,
|
||||
[direction === 0 ? 'y' : 'x']: direction ? direction * -320 : -100
|
||||
}),
|
||||
center: { x: 0, opacity: 1, y: 0, scale: 1 },
|
||||
exit: (direction: number) => ({ scale: 0.8, opacity: 1, [direction === 0 ? 'y' : 'x']: (direction || -1) * 320 })
|
||||
};
|
||||
|
||||
const Preview: FC<Props> = ({ movie, className, onClose, direction }) => {
|
||||
const { data: trailer } = useTrailer({ movieId: movie?.id });
|
||||
const router = useRouter();
|
||||
|
||||
if (!movie) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={`p-3 rounded-xl border bg-card text-card-foreground shadow-sm ${className}`}>
|
||||
<div className={`rounded-xl bg-card text-card-foreground ${className} ${onClose ? 'p-2' : ''}`}>
|
||||
<div className='flex flex-col lg:flex-row max-w-[100%] gap-3'>
|
||||
<div className='max-w-[300px] min-w-[300px] h-[450px] mx-auto w-[100%] relative overflow-hidden rounded-lg'>
|
||||
<AnimatePresence custom={direction}>
|
||||
<motion.div
|
||||
className='absolute'
|
||||
initial='enter'
|
||||
animate='center'
|
||||
exit='exit'
|
||||
key={movie?.id}
|
||||
variants={variants}
|
||||
custom={direction}
|
||||
transition={{ type: 'tween' }}
|
||||
>
|
||||
<Card movie={movie} className='max-w-[300px] min-w-[300px] mx-auto w-full'>
|
||||
{trailer && (
|
||||
<div
|
||||
onClick={() => setIsShowTrailer(true)}
|
||||
<motion.div
|
||||
onTap={() => showTrailerModal({ trailerKey: trailer?.key })}
|
||||
title='Play trailer'
|
||||
className='absolute w-full h-full left-0 top-0 bg-black cursor-pointer overflow-hidden rounded-lg transition-opacity opacity-0 hover:opacity-70 flex items-center justify-center'
|
||||
>
|
||||
<Play size={100} className='fill-white' />
|
||||
</div>
|
||||
</motion.div>
|
||||
)}
|
||||
</Card>
|
||||
</motion.div>
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
<div className='flex flex-col grow'>
|
||||
<div className='flex w-full gap-2'>
|
||||
<Button className='h-8 grow' onClick={() => setIsShowTorrents(true)}>
|
||||
<Button className='h-8 grow' onClick={() => showTorrentsModal({ title: movie.title })}>
|
||||
Torrents
|
||||
</Button>
|
||||
<Button
|
||||
@@ -57,14 +81,19 @@ const Preview: FC<Props> = ({ movie, className, onClose }) => {
|
||||
</Button>
|
||||
</div>
|
||||
<Separator className='my-2' />
|
||||
<p className='leading-7'>{movie.overview}</p>
|
||||
<motion.p
|
||||
key={movie.id}
|
||||
className='leading-7'
|
||||
initial={{ opacity: 0, y: -100 }}
|
||||
animate={{ y: 0, opacity: 1 }}
|
||||
exit={{ y: 100, opacity: 0 }}
|
||||
>
|
||||
{movie.overview}
|
||||
</motion.p>
|
||||
</div>
|
||||
</div>
|
||||
<Credits movieId={movie.id} onPersonClick={() => onClose?.()} />
|
||||
</div>
|
||||
{isShowTrailer && <Trailer trailerKey={trailer?.key} onClose={() => setIsShowTrailer(false)} />}
|
||||
{isShowTorrents && <Torrents title={movie.title} onClose={() => setIsShowTorrents(false)} />}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { FC } from 'react';
|
||||
import { motion } from 'framer-motion';
|
||||
import { User2 } from 'lucide-react';
|
||||
import Image from 'next/image';
|
||||
import { useRouter } from 'next/navigation';
|
||||
@@ -10,6 +11,23 @@ interface Props {
|
||||
onPersonClick?: (id: string) => void;
|
||||
}
|
||||
|
||||
const container = {
|
||||
hidden: {},
|
||||
visible: {
|
||||
transition: {
|
||||
staggerChildren: 0.15
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const item = {
|
||||
hidden: { x: -20, opacity: 0 },
|
||||
visible: {
|
||||
x: 0,
|
||||
opacity: 1
|
||||
}
|
||||
};
|
||||
|
||||
const Credits: FC<Props> = ({ movieId, onPersonClick }) => {
|
||||
const router = useRouter();
|
||||
const { data: credits } = useCredits({ movieId });
|
||||
@@ -17,12 +35,13 @@ const Credits: FC<Props> = ({ movieId, onPersonClick }) => {
|
||||
return (
|
||||
Boolean(credits?.length) && (
|
||||
<div className='overflow-auto max-w-[100%] py-3 mb-[-0.75rem]'>
|
||||
<ul className='flex gap-3'>
|
||||
<motion.ul className='flex gap-3' variants={container} initial='hidden' animate='visible' layout>
|
||||
{credits?.map((actor) => (
|
||||
<li
|
||||
<motion.li
|
||||
variants={item}
|
||||
key={`${actor.id}_${actor.cast_id}`}
|
||||
title={actor.name}
|
||||
onClick={() => {
|
||||
onTap={() => {
|
||||
router.push(`/top?starring=${actor.id}&title=${encodeURIComponent(actor.name)}`);
|
||||
onPersonClick?.(actor.id.toString());
|
||||
}}
|
||||
@@ -47,9 +66,9 @@ const Credits: FC<Props> = ({ movieId, onPersonClick }) => {
|
||||
)}
|
||||
</div>
|
||||
<p className='pt-2 overflow-ellipsis whitespace-nowrap overflow-hidden'>{actor.name}</p>
|
||||
</li>
|
||||
</motion.li>
|
||||
))}
|
||||
</ul>
|
||||
</motion.ul>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { FC } from 'react';
|
||||
import { motion } from 'framer-motion';
|
||||
import { Heart, Star } from 'lucide-react';
|
||||
|
||||
import useFavorites, { useFavoritesMutation } from '@/app/(site)/favorites/useFavorites';
|
||||
@@ -16,8 +17,8 @@ const Rating: FC<Props> = ({ movie, iconsFillColor = 'fill-accent-foreground' })
|
||||
|
||||
return (
|
||||
<span className='select-none flex w-full items-center ml-auto gap-1 mt-[-8px] justify-between'>
|
||||
<span
|
||||
onClick={(event) => {
|
||||
<motion.span
|
||||
onTap={(event) => {
|
||||
event.stopPropagation();
|
||||
|
||||
isFavorite ? remove(movie.id) : add(movie);
|
||||
@@ -26,7 +27,7 @@ const Rating: FC<Props> = ({ movie, iconsFillColor = 'fill-accent-foreground' })
|
||||
title={isFavorite ? 'Remove from favorites' : 'Add to favorite'}
|
||||
>
|
||||
<Heart className={isFavorite ? iconsFillColor : ''} size={20} />
|
||||
</span>
|
||||
</motion.span>
|
||||
<span className='flex items-center'>
|
||||
<Star size={18} className={`mr-1 ${iconsFillColor}`} />
|
||||
<span className='font-semibold'>{movie.vote_average?.toFixed(1)}</span>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import React, { Dispatch, FC, SetStateAction, useState } from 'react';
|
||||
import { create, InstanceProps } from 'react-modal-promise';
|
||||
import { ArrowDownIcon, CaretSortIcon } from '@radix-ui/react-icons';
|
||||
import { useAtom } from 'jotai';
|
||||
import { useAtom, useAtomValue } from 'jotai';
|
||||
import { atomWithStorage } from 'jotai/utils';
|
||||
import { Cast, Loader, Magnet } from 'lucide-react';
|
||||
|
||||
import useTorrents from '@/app/(site)/useTorrents';
|
||||
import { ORDER } from '@/app/api/torrents/parsers/pirate-bay';
|
||||
import { Dialog, DialogContent } from '@/components/ui/dialog';
|
||||
import { Modal } from '@/components/ui/dialog';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
|
||||
|
||||
interface Props {
|
||||
interface Props extends InstanceProps<void> {
|
||||
title: string;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
type Sorting = {
|
||||
@@ -49,9 +49,23 @@ const TableHeadSortable = ({
|
||||
|
||||
const hostAtom = atomWithStorage<string>('magnet-host', '');
|
||||
|
||||
const Torrents: FC<Props> = ({ title, onClose }) => {
|
||||
const showHostManagerModal = create(({ onResolve, isOpen }) => {
|
||||
const [host, setHost] = useAtom(hostAtom);
|
||||
const [isShowHostInput, setIsShowHostInput] = useState(false);
|
||||
return (
|
||||
<Modal className='p-3 pt-0 max-w-[200px] m-auto' isOpen={isOpen} onClose={() => onResolve()}>
|
||||
<Input
|
||||
autoFocus
|
||||
placeholder='Enter host of Elementum'
|
||||
value={host}
|
||||
onChange={({ target: { value } }) => setHost(value)}
|
||||
onKeyDown={({ key }) => key === 'Enter' && onResolve()}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
});
|
||||
|
||||
const Torrents: FC<Props> = ({ title, isOpen, onResolve }) => {
|
||||
const host = useAtomValue(hostAtom);
|
||||
const [sorting, setSorting] = useState<Sorting>({ by: ORDER.seeders });
|
||||
|
||||
const { data: torrents, isLoading, isFetched } = useTorrents({ query: title, order: sorting.by });
|
||||
@@ -64,15 +78,14 @@ const Torrents: FC<Props> = ({ title, onClose }) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog defaultOpen={true} onOpenChange={(isOpen) => !isOpen && onClose()}>
|
||||
<DialogContent className='p-0' onClose={onClose}>
|
||||
<Modal className='p-0' isOpen={isOpen} onClose={() => onResolve()}>
|
||||
<Table className='rounded-xl overflow-hidden'>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead className='px-2'>Title</TableHead>
|
||||
<TableHeadSortable title='Size' by={ORDER.size} value={sorting} onChange={setSorting} />
|
||||
<TableHeadSortable title='Seeders' by={ORDER.seeders} value={sorting} onChange={setSorting} />
|
||||
<TableHead className='px-2 text-center' onClick={() => setIsShowHostInput(true)}>
|
||||
<TableHead className='px-2 text-center cursor-pointer select-none' onClick={() => showHostManagerModal()}>
|
||||
Magnet
|
||||
</TableHead>
|
||||
</TableRow>
|
||||
@@ -123,22 +136,10 @@ const Torrents: FC<Props> = ({ title, onClose }) => {
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
{isShowHostInput && (
|
||||
<Dialog defaultOpen={true} onOpenChange={() => setIsShowHostInput(false)}>
|
||||
<DialogContent className='flex p-3 max-w-[300px] gap-2' onClose={() => setIsShowHostInput(false)}>
|
||||
<Input
|
||||
autoFocus
|
||||
placeholder='Enter host of Elementum'
|
||||
value={host}
|
||||
onChange={({ target: { value } }) => setHost(value)}
|
||||
onKeyDown={({ key }) => key === 'Enter' && setIsShowHostInput(false)}
|
||||
/>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export const showTorrentsModal = create(Torrents);
|
||||
|
||||
export default Torrents;
|
||||
@@ -1,17 +1,21 @@
|
||||
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}>
|
||||
<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'
|
||||
@@ -20,10 +24,10 @@ const Trailer: FC<Props> = ({ trailerKey, onClose }) => {
|
||||
src={`//www.youtube.com/embed/${trailerKey}?autoplay=1`}
|
||||
allowFullScreen
|
||||
/>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export const showTrailerModal = create(Trailer);
|
||||
|
||||
export default Trailer;
|
||||
+25
-26
@@ -1,56 +1,55 @@
|
||||
import * as React from 'react'
|
||||
import { Slot } from '@radix-ui/react-slot'
|
||||
import { cva, type VariantProps } from 'class-variance-authority'
|
||||
import * as React from 'react';
|
||||
import { useRef, useState } from 'react';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
import { HTMLMotionProps, motion } from 'framer-motion';
|
||||
|
||||
import { cn } from '@/lib/utils'
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
const buttonVariants = cva(
|
||||
'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
||||
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',
|
||||
default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm 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',
|
||||
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
||||
link: 'text-primary underline-offset-4 hover:underline',
|
||||
link: 'text-primary underline-offset-4 hover:underline'
|
||||
},
|
||||
size: {
|
||||
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: 'h-10 w-10'
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: 'default',
|
||||
size: 'default',
|
||||
},
|
||||
size: 'default'
|
||||
}
|
||||
)
|
||||
}
|
||||
);
|
||||
|
||||
export interface ButtonProps
|
||||
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
VariantProps<typeof buttonVariants> {
|
||||
asChild?: boolean
|
||||
asChild?: boolean;
|
||||
}
|
||||
|
||||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
({ className, variant, size, asChild = false, ...props }, ref) => {
|
||||
const Comp = asChild ? Slot : 'button'
|
||||
const Button = React.forwardRef<HTMLButtonElement, HTMLMotionProps<'button'> & Pick<ButtonProps, 'size' | 'variant'>>(
|
||||
({ className, variant, size, ...props }, ref) => {
|
||||
return (
|
||||
<Comp
|
||||
<motion.button
|
||||
className={cn(buttonVariants({ variant, size, className }))}
|
||||
ref={ref}
|
||||
{...props}
|
||||
onClick={undefined}
|
||||
onTap={(e) => props.onClick?.(e as unknown as React.MouseEvent<HTMLButtonElement, MouseEvent>)}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
)
|
||||
Button.displayName = 'Button'
|
||||
);
|
||||
Button.displayName = 'Button';
|
||||
|
||||
export { Button, buttonVariants }
|
||||
export { Button, buttonVariants };
|
||||
+59
-49
@@ -1,32 +1,35 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import { useState } from 'react';
|
||||
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
||||
import { AnimatePresence, motion, useDragControls } from 'framer-motion';
|
||||
import { GripHorizontal } from 'lucide-react';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
const Dialog = DialogPrimitive.Root;
|
||||
|
||||
const DialogTrigger = DialogPrimitive.Trigger;
|
||||
|
||||
const DialogPortal = ({ className, ...props }: DialogPrimitive.DialogPortalProps) => (
|
||||
<DialogPrimitive.Portal className={cn(className)} {...props} />
|
||||
);
|
||||
const DialogPortal = ({ ...props }: DialogPrimitive.DialogPortalProps) => <DialogPrimitive.Portal {...props} />;
|
||||
DialogPortal.displayName = DialogPrimitive.Portal.displayName;
|
||||
|
||||
const transition = { duration: 0.35, type: 'spring', bounce: 0 };
|
||||
|
||||
const DialogOverlay = React.forwardRef<
|
||||
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
||||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<DialogPrimitive.Overlay
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
<DialogPrimitive.Overlay ref={ref} {...props}>
|
||||
<motion.div
|
||||
onScroll={props.onScroll}
|
||||
className={cn('fixed inset-0 z-50 transform-gpu backdrop-brightness-50 select-none', className)}
|
||||
transition={transition}
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
>
|
||||
{props?.children}
|
||||
</motion.div>
|
||||
</DialogPrimitive.Overlay>
|
||||
));
|
||||
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
||||
|
||||
@@ -34,54 +37,61 @@ const DialogContent = React.forwardRef<
|
||||
React.ElementRef<typeof DialogPrimitive.Content>,
|
||||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & { onClose?: () => void }
|
||||
>(({ className, children, ...props }, ref) => {
|
||||
const controls = useDragControls();
|
||||
return (
|
||||
<DialogPortal>
|
||||
<DialogOverlay className='overflow-auto flex justify-center'>
|
||||
<DialogOverlay className='overflow-auto flex justify-center select-none'>
|
||||
<motion.div
|
||||
className='absolute top-[20vh] max-w-[1000px] w-[calc(100%-24px)] select-none'
|
||||
transition={transition}
|
||||
initial={{ top: '100vh' }}
|
||||
animate={{ top: '20vh' }}
|
||||
exit={{ top: '100vh' }}
|
||||
drag='y'
|
||||
dragConstraints={{ top: 0, bottom: 300 }}
|
||||
onDragEnd={(_, info) => info.offset.y > 100 && props.onClose?.()}
|
||||
dragListener={false}
|
||||
dragControls={controls}
|
||||
dragElastic={0.5}
|
||||
>
|
||||
<DialogPrimitive.Content
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'absolute top-[20vh] max-w-[1000px] w-[calc(100%-24px)] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-xl',
|
||||
className
|
||||
)}
|
||||
className={cn('gap-4 border bg-background p-6 shadow-lg rounded-xl relative', className)}
|
||||
{...props}
|
||||
>
|
||||
<motion.div
|
||||
className='w-full h-10 flex p-2 justify-center cursor-grab absolute top-[-36px] z-10'
|
||||
onPointerDown={(e) => controls.start(e)}
|
||||
>
|
||||
<GripHorizontal color='white' />
|
||||
</motion.div>
|
||||
{children}
|
||||
<div className='absolute w-full block h-[20vh] pointer-events-none' />
|
||||
</DialogPrimitive.Content>
|
||||
</motion.div>
|
||||
</DialogOverlay>
|
||||
</DialogPortal>
|
||||
);
|
||||
});
|
||||
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
||||
|
||||
const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
||||
<div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />
|
||||
);
|
||||
DialogHeader.displayName = 'DialogHeader';
|
||||
const Modal: React.FC<{
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
}> = ({ children, onClose, isOpen, className }) => {
|
||||
return (
|
||||
<AnimatePresence>
|
||||
{isOpen && (
|
||||
<Dialog defaultOpen={true} onOpenChange={onClose}>
|
||||
<DialogContent forceMount className={className} onClose={onClose}>
|
||||
{children}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
);
|
||||
};
|
||||
|
||||
const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
||||
<div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />
|
||||
);
|
||||
DialogFooter.displayName = 'DialogFooter';
|
||||
|
||||
const DialogTitle = React.forwardRef<
|
||||
React.ElementRef<typeof DialogPrimitive.Title>,
|
||||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<DialogPrimitive.Title
|
||||
ref={ref}
|
||||
className={cn('text-lg font-semibold leading-none tracking-tight', className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
||||
|
||||
const DialogDescription = React.forwardRef<
|
||||
React.ElementRef<typeof DialogPrimitive.Description>,
|
||||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<DialogPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />
|
||||
));
|
||||
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
||||
|
||||
export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
||||
export { Dialog, DialogContent, Modal };
|
||||
@@ -29,7 +29,7 @@ const TabsTrigger = React.forwardRef<
|
||||
<TabsPrimitive.Trigger
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm',
|
||||
'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm',
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
|
||||
Generated
+224
-14
@@ -8,7 +8,7 @@
|
||||
"name": "movie-advisor",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"@radix-ui/react-dialog": "^1.0.4",
|
||||
"@radix-ui/react-dialog": "^1.0.5",
|
||||
"@radix-ui/react-dropdown-menu": "^2.0.5",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@radix-ui/react-label": "^2.0.2",
|
||||
@@ -31,6 +31,7 @@
|
||||
"cmdk": "^0.2.0",
|
||||
"eslint": "8.45.0",
|
||||
"eslint-config-next": "13.4.12",
|
||||
"framer-motion": "^10.16.16",
|
||||
"jotai": "^2.2.2",
|
||||
"js-cookie": "^3.0.5",
|
||||
"lucide-react": "^0.263.0",
|
||||
@@ -40,9 +41,11 @@
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-fast-marquee": "^1.6.0",
|
||||
"react-modal-promise": "^1.0.2",
|
||||
"tailwind-merge": "^1.14.0",
|
||||
"tailwindcss-animate": "^1.0.6",
|
||||
"typescript": "5.1.6"
|
||||
"typescript": "5.1.6",
|
||||
"vaul": "^0.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/aspect-ratio": "^0.4.2",
|
||||
@@ -87,6 +90,21 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/is-prop-valid": {
|
||||
"version": "0.8.8",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz",
|
||||
"integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@emotion/memoize": "0.7.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@emotion/memoize": {
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz",
|
||||
"integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/@eslint-community/eslint-utils": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
|
||||
@@ -541,19 +559,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@radix-ui/react-dialog": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.0.4.tgz",
|
||||
"integrity": "sha512-hJtRy/jPULGQZceSAP2Re6/4NpKo8im6V8P2hUqZsdFiSL8l35kYsw3qbRI6Ay5mQd2+wlLqje770eq+RJ3yZg==",
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.0.5.tgz",
|
||||
"integrity": "sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@radix-ui/primitive": "1.0.1",
|
||||
"@radix-ui/react-compose-refs": "1.0.1",
|
||||
"@radix-ui/react-context": "1.0.1",
|
||||
"@radix-ui/react-dismissable-layer": "1.0.4",
|
||||
"@radix-ui/react-dismissable-layer": "1.0.5",
|
||||
"@radix-ui/react-focus-guards": "1.0.1",
|
||||
"@radix-ui/react-focus-scope": "1.0.3",
|
||||
"@radix-ui/react-focus-scope": "1.0.4",
|
||||
"@radix-ui/react-id": "1.0.1",
|
||||
"@radix-ui/react-portal": "1.0.3",
|
||||
"@radix-ui/react-portal": "1.0.4",
|
||||
"@radix-ui/react-presence": "1.0.1",
|
||||
"@radix-ui/react-primitive": "1.0.3",
|
||||
"@radix-ui/react-slot": "1.0.2",
|
||||
@@ -576,6 +594,81 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz",
|
||||
"integrity": "sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@radix-ui/primitive": "1.0.1",
|
||||
"@radix-ui/react-compose-refs": "1.0.1",
|
||||
"@radix-ui/react-primitive": "1.0.3",
|
||||
"@radix-ui/react-use-callback-ref": "1.0.1",
|
||||
"@radix-ui/react-use-escape-keydown": "1.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"@types/react-dom": "*",
|
||||
"react": "^16.8 || ^17.0 || ^18.0",
|
||||
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"@types/react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.4.tgz",
|
||||
"integrity": "sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@radix-ui/react-compose-refs": "1.0.1",
|
||||
"@radix-ui/react-primitive": "1.0.3",
|
||||
"@radix-ui/react-use-callback-ref": "1.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"@types/react-dom": "*",
|
||||
"react": "^16.8 || ^17.0 || ^18.0",
|
||||
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"@types/react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.4.tgz",
|
||||
"integrity": "sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@radix-ui/react-primitive": "1.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"@types/react-dom": "*",
|
||||
"react": "^16.8 || ^17.0 || ^18.0",
|
||||
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"@types/react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@radix-ui/react-direction": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.0.1.tgz",
|
||||
@@ -3388,6 +3481,29 @@
|
||||
"url": "https://www.patreon.com/infusion"
|
||||
}
|
||||
},
|
||||
"node_modules/framer-motion": {
|
||||
"version": "10.16.16",
|
||||
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-10.16.16.tgz",
|
||||
"integrity": "sha512-je6j91rd7NmUX7L1XHouwJ4v3R+SO4umso2LUcgOct3rHZ0PajZ80ETYZTajzEXEl9DlKyzjyt4AvGQ+lrebOw==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@emotion/is-prop-valid": "^0.8.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
@@ -4972,6 +5088,15 @@
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"node_modules/react-modal-promise": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/react-modal-promise/-/react-modal-promise-1.0.2.tgz",
|
||||
"integrity": "sha512-dqT618ROhG8qh1+O6EZkia5ELw3zaZWGpMX2YfEH4bgwYENPuFonqKw1W70LFx3K/SCZvVBcD6UYEI12yzYXzg==",
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0",
|
||||
"react-dom": ">=16.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-remove-scroll": {
|
||||
"version": "2.5.5",
|
||||
"resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
|
||||
@@ -5931,6 +6056,18 @@
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
},
|
||||
"node_modules/vaul": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/vaul/-/vaul-0.8.0.tgz",
|
||||
"integrity": "sha512-9nUU2jIObJvJZxeQU1oVr/syKo5XqbRoOMoTEt0hHlWify4QZFlqTh6QSN/yxoKzNrMeEQzxbc3XC/vkPLOIqw==",
|
||||
"dependencies": {
|
||||
"@radix-ui/react-dialog": "^1.0.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8 || ^17.0 || ^18.0",
|
||||
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/watchpack": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
|
||||
@@ -6047,6 +6184,21 @@
|
||||
"regenerator-runtime": "^0.13.11"
|
||||
}
|
||||
},
|
||||
"@emotion/is-prop-valid": {
|
||||
"version": "0.8.8",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz",
|
||||
"integrity": "sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"@emotion/memoize": "0.7.4"
|
||||
}
|
||||
},
|
||||
"@emotion/memoize": {
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz",
|
||||
"integrity": "sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==",
|
||||
"optional": true
|
||||
},
|
||||
"@eslint-community/eslint-utils": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
|
||||
@@ -6320,25 +6472,60 @@
|
||||
}
|
||||
},
|
||||
"@radix-ui/react-dialog": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.0.4.tgz",
|
||||
"integrity": "sha512-hJtRy/jPULGQZceSAP2Re6/4NpKo8im6V8P2hUqZsdFiSL8l35kYsw3qbRI6Ay5mQd2+wlLqje770eq+RJ3yZg==",
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.0.5.tgz",
|
||||
"integrity": "sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@radix-ui/primitive": "1.0.1",
|
||||
"@radix-ui/react-compose-refs": "1.0.1",
|
||||
"@radix-ui/react-context": "1.0.1",
|
||||
"@radix-ui/react-dismissable-layer": "1.0.4",
|
||||
"@radix-ui/react-dismissable-layer": "1.0.5",
|
||||
"@radix-ui/react-focus-guards": "1.0.1",
|
||||
"@radix-ui/react-focus-scope": "1.0.3",
|
||||
"@radix-ui/react-focus-scope": "1.0.4",
|
||||
"@radix-ui/react-id": "1.0.1",
|
||||
"@radix-ui/react-portal": "1.0.3",
|
||||
"@radix-ui/react-portal": "1.0.4",
|
||||
"@radix-ui/react-presence": "1.0.1",
|
||||
"@radix-ui/react-primitive": "1.0.3",
|
||||
"@radix-ui/react-slot": "1.0.2",
|
||||
"@radix-ui/react-use-controllable-state": "1.0.1",
|
||||
"aria-hidden": "^1.1.1",
|
||||
"react-remove-scroll": "2.5.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-dismissable-layer": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz",
|
||||
"integrity": "sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@radix-ui/primitive": "1.0.1",
|
||||
"@radix-ui/react-compose-refs": "1.0.1",
|
||||
"@radix-ui/react-primitive": "1.0.3",
|
||||
"@radix-ui/react-use-callback-ref": "1.0.1",
|
||||
"@radix-ui/react-use-escape-keydown": "1.0.3"
|
||||
}
|
||||
},
|
||||
"@radix-ui/react-focus-scope": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.4.tgz",
|
||||
"integrity": "sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@radix-ui/react-compose-refs": "1.0.1",
|
||||
"@radix-ui/react-primitive": "1.0.3",
|
||||
"@radix-ui/react-use-callback-ref": "1.0.1"
|
||||
}
|
||||
},
|
||||
"@radix-ui/react-portal": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.4.tgz",
|
||||
"integrity": "sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@radix-ui/react-primitive": "1.0.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@radix-ui/react-direction": {
|
||||
@@ -8171,6 +8358,15 @@
|
||||
"integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==",
|
||||
"dev": true
|
||||
},
|
||||
"framer-motion": {
|
||||
"version": "10.16.16",
|
||||
"resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-10.16.16.tgz",
|
||||
"integrity": "sha512-je6j91rd7NmUX7L1XHouwJ4v3R+SO4umso2LUcgOct3rHZ0PajZ80ETYZTajzEXEl9DlKyzjyt4AvGQ+lrebOw==",
|
||||
"requires": {
|
||||
"@emotion/is-prop-valid": "^0.8.2",
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
@@ -9201,6 +9397,12 @@
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
||||
},
|
||||
"react-modal-promise": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/react-modal-promise/-/react-modal-promise-1.0.2.tgz",
|
||||
"integrity": "sha512-dqT618ROhG8qh1+O6EZkia5ELw3zaZWGpMX2YfEH4bgwYENPuFonqKw1W70LFx3K/SCZvVBcD6UYEI12yzYXzg==",
|
||||
"requires": {}
|
||||
},
|
||||
"react-remove-scroll": {
|
||||
"version": "2.5.5",
|
||||
"resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
|
||||
@@ -9815,6 +10017,14 @@
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
},
|
||||
"vaul": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/vaul/-/vaul-0.8.0.tgz",
|
||||
"integrity": "sha512-9nUU2jIObJvJZxeQU1oVr/syKo5XqbRoOMoTEt0hHlWify4QZFlqTh6QSN/yxoKzNrMeEQzxbc3XC/vkPLOIqw==",
|
||||
"requires": {
|
||||
"@radix-ui/react-dialog": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"watchpack": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
|
||||
|
||||
+5
-2
@@ -9,7 +9,7 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-dialog": "^1.0.4",
|
||||
"@radix-ui/react-dialog": "^1.0.5",
|
||||
"@radix-ui/react-dropdown-menu": "^2.0.5",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@radix-ui/react-label": "^2.0.2",
|
||||
@@ -32,6 +32,7 @@
|
||||
"cmdk": "^0.2.0",
|
||||
"eslint": "8.45.0",
|
||||
"eslint-config-next": "13.4.12",
|
||||
"framer-motion": "^10.16.16",
|
||||
"jotai": "^2.2.2",
|
||||
"js-cookie": "^3.0.5",
|
||||
"lucide-react": "^0.263.0",
|
||||
@@ -41,9 +42,11 @@
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-fast-marquee": "^1.6.0",
|
||||
"react-modal-promise": "^1.0.2",
|
||||
"tailwind-merge": "^1.14.0",
|
||||
"tailwindcss-animate": "^1.0.6",
|
||||
"typescript": "5.1.6"
|
||||
"typescript": "5.1.6",
|
||||
"vaul": "^0.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/aspect-ratio": "^0.4.2",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { ReactNode, useState } from 'react';
|
||||
import ModalContainer from 'react-modal-promise';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental';
|
||||
|
||||
@@ -22,6 +23,7 @@ const Providers = ({ children, theme }: { children: ReactNode; theme?: Theme })
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<ReactQueryStreamedHydration>
|
||||
<ThemeProvider theme={theme}>{children}</ThemeProvider>
|
||||
<ModalContainer />
|
||||
</ReactQueryStreamedHydration>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
|
||||
@@ -79,6 +79,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
* {
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
main,
|
||||
header {
|
||||
max-width: 1260px;
|
||||
|
||||
Reference in new issue
Block a user