about summary refs log tree commit diff
path: root/src/view/com/util/forms/DropdownButton.tsx
diff options
context:
space:
mode:
authorAnsh <anshnanda10@gmail.com>2023-04-25 14:04:56 -0700
committerGitHub <noreply@github.com>2023-04-25 14:04:56 -0700
commitc8a7f27d43dc2ba926fd402a14bdcc35aec433da (patch)
tree67fc86709a16b43dd3c04b401a5bd0a7aed4b397 /src/view/com/util/forms/DropdownButton.tsx
parent01410ad4bfb5e49aa954ee2e65964a43b1aaf401 (diff)
parentd0d24ea248a74df89c0033a2f63787aaa2f0402d (diff)
downloadvoidsky-c8a7f27d43dc2ba926fd402a14bdcc35aec433da.tar.zst
Merge pull request #536 from bluesky-social/ansh/app-558-share-profile-and-post-broken-on-android
[APP-558] Sharing refactor
Diffstat (limited to 'src/view/com/util/forms/DropdownButton.tsx')
-rw-r--r--src/view/com/util/forms/DropdownButton.tsx15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/view/com/util/forms/DropdownButton.tsx b/src/view/com/util/forms/DropdownButton.tsx
index fcb209005..725d45c1b 100644
--- a/src/view/com/util/forms/DropdownButton.tsx
+++ b/src/view/com/util/forms/DropdownButton.tsx
@@ -1,7 +1,6 @@
 import React, {useRef} from 'react'
 import {
   Dimensions,
-  Share,
   StyleProp,
   StyleSheet,
   TouchableOpacity,
@@ -19,10 +18,8 @@ import {toShareUrl} from 'lib/strings/url-helpers'
 import {useStores} from 'state/index'
 import {usePalette} from 'lib/hooks/usePalette'
 import {useTheme} from 'lib/ThemeContext'
-import {isAndroid, isIOS} from 'platform/detection'
-import Clipboard from '@react-native-clipboard/clipboard'
-import * as Toast from '../../util/Toast'
 import {isWeb} from 'platform/detection'
+import {shareUrl} from 'lib/sharing'
 
 const HITSLOP = {left: 10, top: 10, right: 10, bottom: 10}
 const ESTIMATED_BTN_HEIGHT = 50
@@ -182,15 +179,7 @@ export function PostDropdownBtn({
       label: 'Share...',
       onPress() {
         const url = toShareUrl(itemHref)
-
-        if (isIOS || isAndroid) {
-          Share.share({url})
-        } else {
-          // React Native Share is not supported by web. Web Share API
-          // has increasing but not full support, so default to clipboard
-          Clipboard.setString(url)
-          Toast.show('Copied to clipboard')
-        }
+        shareUrl(url)
       },
     },
     {sep: true},