@@ -2,7 +2,7 @@ import type { FeedViewType } from "@follow/constants"
2
2
import { cn } from "@follow/utils"
3
3
import { Stack } from "expo-router"
4
4
import { Fragment , useCallback , useEffect , useMemo } from "react"
5
- import { FlatList , Image , Linking , Pressable , StyleSheet , Text , View } from "react-native"
5
+ import { FlatList , Image , Share , StyleSheet , Text , TouchableOpacity , View } from "react-native"
6
6
import Animated , { useAnimatedScrollHandler , useSharedValue } from "react-native-reanimated"
7
7
import { useSafeAreaInsets } from "react-native-safe-area-context"
8
8
@@ -51,8 +51,12 @@ export const ProfileScreen = () => {
51
51
const textLabelColor = useColor ( "label" )
52
52
const openShareUrl = useCallback ( ( ) => {
53
53
if ( ! whoami ?. id ) return
54
- Linking . openURL ( `https://app.follow.is/share/users/${ whoami . id } ` )
55
- } , [ whoami ?. id ] )
54
+ Share . share ( {
55
+ url : `https://app.follow.is/share/users/${ whoami . id } ` ,
56
+ title : `Follow | ${ whoami . name } 's Profile` ,
57
+ } )
58
+ } , [ whoami ?. id , whoami ?. name ] )
59
+
56
60
return (
57
61
< View className = "bg-system-grouped-background flex-1" >
58
62
< ReAnimatedScrollView
@@ -68,35 +72,39 @@ export const ProfileScreen = () => {
68
72
{ ! isLoading && subscriptions && < SubscriptionList subscriptions = { subscriptions . data } /> }
69
73
</ ReAnimatedScrollView >
70
74
{ /* Top transparent header buttons */ }
71
- < Pressable
75
+ < TouchableOpacity
72
76
onPress = { ( ) => settingNavigation . goBack ( ) }
73
77
className = "absolute left-4"
74
78
style = { { top : insets . top } }
75
79
>
76
80
< MingcuteLeftLineIcon color = "#fff" />
77
- </ Pressable >
81
+ </ TouchableOpacity >
78
82
79
- < Pressable onPress = { openShareUrl } className = "absolute right-4" style = { { top : insets . top } } >
83
+ < TouchableOpacity
84
+ onPress = { openShareUrl }
85
+ className = "absolute right-4"
86
+ style = { { top : insets . top } }
87
+ >
80
88
< Share3CuteReIcon color = "#fff" />
81
- </ Pressable >
89
+ </ TouchableOpacity >
82
90
{ /* Header */ }
83
91
< Animated . View
84
92
pointerEvents = "none"
85
93
className = "border-b-hairline border-opaque-separator absolute inset-x-0 top-0 flex-row items-center px-4 pb-2 pt-safe"
86
94
style = { { opacity : headerOpacity } }
87
95
>
88
96
< BlurEffect />
89
- < Pressable pointerEvents = "auto" onPress = { ( ) => settingNavigation . goBack ( ) } >
97
+ < TouchableOpacity pointerEvents = "auto" onPress = { ( ) => settingNavigation . goBack ( ) } >
90
98
< MingcuteLeftLineIcon color = { textLabelColor } />
91
- </ Pressable >
99
+ </ TouchableOpacity >
92
100
93
101
< Text className = "text-label flex-1 text-center text-lg font-medium" >
94
102
{ whoami ?. name } 's Profile
95
103
</ Text >
96
104
97
- < Pressable onPress = { openShareUrl } >
105
+ < TouchableOpacity onPress = { openShareUrl } >
98
106
< Share3CuteReIcon color = { textLabelColor } />
99
- </ Pressable >
107
+ </ TouchableOpacity >
100
108
</ Animated . View >
101
109
</ View >
102
110
)
0 commit comments