diff options
author | Ivan Chen <ivan@thetaggid.com> | 2021-02-18 14:01:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 14:01:38 -0500 |
commit | 6d516586c78a670421ec8cb4ea23f6a28c5d838d (patch) | |
tree | ee40e798d72d201c827951a83ec0f17471367588 /src/components/profile/ProfilePreview.tsx | |
parent | f71a4347854620d03c634bec532fdfeaf821bd44 (diff) | |
parent | 6fb6afbf091457aaa5b7116cdc635f75162bcf5f (diff) |
Merge pull request #243 from shravyaramesh/tma628-mutual-friends
[TMA-628] Mutual friends
Diffstat (limited to 'src/components/profile/ProfilePreview.tsx')
-rw-r--r-- | src/components/profile/ProfilePreview.tsx | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/components/profile/ProfilePreview.tsx b/src/components/profile/ProfilePreview.tsx index fad3ec09..02ab94e7 100644 --- a/src/components/profile/ProfilePreview.tsx +++ b/src/components/profile/ProfilePreview.tsx @@ -18,6 +18,7 @@ import {PreviewType, ProfilePreviewType, ScreenType} from '../../types'; import { checkIfUserIsBlocked, fetchUserX, + isIPhoneX, normalize, SCREEN_WIDTH, userXInStore, @@ -188,6 +189,17 @@ const ProfilePreview: React.FC<ProfilePreviewProps> = ({ usernameStyle = styles.friendUsername; nameStyle = styles.friendName; break; + case 'Suggested People Drawer': + containerStyle = styles.suggestedPeopleContainer; + avatarStyle = styles.suggestedPeopleAvatar; + nameContainerStyle = styles.suggestedPeopleNameContainer; + usernameToDisplay = '@' + username; + usernameStyle = styles.suggestedPeopleUsername; + nameStyle = styles.suggestedPeopleName; + break; + case 'Suggested People Screen': + avatarStyle = styles.suggestedPeopleScreenAvatar; + break; default: containerStyle = styles.searchResultContainer; avatarStyle = styles.searchResultAvatar; @@ -229,6 +241,16 @@ const ProfilePreview: React.FC<ProfilePreviewProps> = ({ <Text style={nameStyle}>{first_name.concat(' ', last_name)}</Text> </> )} + {previewType === 'Suggested People Drawer' && ( + <> + <Text style={styles.suggestedPeopleName} numberOfLines={2}> + {first_name} {last_name} + </Text> + <Text + style={styles.suggestedPeopleUsername} + numberOfLines={1}>{`@${username}`}</Text> + </> + )} </View> </TouchableOpacity> ); @@ -340,6 +362,44 @@ const styles = StyleSheet.create({ color: '#6C6C6C', letterSpacing: normalize(0.1), }, + suggestedPeopleContainer: { + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + marginRight: 25, + width: isIPhoneX() ? 80 : 65, + }, + suggestedPeopleAvatar: { + alignSelf: 'center', + height: normalize(60), + width: normalize(60), + borderRadius: 60, + }, + suggestedPeopleUsername: { + fontSize: normalize(10), + lineHeight: normalize(15), + fontWeight: '500', + color: '#828282', + textAlign: 'center', + }, + suggestedPeopleNameContainer: { + justifyContent: 'space-evenly', + alignSelf: 'stretch', + marginTop: 10, + }, + suggestedPeopleName: { + fontSize: normalize(12), + lineHeight: normalize(15), + fontWeight: '700', + color: '#3C3C3C', + textAlign: 'center', + }, + suggestedPeopleScreenAvatar: { + height: normalize(33.5), + width: normalize(33.5), + marginRight: 15, + borderRadius: 50, + }, }); export default ProfilePreview; |