From 411b239b5637f91e61eaf97ae0091ae887c26159 Mon Sep 17 00:00:00 2001 From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> Date: Tue, 5 Jan 2021 13:36:53 -0800 Subject: [HOTFIX] Accomodate large names and match figma (#167) * HOTFIX : Accomodate large names and match figma * Fix --- src/components/profile/FriendsCount.tsx | 4 ++-- src/components/profile/ProfileHeader.tsx | 40 +++++++++++++++++++++---------- src/components/profile/UniversityIcon.tsx | 7 +++--- 3 files changed, 32 insertions(+), 19 deletions(-) (limited to 'src/components') 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 = ({ } = userXId ? useSelector((state: RootState) => state.userX[screenType][userXId]) : useSelector((state: RootState) => state.user); - const [drawerVisible, setDrawerVisible] = useState(false); + const [firstName, lastName] = [...name.split(' ')]; return ( @@ -49,8 +50,14 @@ const ProfileHeader: React.FC = ({ screenType={screenType} /> - {name} - + {name.length <= 16 ? ( + {name} + ) : ( + + {firstName} + {lastName} + + )}