Skip to content

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

feat(mobile): add copy to clipboard functionality

daniel31x13a77c5c20cd79
diff --git a/apps/mobile/components/LinkListing.tsx b/apps/mobile/components/LinkListing.tsx
index 126a84ab..f891e3ac 100644
--- a/apps/mobile/components/LinkListing.tsx
+++ b/apps/mobile/components/LinkListing.tsx
@@ -12,6 +12,7 @@ import { useRouter } from "expo-router";
import * as ContextMenu from "zeego/context-menu";
import { useDeleteLink } from "@linkwarden/router/links";
import { SheetManager } from "react-native-actions-sheet";
+import * as Clipboard from "expo-clipboard";
type Props = {
link: LinkIncludingShortenedCollectionAndTags;
@@ -113,8 +114,8 @@ const LinkListing = ({ link }: Props) => {
{link.url && (
<ContextMenu.Item
key="copy-url"
- onSelect={() => {
- /* copy URL */
+ onSelect={async () => {
+ await Clipboard.setStringAsync(link.url as string);
}}
>
<ContextMenu.ItemTitle>Copy URL</ContextMenu.ItemTitle>
diff --git a/apps/mobile/ios/Podfile.lock b/apps/mobile/ios/Podfile.lock
index fbf33263..c519fdce 100644
--- a/apps/mobile/ios/Podfile.lock
+++ b/apps/mobile/ios/Podfile.lock
@@ -224,6 +224,8 @@ PODS:
- ExpoModulesCore
- ExpoBlur (14.0.3):
- ExpoModulesCore
+ - ExpoClipboard (7.0.1):
+ - ExpoModulesCore
- ExpoFileSystem (18.0.12):
- ExpoModulesCore
- ExpoFont (13.0.4):
@@ -2177,6 +2179,7 @@ DEPENDENCIES:
- expo-dev-menu-interface (from `../../../node_modules/expo-dev-menu-interface/ios`)
- ExpoAsset (from `../../../node_modules/expo-asset/ios`)
- ExpoBlur (from `../../../node_modules/expo-blur/ios`)
+ - ExpoClipboard (from `../../../node_modules/expo-clipboard/ios`)
- ExpoFileSystem (from `../../../node_modules/expo-file-system/ios`)
- ExpoFont (from `../../../node_modules/expo-font/ios`)
- ExpoHaptics (from `../../../node_modules/expo-haptics/ios`)
@@ -2297,6 +2300,8 @@ EXTERNAL SOURCES:
:path: "../../../node_modules/expo-asset/ios"
ExpoBlur:
:path: "../../../node_modules/expo-blur/ios"
+ ExpoClipboard:
+ :path: "../../../node_modules/expo-clipboard/ios"
ExpoFileSystem:
:path: "../../../node_modules/expo-file-system/ios"
ExpoFont:
@@ -2485,6 +2490,7 @@ SPEC CHECKSUMS:
expo-dev-menu-interface: 00dc42302a72722fdecec3fa048de84a9133bcc4
ExpoAsset: 0687fe05f5d051c4a34dd1f9440bd00858413cfe
ExpoBlur: 567af66164e3043a9a30069594aed1ddf0a88d97
+ ExpoClipboard: 5250b207b6d545f4e9aac5ea3c6e61c4f16d0aed
ExpoFileSystem: c8c19bf80d914c83dda3beb8569d7fb603be0970
ExpoFont: 773955186469acc5108ff569712a2d243857475f
ExpoHaptics: e01cce0741d68c281853118eb0267f88d42c6b7a
diff --git a/apps/mobile/package.json b/apps/mobile/package.json
index affd799b..55cb68cf 100644
--- a/apps/mobile/package.json
+++ b/apps/mobile/package.json
@@ -26,8 +26,10 @@
"@react-navigation/native": "^7.0.0",
"@tanstack/react-query": "^5.51.15",
"@tanstack/react-query-persist-client": "^5.51.15",
+ "class-variance-authority": "^0.7.1",
"expo": "~52.0.18",
"expo-blur": "~14.0.1",
+ "expo-clipboard": "~7.0.1",
"expo-constants": "~17.0.3",
"expo-dev-client": "~5.0.6",
"expo-file-system": "~18.0.12",
@@ -45,7 +47,6 @@
"nativewind": "^4.1.23",
"react": "18.3.1",
"react-dom": "18.3.1",
- "class-variance-authority": "^0.7.1",
"react-native": "0.76.9",
"react-native-actions-sheet": "^0.9.7",
"react-native-gesture-handler": "~2.20.2",
diff --git a/yarn.lock b/yarn.lock
index 4a5d1bb1..59271655 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7126,6 +7126,11 @@ expo-blur@~14.0.1:
resolved "https://registry.yarnpkg.com/expo-blur/-/expo-blur-14.0.3.tgz#656d6b2442bfbbfb2a6608c6bc1151b29bce6698"
integrity sha512-BL3xnqBJbYm3Hg9t/HjNjdeY7N/q8eK5tsLYxswWG1yElISWZmMvrXYekl7XaVCPfyFyz8vQeaxd7q74ZY3Wrw==
+expo-clipboard@~7.0.1:
+ version "7.0.1"
+ resolved "https://registry.yarnpkg.com/expo-clipboard/-/expo-clipboard-7.0.1.tgz#31d61270e77a37d2a6b7ae9abf79e060497ef43b"
+ integrity sha512-rqYk0+WoqitPcPKxmMxSpLonX1E5Ije3LBYfnYMbH3xU5Gr8EAH9QnOWOi4BgahUPvcot6nbFEnx+DqARrmxKQ==
+
expo-constants@~17.0.3, expo-constants@~17.0.5, expo-constants@~17.0.8:
version "17.0.8"
resolved "https://registry.yarnpkg.com/expo-constants/-/expo-constants-17.0.8.tgz#d7a21ec6f1f4834ea25aa645be20292ef99c0b81"