aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2026-02-01 12:37:34 +0000
committerMohamed Bassem <me@mbassem.com>2026-02-01 12:37:34 +0000
commit15d9d9897487d5e1881f75a4d92af37f6937eb80 (patch)
treeea59e57c45d5f9f2ae6aa871749e59555d3d2d6b /apps/mobile
parent65f6e83f11c82b0ec762e11f3392a80e614ee69a (diff)
downloadkarakeep-15d9d9897487d5e1881f75a4d92af37f6937eb80.tar.zst
refactor: remove unused trpc files from web and mobile
Diffstat (limited to 'apps/mobile')
-rw-r--r--apps/mobile/app/dashboard/(tabs)/lists.tsx2
-rw-r--r--apps/mobile/app/dashboard/(tabs)/settings.tsx3
-rw-r--r--apps/mobile/app/dashboard/(tabs)/tags.tsx2
-rw-r--r--apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx2
-rw-r--r--apps/mobile/app/dashboard/lists/[slug]/edit.tsx2
-rw-r--r--apps/mobile/app/dashboard/lists/[slug]/index.tsx2
-rw-r--r--apps/mobile/app/dashboard/search.tsx2
-rw-r--r--apps/mobile/app/dashboard/tags/[slug].tsx3
-rw-r--r--apps/mobile/app/sharing.tsx2
-rw-r--r--apps/mobile/app/signin.tsx3
-rw-r--r--apps/mobile/components/bookmarks/BookmarkCard.tsx2
-rw-r--r--apps/mobile/components/bookmarks/BookmarkLinkPreview.tsx2
-rw-r--r--apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx2
-rw-r--r--apps/mobile/components/highlights/HighlightCard.tsx2
-rw-r--r--apps/mobile/lib/session.ts3
-rw-r--r--apps/mobile/lib/trpc.ts3
-rw-r--r--apps/mobile/lib/upload.ts2
17 files changed, 20 insertions, 19 deletions
diff --git a/apps/mobile/app/dashboard/(tabs)/lists.tsx b/apps/mobile/app/dashboard/(tabs)/lists.tsx
index 5719c67c..a5d4ebc8 100644
--- a/apps/mobile/app/dashboard/(tabs)/lists.tsx
+++ b/apps/mobile/app/dashboard/(tabs)/lists.tsx
@@ -8,13 +8,13 @@ import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
import FullPageSpinner from "@/components/ui/FullPageSpinner";
import PageTitle from "@/components/ui/PageTitle";
import { Text } from "@/components/ui/Text";
-import { useTRPC } from "@/lib/trpc";
import { useColorScheme } from "@/lib/useColorScheme";
import { condProps } from "@/lib/utils";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { Plus } from "lucide-react-native";
import { useBookmarkLists } from "@karakeep/shared-react/hooks/lists";
+import { useTRPC } from "@karakeep/shared-react/trpc";
import { ZBookmarkListTreeNode } from "@karakeep/shared/utils/listUtils";
function HeaderRight({ openNewListModal }: { openNewListModal: () => void }) {
diff --git a/apps/mobile/app/dashboard/(tabs)/settings.tsx b/apps/mobile/app/dashboard/(tabs)/settings.tsx
index 2610aa37..079afab2 100644
--- a/apps/mobile/app/dashboard/(tabs)/settings.tsx
+++ b/apps/mobile/app/dashboard/(tabs)/settings.tsx
@@ -13,9 +13,10 @@ import { Text } from "@/components/ui/Text";
import { useServerVersion } from "@/lib/hooks";
import { useSession } from "@/lib/session";
import useAppSettings from "@/lib/settings";
-import { useTRPC } from "@/lib/trpc";
import { useQuery } from "@tanstack/react-query";
+import { useTRPC } from "@karakeep/shared-react/trpc";
+
export default function Dashboard() {
const { logout } = useSession();
const {
diff --git a/apps/mobile/app/dashboard/(tabs)/tags.tsx b/apps/mobile/app/dashboard/(tabs)/tags.tsx
index 470ff3f3..b05095ac 100644
--- a/apps/mobile/app/dashboard/(tabs)/tags.tsx
+++ b/apps/mobile/app/dashboard/(tabs)/tags.tsx
@@ -8,11 +8,11 @@ import FullPageSpinner from "@/components/ui/FullPageSpinner";
import PageTitle from "@/components/ui/PageTitle";
import { SearchInput } from "@/components/ui/SearchInput";
import { Text } from "@/components/ui/Text";
-import { useTRPC } from "@/lib/trpc";
import { useQueryClient } from "@tanstack/react-query";
import { usePaginatedSearchTags } from "@karakeep/shared-react/hooks/tags";
import { useDebounce } from "@karakeep/shared-react/hooks/use-debounce";
+import { useTRPC } from "@karakeep/shared-react/trpc";
interface TagItem {
id: string;
diff --git a/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx b/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx
index 567ac605..efb82b1e 100644
--- a/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx
+++ b/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx
@@ -12,11 +12,11 @@ import BottomActions from "@/components/bookmarks/BottomActions";
import FullPageError from "@/components/FullPageError";
import FullPageSpinner from "@/components/ui/FullPageSpinner";
import useAppSettings from "@/lib/settings";
-import { useTRPC } from "@/lib/trpc";
import { useQuery } from "@tanstack/react-query";
import { Settings } from "lucide-react-native";
import { useColorScheme } from "nativewind";
+import { useTRPC } from "@karakeep/shared-react/trpc";
import { BookmarkTypes } from "@karakeep/shared/types/bookmarks";
export default function BookmarkView() {
diff --git a/apps/mobile/app/dashboard/lists/[slug]/edit.tsx b/apps/mobile/app/dashboard/lists/[slug]/edit.tsx
index e0654722..c1103b4d 100644
--- a/apps/mobile/app/dashboard/lists/[slug]/edit.tsx
+++ b/apps/mobile/app/dashboard/lists/[slug]/edit.tsx
@@ -7,10 +7,10 @@ import FullPageSpinner from "@/components/ui/FullPageSpinner";
import { Input } from "@/components/ui/Input";
import { Text } from "@/components/ui/Text";
import { useToast } from "@/components/ui/Toast";
-import { useTRPC } from "@/lib/trpc";
import { useQuery } from "@tanstack/react-query";
import { useEditBookmarkList } from "@karakeep/shared-react/hooks/lists";
+import { useTRPC } from "@karakeep/shared-react/trpc";
const EditListPage = () => {
const { slug: listId } = useLocalSearchParams<{ slug?: string | string[] }>();
diff --git a/apps/mobile/app/dashboard/lists/[slug]/index.tsx b/apps/mobile/app/dashboard/lists/[slug]/index.tsx
index 97f797c6..763df65e 100644
--- a/apps/mobile/app/dashboard/lists/[slug]/index.tsx
+++ b/apps/mobile/app/dashboard/lists/[slug]/index.tsx
@@ -5,11 +5,11 @@ import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
import FullPageError from "@/components/FullPageError";
import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
import FullPageSpinner from "@/components/ui/FullPageSpinner";
-import { useTRPC } from "@/lib/trpc";
import { MenuView } from "@react-native-menu/menu";
import { useMutation, useQuery } from "@tanstack/react-query";
import { Ellipsis } from "lucide-react-native";
+import { useTRPC } from "@karakeep/shared-react/trpc";
import { ZBookmarkList } from "@karakeep/shared/types/lists";
export default function ListView() {
diff --git a/apps/mobile/app/dashboard/search.tsx b/apps/mobile/app/dashboard/search.tsx
index 0e59c607..d43f1aef 100644
--- a/apps/mobile/app/dashboard/search.tsx
+++ b/apps/mobile/app/dashboard/search.tsx
@@ -7,7 +7,6 @@ import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
import FullPageSpinner from "@/components/ui/FullPageSpinner";
import { SearchInput } from "@/components/ui/SearchInput";
import { Text } from "@/components/ui/Text";
-import { useTRPC } from "@/lib/trpc";
import AsyncStorage from "@react-native-async-storage/async-storage";
import {
keepPreviousData,
@@ -17,6 +16,7 @@ import {
import { useSearchHistory } from "@karakeep/shared-react/hooks/search-history";
import { useDebounce } from "@karakeep/shared-react/hooks/use-debounce";
+import { useTRPC } from "@karakeep/shared-react/trpc";
const MAX_DISPLAY_SUGGESTIONS = 5;
diff --git a/apps/mobile/app/dashboard/tags/[slug].tsx b/apps/mobile/app/dashboard/tags/[slug].tsx
index 170cb04d..328c65d0 100644
--- a/apps/mobile/app/dashboard/tags/[slug].tsx
+++ b/apps/mobile/app/dashboard/tags/[slug].tsx
@@ -4,9 +4,10 @@ import UpdatingBookmarkList from "@/components/bookmarks/UpdatingBookmarkList";
import FullPageError from "@/components/FullPageError";
import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView";
import FullPageSpinner from "@/components/ui/FullPageSpinner";
-import { useTRPC } from "@/lib/trpc";
import { useQuery } from "@tanstack/react-query";
+import { useTRPC } from "@karakeep/shared-react/trpc";
+
export default function TagView() {
const { slug } = useLocalSearchParams();
const api = useTRPC();
diff --git a/apps/mobile/app/sharing.tsx b/apps/mobile/app/sharing.tsx
index 6d9167db..25c9d793 100644
--- a/apps/mobile/app/sharing.tsx
+++ b/apps/mobile/app/sharing.tsx
@@ -5,11 +5,11 @@ import { useShareIntentContext } from "expo-share-intent";
import { Button } from "@/components/ui/Button";
import { Text } from "@/components/ui/Text";
import useAppSettings from "@/lib/settings";
-import { useTRPC } from "@/lib/trpc";
import { useUploadAsset } from "@/lib/upload";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { z } from "zod";
+import { useTRPC } from "@karakeep/shared-react/trpc";
import { BookmarkTypes, ZBookmark } from "@karakeep/shared/types/bookmarks";
type Mode =
diff --git a/apps/mobile/app/signin.tsx b/apps/mobile/app/signin.tsx
index 5c6370ca..00295cf4 100644
--- a/apps/mobile/app/signin.tsx
+++ b/apps/mobile/app/signin.tsx
@@ -13,10 +13,11 @@ import { Button } from "@/components/ui/Button";
import { Input } from "@/components/ui/Input";
import { Text } from "@/components/ui/Text";
import useAppSettings from "@/lib/settings";
-import { useTRPC } from "@/lib/trpc";
import { useMutation } from "@tanstack/react-query";
import { Bug, Edit3 } from "lucide-react-native";
+import { useTRPC } from "@karakeep/shared-react/trpc";
+
enum LoginType {
Password,
ApiKey,
diff --git a/apps/mobile/components/bookmarks/BookmarkCard.tsx b/apps/mobile/components/bookmarks/BookmarkCard.tsx
index 38fed737..41e57f89 100644
--- a/apps/mobile/components/bookmarks/BookmarkCard.tsx
+++ b/apps/mobile/components/bookmarks/BookmarkCard.tsx
@@ -15,7 +15,6 @@ import { router, useRouter } from "expo-router";
import * as Sharing from "expo-sharing";
import { Text } from "@/components/ui/Text";
import useAppSettings from "@/lib/settings";
-import { useTRPC } from "@/lib/trpc";
import { buildApiHeaders } from "@/lib/utils";
import { MenuView } from "@react-native-menu/menu";
import { useQuery } from "@tanstack/react-query";
@@ -27,6 +26,7 @@ import {
useUpdateBookmark,
} from "@karakeep/shared-react/hooks/bookmarks";
import { useWhoAmI } from "@karakeep/shared-react/hooks/users";
+import { useTRPC } from "@karakeep/shared-react/trpc";
import { BookmarkTypes } from "@karakeep/shared/types/bookmarks";
import {
getBookmarkLinkImageUrl,
diff --git a/apps/mobile/components/bookmarks/BookmarkLinkPreview.tsx b/apps/mobile/components/bookmarks/BookmarkLinkPreview.tsx
index aa073c69..fe27836a 100644
--- a/apps/mobile/components/bookmarks/BookmarkLinkPreview.tsx
+++ b/apps/mobile/components/bookmarks/BookmarkLinkPreview.tsx
@@ -6,10 +6,10 @@ import { WebViewSourceUri } from "react-native-webview/lib/WebViewTypes";
import { Text } from "@/components/ui/Text";
import { useAssetUrl } from "@/lib/hooks";
import { useReaderSettings, WEBVIEW_FONT_FAMILIES } from "@/lib/readerSettings";
-import { useTRPC } from "@/lib/trpc";
import { useColorScheme } from "@/lib/useColorScheme";
import { useQuery } from "@tanstack/react-query";
+import { useTRPC } from "@karakeep/shared-react/trpc";
import { BookmarkTypes, ZBookmark } from "@karakeep/shared/types/bookmarks";
import FullPageError from "../FullPageError";
diff --git a/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx b/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx
index b5aeaa40..25be7c2d 100644
--- a/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx
+++ b/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx
@@ -1,7 +1,7 @@
-import { useTRPC } from "@/lib/trpc";
import { useInfiniteQuery, useQueryClient } from "@tanstack/react-query";
import type { ZGetBookmarksRequest } from "@karakeep/shared/types/bookmarks";
+import { useTRPC } from "@karakeep/shared-react/trpc";
import { BookmarkTypes } from "@karakeep/shared/types/bookmarks";
import FullPageError from "../FullPageError";
diff --git a/apps/mobile/components/highlights/HighlightCard.tsx b/apps/mobile/components/highlights/HighlightCard.tsx
index c8f97e32..fd5ff752 100644
--- a/apps/mobile/components/highlights/HighlightCard.tsx
+++ b/apps/mobile/components/highlights/HighlightCard.tsx
@@ -2,7 +2,6 @@ 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 { useTRPC } from "@/lib/trpc";
import { useQuery } from "@tanstack/react-query";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
@@ -10,6 +9,7 @@ import { ExternalLink, Trash2 } from "lucide-react-native";
import type { ZHighlight } from "@karakeep/shared/types/highlights";
import { useDeleteHighlight } from "@karakeep/shared-react/hooks/highlights";
+import { useTRPC } from "@karakeep/shared-react/trpc";
import { useToast } from "../ui/Toast";
diff --git a/apps/mobile/lib/session.ts b/apps/mobile/lib/session.ts
index 9f539693..d6470145 100644
--- a/apps/mobile/lib/session.ts
+++ b/apps/mobile/lib/session.ts
@@ -1,8 +1,9 @@
import { useCallback } from "react";
import { useMutation } from "@tanstack/react-query";
+import { useTRPC } from "@karakeep/shared-react/trpc";
+
import useAppSettings from "./settings";
-import { useTRPC } from "./trpc";
export function useSession() {
const { settings, setSettings } = useAppSettings();
diff --git a/apps/mobile/lib/trpc.ts b/apps/mobile/lib/trpc.ts
deleted file mode 100644
index 915c265d..00000000
--- a/apps/mobile/lib/trpc.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-// Re-export from shared-react to ensure there's only one TRPCProvider context
-// This is necessary because the hooks in shared-react use useTRPC from shared-react
-export { TRPCProvider, useTRPC } from "@karakeep/shared-react/trpc";
diff --git a/apps/mobile/lib/upload.ts b/apps/mobile/lib/upload.ts
index 13abae16..2f323ddb 100644
--- a/apps/mobile/lib/upload.ts
+++ b/apps/mobile/lib/upload.ts
@@ -1,6 +1,7 @@
import ReactNativeBlobUtil from "react-native-blob-util";
import { useMutation, useQueryClient } from "@tanstack/react-query";
+import { useTRPC } from "@karakeep/shared-react/trpc";
import { BookmarkTypes, ZBookmark } from "@karakeep/shared/types/bookmarks";
import {
zUploadErrorSchema,
@@ -8,7 +9,6 @@ import {
} from "@karakeep/shared/types/uploads";
import type { Settings } from "./settings";
-import { useTRPC } from "./trpc";
import { buildApiHeaders } from "./utils";
export function useUploadAsset(