feat: added favorites page
This commit is contained in:
1 parent
0cb860d0a0
commit
89e76f5df6
27 files changed
+412
-116
No files matched your search
@@ -5,12 +5,12 @@ import { useSearchParams } from 'next/navigation';
|
||||
|
||||
import API from './api';
|
||||
|
||||
const useTop = () => {
|
||||
const useTop = ({ starring }: { starring: string | null }) => {
|
||||
const page = useSearchParams().get('page');
|
||||
|
||||
return useInfiniteQuery({
|
||||
queryKey: ['top'],
|
||||
queryFn: ({ pageParam: page }) => API.top({ page }),
|
||||
queryKey: ['top', starring],
|
||||
queryFn: ({ pageParam: page }) => API.top({ page, starring }),
|
||||
suspense: true,
|
||||
getNextPageParam({ page, total_pages }) {
|
||||
if (page === total_pages) return undefined;
|
||||
|
||||
Reference in new issue
Block a user