From 2ce42a8978163470b33085bbfd93172ce01a8d69 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Mon, 21 Oct 2024 15:23:46 +0100
Subject: feature(mobile): Use inline WebView for expanding bookmarks

---
 apps/mobile/components/bookmarks/BookmarkCard.tsx | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

(limited to 'apps/mobile/components/bookmarks/BookmarkCard.tsx')

diff --git a/apps/mobile/components/bookmarks/BookmarkCard.tsx b/apps/mobile/components/bookmarks/BookmarkCard.tsx
index 14eb3cf3..5d84ee6f 100644
--- a/apps/mobile/components/bookmarks/BookmarkCard.tsx
+++ b/apps/mobile/components/bookmarks/BookmarkCard.tsx
@@ -9,6 +9,7 @@ import {
   View,
 } from "react-native";
 import * as Haptics from "expo-haptics";
+import { useRouter } from "expo-router";
 import useAppSettings from "@/lib/settings";
 import { api } from "@/lib/trpc";
 import { BottomSheetModal } from "@gorhom/bottom-sheet";
@@ -34,7 +35,6 @@ import BookmarkAssetImage from "./BookmarkAssetImage";
 import BookmarkTextMarkdown from "./BookmarkTextMarkdown";
 import ListPickerModal from "./ListPickerModal";
 import TagPill from "./TagPill";
-import ViewBookmarkModal from "./ViewBookmarkModal";
 
 function ActionBar({ bookmark }: { bookmark: ZBookmark }) {
   const { toast } = useToast();
@@ -341,7 +341,7 @@ export default function BookmarkCard({
     },
   );
 
-  const viewBookmarkModal = useRef<BottomSheetModal>(null);
+  const router = useRouter();
 
   let comp;
   switch (bookmark.content.type) {
@@ -349,7 +349,9 @@ export default function BookmarkCard({
       comp = (
         <LinkCard
           bookmark={bookmark}
-          onOpenBookmark={() => viewBookmarkModal.current?.present()}
+          onOpenBookmark={() =>
+            router.push(`/dashboard/bookmarks/${bookmark.id}`)
+          }
         />
       );
       break;
@@ -357,7 +359,9 @@ export default function BookmarkCard({
       comp = (
         <TextCard
           bookmark={bookmark}
-          onOpenBookmark={() => viewBookmarkModal.current?.present()}
+          onOpenBookmark={() =>
+            router.push(`/dashboard/bookmarks/${bookmark.id}`)
+          }
         />
       );
       break;
@@ -365,7 +369,9 @@ export default function BookmarkCard({
       comp = (
         <AssetCard
           bookmark={bookmark}
-          onOpenBookmark={() => viewBookmarkModal.current?.present()}
+          onOpenBookmark={() =>
+            router.push(`/dashboard/bookmarks/${bookmark.id}`)
+          }
         />
       );
       break;
@@ -373,11 +379,6 @@ export default function BookmarkCard({
 
   return (
     <View className="overflow-hidden rounded-xl border-b border-accent bg-background">
-      <ViewBookmarkModal
-        bookmark={bookmark}
-        ref={viewBookmarkModal}
-        snapPoints={["95%"]}
-      />
       {comp}
     </View>
   );
-- 
cgit v1.2.3-70-g09d2

