Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

feat(mobile): add open in browser option to context menu

daniel31x139af731c7ebd3
diff --git a/apps/mobile/components/LinkListing.tsx b/apps/mobile/components/LinkListing.tsx
index 2b08dfe8..804edae7 100644
--- a/apps/mobile/components/LinkListing.tsx
+++ b/apps/mobile/components/LinkListing.tsx
@@ -6,6 +6,7 @@ import {
Platform,
Alert,
ActivityIndicator,
+ Linking,
} from "react-native";
import { decode } from "html-entities";
import { LinkIncludingShortenedCollectionAndTags } from "@linkwarden/types";
@@ -157,21 +158,29 @@ const LinkListing = ({ link, dashboard }: Props) => {
<ContextMenu.Content avoidCollisions>
<ContextMenu.Item
- key="open-link"
+ key="open-in-app"
onSelect={() => router.navigate(`/links/${link.id}`)}
>
<ContextMenu.ItemTitle>Open Link</ContextMenu.ItemTitle>
</ContextMenu.Item>
- {link.url && (
- <ContextMenu.Item
- key="copy-url"
- onSelect={async () => {
- await Clipboard.setStringAsync(link.url as string);
- }}
- >
- <ContextMenu.ItemTitle>Copy URL</ContextMenu.ItemTitle>
- </ContextMenu.Item>
+ {link?.url && (
+ <>
+ <ContextMenu.Item
+ key="open-in-browser"
+ onSelect={() => Linking.openURL(link.url as string)}
+ >
+ <ContextMenu.ItemTitle>Open in Browser</ContextMenu.ItemTitle>
+ </ContextMenu.Item>
+ <ContextMenu.Item
+ key="copy-url"
+ onSelect={async () => {
+ await Clipboard.setStringAsync(link.url as string);
+ }}
+ >
+ <ContextMenu.ItemTitle>Copy URL</ContextMenu.ItemTitle>
+ </ContextMenu.Item>
+ </>
)}
<ContextMenu.Item