aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/components/bookmarks
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-17 10:15:01 +0000
committerMohamedBassem <me@mbassem.com>2024-03-17 10:22:38 +0000
commitc2bd6d6b33dc24c4321228add4fedfade93eb014 (patch)
tree6a3d52dbea3143cb95049293e06ef4a1b4efcdeb /apps/mobile/components/bookmarks
parent0b99fe783aaebc5baca40f9d1b837278811cd228 (diff)
downloadkarakeep-c2bd6d6b33dc24c4321228add4fedfade93eb014.tar.zst
refactor: Prepare for pagination by dropping querying bookmarks by id
Diffstat (limited to 'apps/mobile/components/bookmarks')
-rw-r--r--apps/mobile/components/bookmarks/BookmarkList.tsx18
1 files changed, 6 insertions, 12 deletions
diff --git a/apps/mobile/components/bookmarks/BookmarkList.tsx b/apps/mobile/components/bookmarks/BookmarkList.tsx
index 04a3d922..e7b5e5f2 100644
--- a/apps/mobile/components/bookmarks/BookmarkList.tsx
+++ b/apps/mobile/components/bookmarks/BookmarkList.tsx
@@ -4,18 +4,16 @@ import Animated, { LinearTransition } from "react-native-reanimated";
import { api } from "@/lib/trpc";
import { useScrollToTop } from "@react-navigation/native";
+import type { ZGetBookmarksRequest } from "@hoarder/trpc/types/bookmarks";
+
import FullPageSpinner from "../ui/FullPageSpinner";
import BookmarkCard from "./BookmarkCard";
export default function BookmarkList({
- favourited,
- archived,
- ids,
- header
+ query,
+ header,
}: {
- favourited?: boolean;
- archived?: boolean;
- ids?: string[];
+ query: ZGetBookmarksRequest;
header?: React.ReactElement;
}) {
const apiUtils = api.useUtils();
@@ -23,11 +21,7 @@ export default function BookmarkList({
const flatListRef = useRef(null);
useScrollToTop(flatListRef);
const { data, isPending, isPlaceholderData } =
- api.bookmarks.getBookmarks.useQuery({
- favourited,
- archived,
- ids,
- });
+ api.bookmarks.getBookmarks.useQuery(query);
useEffect(() => {
setRefreshing(isPending || isPlaceholderData);