aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2021-01-05 13:36:53 -0800
committerGitHub <noreply@github.com>2021-01-05 16:36:53 -0500
commit411b239b5637f91e61eaf97ae0091ae887c26159 (patch)
treede36de3543d702ca6f52c366982a8edc26bb603a
parentcbb3cdbe4e61ada38a336136a77c5dae318f9128 (diff)
[HOTFIX] Accomodate large names and match figma (#167)
* HOTFIX : Accomodate large names and match figma * Fix
-rw-r--r--src/components/profile/FriendsCount.tsx4
-rw-r--r--src/components/profile/ProfileHeader.tsx40
-rw-r--r--src/components/profile/UniversityIcon.tsx7
3 files changed, 32 insertions, 19 deletions
diff --git a/src/components/profile/FriendsCount.tsx b/src/components/profile/FriendsCount.tsx
index 91d54cab..23a24787 100644
--- a/src/components/profile/FriendsCount.tsx
+++ b/src/components/profile/FriendsCount.tsx
@@ -55,11 +55,11 @@ const styles = StyleSheet.create({
},
count: {
fontWeight: '700',
- fontSize: 18,
+ fontSize: 13,
},
label: {
fontWeight: '500',
- fontSize: 16,
+ fontSize: 13,
},
});
diff --git a/src/components/profile/ProfileHeader.tsx b/src/components/profile/ProfileHeader.tsx
index 5c14b374..8d502d97 100644
--- a/src/components/profile/ProfileHeader.tsx
+++ b/src/components/profile/ProfileHeader.tsx
@@ -2,6 +2,7 @@ import React, {useState} from 'react';
import {StyleSheet, Text, View} from 'react-native';
import {useSelector} from 'react-redux';
import {UniversityIcon} from '.';
+import {NO_MOMENTS} from '../../store/initialStates';
import {RootState} from '../../store/rootreducer';
import {ScreenType} from '../../types';
import {SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
@@ -28,8 +29,8 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({
} = userXId
? useSelector((state: RootState) => state.userX[screenType][userXId])
: useSelector((state: RootState) => state.user);
-
const [drawerVisible, setDrawerVisible] = useState(false);
+ const [firstName, lastName] = [...name.split(' ')];
return (
<View style={styles.container}>
@@ -49,8 +50,14 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({
screenType={screenType}
/>
<View style={styles.header}>
- <Text style={styles.name}>{name}</Text>
-
+ {name.length <= 16 ? (
+ <Text style={styles.name}>{name}</Text>
+ ) : (
+ <View>
+ <Text style={styles.name}>{firstName}</Text>
+ <Text style={styles.name}>{lastName}</Text>
+ </View>
+ )}
<View style={styles.friendsAndUniversity}>
<FriendsCount
style={styles.friends}
@@ -81,28 +88,35 @@ const styles = StyleSheet.create({
header: {
flexDirection: 'column',
justifyContent: 'center',
- marginTop: SCREEN_HEIGHT / 40,
- marginLeft: SCREEN_WIDTH / 10,
- marginBottom: SCREEN_HEIGHT / 50,
+ alignItems: 'center',
+ marginTop: SCREEN_WIDTH / 18.2,
+ marginLeft: SCREEN_WIDTH / 8,
+ marginBottom: SCREEN_WIDTH / 50,
},
avatar: {
- bottom: SCREEN_HEIGHT / 80,
+ bottom: SCREEN_WIDTH / 80,
left: '10%',
},
name: {
- marginHorizontal: '20%',
- fontSize: 20,
+ marginLeft: SCREEN_WIDTH / 8,
+ fontSize: 17,
fontWeight: '500',
alignSelf: 'center',
- marginBottom: SCREEN_HEIGHT / 80,
},
friends: {
- marginRight: SCREEN_HEIGHT / 80,
+ alignSelf: 'flex-start',
+ marginRight: SCREEN_WIDTH / 20,
},
university: {
- marginLeft: SCREEN_HEIGHT / 50,
+ alignSelf: 'flex-end',
+ bottom: 3,
+ },
+ friendsAndUniversity: {
+ flexDirection: 'row',
+ flex: 1,
+ marginLeft: SCREEN_WIDTH / 10,
+ marginTop: SCREEN_WIDTH / 40,
},
- friendsAndUniversity: {flexDirection: 'row', flex: 1, marginLeft: '20%'},
});
export default ProfileHeader;
diff --git a/src/components/profile/UniversityIcon.tsx b/src/components/profile/UniversityIcon.tsx
index 15c23715..13586359 100644
--- a/src/components/profile/UniversityIcon.tsx
+++ b/src/components/profile/UniversityIcon.tsx
@@ -42,16 +42,15 @@ const styles = StyleSheet.create({
flexDirection: 'column',
flexWrap: 'wrap',
justifyContent: 'center',
- marginBottom: '10%',
},
univClass: {
- fontSize: 15,
+ fontSize: 13,
fontWeight: '500',
},
icon: {
alignSelf: 'center',
- width: 20,
- height: 22.5,
+ width: 17,
+ height: 19,
},
});