diff options
author | Ansh <anshnanda10@gmail.com> | 2023-04-25 14:04:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-25 14:04:56 -0700 |
commit | c8a7f27d43dc2ba926fd402a14bdcc35aec433da (patch) | |
tree | 67fc86709a16b43dd3c04b401a5bd0a7aed4b397 /src/view/com/profile/ProfileHeader.tsx | |
parent | 01410ad4bfb5e49aa954ee2e65964a43b1aaf401 (diff) | |
parent | d0d24ea248a74df89c0033a2f63787aaa2f0402d (diff) | |
download | voidsky-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/profile/ProfileHeader.tsx')
-rw-r--r-- | src/view/com/profile/ProfileHeader.tsx | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index e7597608a..c295b2716 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -1,7 +1,6 @@ import React from 'react' import {observer} from 'mobx-react-lite' import { - Share, StyleSheet, TouchableOpacity, TouchableWithoutFeedback, @@ -31,9 +30,9 @@ import {ProfileHeaderLabels} from '../util/moderation/ProfileHeaderLabels' import {usePalette} from 'lib/hooks/usePalette' import {useAnalytics} from 'lib/analytics' import {NavigationProp} from 'lib/routes/types' -import {isAndroid, isDesktopWeb, isIOS} from 'platform/detection' +import {isDesktopWeb} from 'platform/detection' import {FollowState} from 'state/models/cache/my-follows' -import Clipboard from '@react-native-clipboard/clipboard' +import {shareUrl} from 'lib/sharing' const BACK_HITSLOP = {left: 30, top: 30, right: 30, bottom: 30} @@ -152,15 +151,7 @@ const ProfileHeaderLoaded = observer(function ProfileHeaderLoaded({ const onPressShare = React.useCallback(async () => { track('ProfileHeader:ShareButtonClicked') const url = toShareUrl(`/profile/${view.handle}`) - - 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) }, [track, view]) const onPressMuteAccount = React.useCallback(async () => { |