diff options
-rw-r--r-- | src/components/suggestedPeople/BadgesDropdown.tsx | 2 | ||||
-rw-r--r-- | src/screens/suggestedPeople/SPBody.tsx | 34 | ||||
-rw-r--r-- | src/types/types.ts | 2 |
3 files changed, 22 insertions, 16 deletions
diff --git a/src/components/suggestedPeople/BadgesDropdown.tsx b/src/components/suggestedPeople/BadgesDropdown.tsx index 264292d7..3fcb7cbc 100644 --- a/src/components/suggestedPeople/BadgesDropdown.tsx +++ b/src/components/suggestedPeople/BadgesDropdown.tsx @@ -88,7 +88,7 @@ const BadgesDropdown: React.FC<BadgesDropdownProps> = ({localBadges}) => { styles.animatedBadgeView, { top: top[index], - zIndex: -1 * parseInt(badge.id, 10), + zIndex: -1 * badge.id, }, ]}> <TouchableOpacity 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 diff --git a/src/types/types.ts b/src/types/types.ts index 7839e3f5..e068eeba 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -231,7 +231,7 @@ export type TypeOfNotification = | 'MOM_FRIEND'; export type UniversityBadge = { - id: string; + id: number; name: string; university: string; category: string; |