diff options
Diffstat (limited to 'src/screens')
-rw-r--r-- | src/screens/suggestedPeople/SPBody.tsx | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/screens/suggestedPeople/SPBody.tsx b/src/screens/suggestedPeople/SPBody.tsx index b7943cbc..89eaaa25 100644 --- a/src/screens/suggestedPeople/SPBody.tsx +++ b/src/screens/suggestedPeople/SPBody.tsx @@ -66,7 +66,7 @@ const SPBody: React.FC<SPBodyProps> = ({ : console.log('NO BADGES FOUND'); }, []); - const displayFriendButton = () => { + const FriendButton = () => { switch (friendship.status) { case 'friends': return <Fragment />; @@ -116,29 +116,35 @@ const SPBody: React.FC<SPBodyProps> = ({ [suggested_people_url], ); + const NamePlate = () => { + return ( + <TouchableOpacity + onPress={() => { + navigation.push('Profile', { + userXId: user.id, + screenType, + }); + }} + style={styles.nameInfoContainer}> + <Text style={styles.firstName}>{user.first_name}</Text> + <Text style={styles.username}>@{user.username}</Text> + </TouchableOpacity> + ); + }; + return ( <View> {backgroundImage} <View style={styles.mainContainer}> <View style={styles.topContainer}> <Text style={styles.title}>{firstItem && 'Suggested People'}</Text> - {<BadgesDropdown localBadges={localBadges} />} + <BadgesDropdown localBadges={localBadges} /> </View> <View style={styles.body}> <View style={styles.marginManager}> <View style={styles.addUserContainer}> - <TouchableOpacity - onPress={() => { - navigation.push('Profile', { - userXId: user.id, - screenType, - }); - }} - style={styles.nameInfoContainer}> - <Text style={styles.firstName}>{user.first_name}</Text> - <Text style={styles.username}>@{user.username}</Text> - </TouchableOpacity> - {user.id !== loggedInUserId && displayFriendButton()} + <NamePlate /> + {user.id !== loggedInUserId && <FriendButton />} </View> </View> <TaggsBar |