diff options
Diffstat (limited to 'src/screens')
| -rw-r--r-- | src/screens/suggestedPeople/SPBody.tsx | 55 | 
1 files changed, 25 insertions, 30 deletions
| diff --git a/src/screens/suggestedPeople/SPBody.tsx b/src/screens/suggestedPeople/SPBody.tsx index 3d7cf3f2..eb80da49 100644 --- a/src/screens/suggestedPeople/SPBody.tsx +++ b/src/screens/suggestedPeople/SPBody.tsx @@ -115,20 +115,30 @@ const SPBody: React.FC<SPBodyProps> = ({      [suggested_people_url],    ); -  const NamePlate = () => { -    return ( -      <TouchableOpacity -        onPress={() => { -          navigation.navigate('Profile', { -            userXId: loggedInUserId === user.id ? undefined : user.id, -            screenType, -          }); -        }}> -        <Text style={styles.firstName}>{user.first_name}</Text> -        <Text style={styles.username}>@{user.username}</Text> -      </TouchableOpacity> -    ); -  }; +  const NamePlate = () => ( +    <TouchableOpacity +      onPress={() => { +        navigation.navigate('Profile', { +          userXId: loggedInUserId === user.id ? undefined : user.id, +          screenType, +        }); +      }}> +      <Text style={styles.firstName}>{user.first_name}</Text> +      <Text style={styles.username}>@{user.username}</Text> +    </TouchableOpacity> +  ); + +  const Badges = () => ( +    // Badges aligned left and spaced as if there are 5 items +    <View style={styles.badgeContainer}> +      {localBadges.map(({badge, img}, index) => ( +        <BadgeIcon key={index} badge={badge} img={img} style={styles.badge} /> +      ))} +      {[0, 0, 0, 0, 0].splice(localBadges.length, 5).map((_, index) => ( +        <View key={index} style={styles.badge} /> +      ))} +    </View> +  );    return (      <View> @@ -149,22 +159,7 @@ const SPBody: React.FC<SPBodyProps> = ({                {user.id !== loggedInUserId && <FriendButton />}              </View>            </View> -          {localBadges.length !== 0 && ( -            // Badges aligned left and spaced as if there are 5 items -            <View style={styles.badgeContainer}> -              {localBadges.map(({badge, img}, index) => ( -                <BadgeIcon -                  key={index} -                  badge={badge} -                  img={img} -                  style={styles.badge} -                /> -              ))} -              {[0, 0, 0, 0, 0].splice(localBadges.length, 5).map((_, index) => ( -                <View key={index} style={styles.badge} /> -              ))} -            </View> -          )} +          {localBadges.length !== 0 && <Badges />}            <View style={styles.marginManager}>              <MutualFriends user={user} friends={mutual_friends} />            </View> | 
