aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
authorShravya Ramesh <shravs1208@gmail.com>2021-03-09 10:55:25 -0800
committerShravya Ramesh <shravs1208@gmail.com>2021-03-09 10:55:25 -0800
commitc346bec202c011a59a9a5eb8be397d6c99a5044a (patch)
tree225d898e398a41d17207190377d52bfe6b6c6f1d /src/screens
parent4feeedbd9278213bb0298ea4acb47b3c67d7bfb2 (diff)
refactproes, fixed bug
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/suggestedPeople/SPBody.tsx34
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