feat: added favorites page

This commit is contained in:
ner committed 2023-08-09 18:43:48 +03:00
1 parent 0cb860d0a0
commit 89e76f5df6
27 files changed
+412 -116

No files matched your search

+3 -3
View File
@@ -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;