feat: vidstack
This commit is contained in:
1 parent
184ee26e5b
commit
c31058c4f7
22 files changed
+419
-191
No files matched your search
@@ -10,17 +10,16 @@ import useTrending from './useTrending';
|
||||
|
||||
const Trending: FC = () => {
|
||||
const [active, setActive] = useState(tabs[0]);
|
||||
const isMobile = typeof window === 'undefined' ? true : matchMedia('(max-width: 600px)').matches;
|
||||
|
||||
const { data: trending, isFetched } = useTrending({ type: 'trending', enabled: !isMobile });
|
||||
const { data: streaming } = useTrending({ type: 'streaming', enabled: !isMobile });
|
||||
const { data: theater } = useTrending({ type: 'theater', enabled: !isMobile });
|
||||
const { data: trending, isFetched } = useTrending({ type: 'trending' });
|
||||
const { data: streaming } = useTrending({ type: 'streaming' });
|
||||
const { data: theater } = useTrending({ type: 'theater' });
|
||||
|
||||
const shows = { trending, streaming, theater }[active.type] || [];
|
||||
|
||||
return (
|
||||
isFetched && (
|
||||
<div>
|
||||
<div className='hidden md:block'>
|
||||
<Nav tabs={tabs} active={active} onChange={(active) => setActive(active)} className='mb-3' />
|
||||
<Gallery key={active.type} shows={shows} />
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user