feat(show-type): global movie/series toggle, type-aware pages and search, ?type=tv in URL
This commit is contained in:
1 parent
5b41dbca10
commit
0824090c6d
21 files changed
+415
-174
No files matched your search
@@ -1,9 +1,19 @@
|
||||
'use client';
|
||||
|
||||
import { useAtomValue } from 'jotai';
|
||||
|
||||
import { showTypeAtom } from '@/components/ShowTypeToggle';
|
||||
import popularQuery from '@/data/queries/popular';
|
||||
import useInfiniteList from '@/hooks/useInfiniteList';
|
||||
|
||||
const useTop = () =>
|
||||
useInfiniteList({ ...popularQuery({ sortBy: 'vote_average.desc' }), mode: 'default', list: 'top' });
|
||||
const useTop = () => {
|
||||
const showType = useAtomValue(showTypeAtom);
|
||||
|
||||
return useInfiniteList({
|
||||
...popularQuery({ sortBy: 'vote_average.desc', type: showType }),
|
||||
mode: 'default',
|
||||
list: 'top'
|
||||
});
|
||||
};
|
||||
|
||||
export default useTop;
|
||||
Reference in new issue
Block a user