diff options
author | Ivan Chen <ivan@tagg.id> | 2021-02-18 14:09:00 -0500 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-02-18 14:09:00 -0500 |
commit | c158b835a1f6cedd1448c2beb1389324a3c9e48a (patch) | |
tree | accfce9584f6a2953fa4821368b0df36514cb49a /src/components/profile/ProfilePreview.tsx | |
parent | 200cc2cc2c37d588bc37240161c3974f63ce02b4 (diff) | |
parent | 99db144ce20fd5f1502f668795ae7cafbc5b2eae (diff) |
Merge branch 'master' into tma626-people-tutorial
# Conflicts:
# src/screens/suggestedPeople/SuggestedPeopleScreen.tsx
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; |