diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/profile/Friends.tsx | 67 |
1 files changed, 32 insertions, 35 deletions
diff --git a/src/components/profile/Friends.tsx b/src/components/profile/Friends.tsx index 0f5596d5..51ba6c64 100644 --- a/src/components/profile/Friends.tsx +++ b/src/components/profile/Friends.tsx @@ -86,42 +86,39 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => { return ( <> - {loggedInUser.userId === userId || - (userId === undefined && ( - <View style={styles.subheader}> - <View style={styles.addFriendHeaderContainer}> - <Text style={[styles.subheaderText]}>Add Friends</Text> - <TouchableOpacity - style={styles.findFriendsButton} - onPress={async () => { - const permission = await checkPermission(); - if (permission === 'authorized') { - navigation.navigate('InviteFriendsScreen', { - screenType: ScreenType.Profile, - }); - } else { - Alert.alert( - '"Tagg" Would Like to Access Your Contacts', - 'This helps you quickly get in touch with friends on the app and more', - [ - { - text: "Don't Allow", - style: 'cancel', - }, - {text: 'Allow', onPress: () => Linking.openSettings()}, - ], - ); - } - }}> - <FindFriendsBlueIcon width={20} height={20} /> - <Text style={styles.findFriendsSubheaderText}> - Find Friends - </Text> - </TouchableOpacity> - </View> - <UsersFromContacts /> + {loggedInUser.userId === userId && ( + <View style={styles.subheader}> + <View style={styles.addFriendHeaderContainer}> + <Text style={[styles.subheaderText]}>Add Friends</Text> + <TouchableOpacity + style={styles.findFriendsButton} + onPress={async () => { + const permission = await checkPermission(); + if (permission === 'authorized') { + navigation.navigate('InviteFriendsScreen', { + screenType: ScreenType.Profile, + }); + } else { + Alert.alert( + '"Tagg" Would Like to Access Your Contacts', + 'This helps you quickly get in touch with friends on the app and more', + [ + { + text: "Don't Allow", + style: 'cancel', + }, + {text: 'Allow', onPress: () => Linking.openSettings()}, + ], + ); + } + }}> + <FindFriendsBlueIcon width={20} height={20} /> + <Text style={styles.findFriendsSubheaderText}>Find Friends</Text> + </TouchableOpacity> </View> - ))} + <UsersFromContacts /> + </View> + )} <Text style={[styles.subheaderText, styles.friendsSubheaderText]}> Friends </Text> |