aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Friends.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/profile/Friends.tsx')
-rw-r--r--src/components/profile/Friends.tsx37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/components/profile/Friends.tsx b/src/components/profile/Friends.tsx
index a1030b49..36e0ef8a 100644
--- a/src/components/profile/Friends.tsx
+++ b/src/components/profile/Friends.tsx
@@ -98,22 +98,27 @@ const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => {
return (
<>
- <View style={styles.subheader}>
- <View style={styles.addFriendHeaderContainer}>
- <Text style={[styles.subheaderText]}>Add Friends</Text>
- <TouchableOpacity
- style={{flexDirection: 'row'}}
- onPress={() =>
- navigation.navigate('InviteFriendsScreen', {
- screenType: ScreenType.Profile,
- })
- }>
- <FindFriendsBlueIcon width={20} height={20} />
- <Text style={styles.findFriendsSubheaderText}>Find Friends</Text>
- </TouchableOpacity>
- </View>
- <UsersFromContacts />
- </View>
+ {loggedInUser.userId === userId ||
+ (userId === undefined && (
+ <View style={styles.subheader}>
+ <View style={styles.addFriendHeaderContainer}>
+ <Text style={[styles.subheaderText]}>Add Friends</Text>
+ <TouchableOpacity
+ style={{flexDirection: 'row'}}
+ onPress={() =>
+ navigation.navigate('InviteFriendsScreen', {
+ screenType: ScreenType.Profile,
+ })
+ }>
+ <FindFriendsBlueIcon width={20} height={20} />
+ <Text style={styles.findFriendsSubheaderText}>
+ Find Friends
+ </Text>
+ </TouchableOpacity>
+ </View>
+ <UsersFromContacts />
+ </View>
+ ))}
<Text style={[styles.subheaderText, styles.friendsSubheaderText]}>
Friends
</Text>