aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/mobile')
-rw-r--r--apps/mobile/app/dashboard/(tabs)/index.tsx4
-rw-r--r--apps/mobile/app/dashboard/(tabs)/search.tsx2
-rw-r--r--apps/mobile/app/dashboard/archive.tsx2
-rw-r--r--apps/mobile/app/dashboard/favourites.tsx6
-rw-r--r--apps/mobile/app/dashboard/lists/[slug].tsx6
-rw-r--r--apps/mobile/app/dashboard/tags/[slug].tsx6
-rw-r--r--apps/mobile/components/bookmarks/BookmarkList.tsx18
7 files changed, 22 insertions, 22 deletions
diff --git a/apps/mobile/app/dashboard/(tabs)/index.tsx b/apps/mobile/app/dashboard/(tabs)/index.tsx
index 1a17d472..7f70af6b 100644
--- a/apps/mobile/app/dashboard/(tabs)/index.tsx
+++ b/apps/mobile/app/dashboard/(tabs)/index.tsx
@@ -2,9 +2,9 @@ import { Platform, SafeAreaView, View } from "react-native";
import * as Haptics from "expo-haptics";
import { useRouter } from "expo-router";
import BookmarkList from "@/components/bookmarks/BookmarkList";
+import PageTitle from "@/components/ui/PageTitle";
import { MenuView } from "@react-native-menu/menu";
import { SquarePen } from "lucide-react-native";
-import PageTitle from "@/components/ui/PageTitle";
function HeaderRight() {
const router = useRouter();
@@ -49,7 +49,7 @@ export default function Home() {
return (
<SafeAreaView>
<BookmarkList
- archived={false}
+ query={{ archived: false }}
header={
<View className="flex flex-row justify-between">
<PageTitle title="Home" />
diff --git a/apps/mobile/app/dashboard/(tabs)/search.tsx b/apps/mobile/app/dashboard/(tabs)/search.tsx
index 76e9aef9..25fc53d5 100644
--- a/apps/mobile/app/dashboard/(tabs)/search.tsx
+++ b/apps/mobile/app/dashboard/(tabs)/search.tsx
@@ -21,7 +21,7 @@ export default function Search() {
<SafeAreaView>
{data && (
<BookmarkList
- ids={data.bookmarks.map((b) => b.id)}
+ query={{ids: data.bookmarks.map((b) => b.id)}}
header={
<View>
<PageTitle title="Search" />
diff --git a/apps/mobile/app/dashboard/archive.tsx b/apps/mobile/app/dashboard/archive.tsx
index 5c86c6fc..98a03631 100644
--- a/apps/mobile/app/dashboard/archive.tsx
+++ b/apps/mobile/app/dashboard/archive.tsx
@@ -5,7 +5,7 @@ import PageTitle from "@/components/ui/PageTitle";
export default function Archive() {
return (
<SafeAreaView>
- <BookmarkList archived header={<PageTitle title="🗄️ Archive" />} />
+ <BookmarkList query={{archived: true}} header={<PageTitle title="🗄️ Archive" />} />
</SafeAreaView>
);
}
diff --git a/apps/mobile/app/dashboard/favourites.tsx b/apps/mobile/app/dashboard/favourites.tsx
index 6025d514..f62d561e 100644
--- a/apps/mobile/app/dashboard/favourites.tsx
+++ b/apps/mobile/app/dashboard/favourites.tsx
@@ -6,8 +6,10 @@ export default function Favourites() {
return (
<SafeAreaView>
<BookmarkList
- archived={false}
- favourited
+ query={{
+ archived: false,
+ favourited: true,
+ }}
header={<PageTitle title="⭐️ Favourites" />}
/>
</SafeAreaView>
diff --git a/apps/mobile/app/dashboard/lists/[slug].tsx b/apps/mobile/app/dashboard/lists/[slug].tsx
index 0d1c01dc..8596b49f 100644
--- a/apps/mobile/app/dashboard/lists/[slug].tsx
+++ b/apps/mobile/app/dashboard/lists/[slug].tsx
@@ -24,8 +24,10 @@ export default function ListView() {
{list ? (
<View>
<BookmarkList
- archived={false}
- ids={list.bookmarks}
+ query={{
+ archived: false,
+ listId: list.id,
+ }}
header={<PageTitle title={`${list.icon} ${list.name}`} />}
/>
</View>
diff --git a/apps/mobile/app/dashboard/tags/[slug].tsx b/apps/mobile/app/dashboard/tags/[slug].tsx
index 2d37b172..cb6e2ef4 100644
--- a/apps/mobile/app/dashboard/tags/[slug].tsx
+++ b/apps/mobile/app/dashboard/tags/[slug].tsx
@@ -25,8 +25,10 @@ export default function TagView() {
{tag ? (
<View>
<BookmarkList
- archived={false}
- ids={tag.bookmarks}
+ query={{
+ archived: false,
+ tagId: tag.id,
+ }}
header={<PageTitle title={tag.name} />}
/>
</View>
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);