aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/components/highlights
diff options
context:
space:
mode:
Diffstat (limited to 'apps/mobile/components/highlights')
-rw-r--r--apps/mobile/components/highlights/HighlightCard.tsx20
1 files changed, 12 insertions, 8 deletions
diff --git a/apps/mobile/components/highlights/HighlightCard.tsx b/apps/mobile/components/highlights/HighlightCard.tsx
index 7e0b4a2b..c8f97e32 100644
--- a/apps/mobile/components/highlights/HighlightCard.tsx
+++ b/apps/mobile/components/highlights/HighlightCard.tsx
@@ -2,7 +2,8 @@ import { ActivityIndicator, Alert, Pressable, View } from "react-native";
import * as Haptics from "expo-haptics";
import { useRouter } from "expo-router";
import { Text } from "@/components/ui/Text";
-import { api } from "@/lib/trpc";
+import { useTRPC } from "@/lib/trpc";
+import { useQuery } from "@tanstack/react-query";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
import { ExternalLink, Trash2 } from "lucide-react-native";
@@ -29,6 +30,7 @@ export default function HighlightCard({
}) {
const { toast } = useToast();
const router = useRouter();
+ const api = useTRPC();
const onError = () => {
toast({
@@ -64,13 +66,15 @@ export default function HighlightCard({
],
);
- const { data: bookmark } = api.bookmarks.getBookmark.useQuery(
- {
- bookmarkId: highlight.bookmarkId,
- },
- {
- retry: false,
- },
+ const { data: bookmark } = useQuery(
+ api.bookmarks.getBookmark.queryOptions(
+ {
+ bookmarkId: highlight.bookmarkId,
+ },
+ {
+ retry: false,
+ },
+ ),
);
const handleBookmarkPress = () => {