From 6dd1ab792366f9ef5b7495723297b753cbd958c8 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Fri, 5 Mar 2021 13:23:01 -0800 Subject: Added university icon to suggested people --- src/components/profile/UniversityIcon.tsx | 16 +++++++---- src/screens/suggestedPeople/SPBody.tsx | 48 ++++++++++++++++++------------- 2 files changed, 38 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/components/profile/UniversityIcon.tsx b/src/components/profile/UniversityIcon.tsx index 95aef8b9..48cfe3dc 100644 --- a/src/components/profile/UniversityIcon.tsx +++ b/src/components/profile/UniversityIcon.tsx @@ -1,11 +1,12 @@ import React from 'react'; -import {StyleSheet, ViewProps} from 'react-native'; +import {ImageStyle, StyleProp, StyleSheet, ViewProps} from 'react-native'; import {Image, Text, View} from 'react-native-animatable'; import {getUniversityClass, normalize} from '../../utils'; export interface UniversityIconProps extends ViewProps { university: string; - university_class: number; + university_class?: number; + imageStyle?: StyleProp; } /** @@ -15,6 +16,7 @@ const UniversityIcon: React.FC = ({ style, university, university_class, + imageStyle, }) => { var universityIcon; switch (university) { @@ -28,10 +30,12 @@ const UniversityIcon: React.FC = ({ return ( - - - {getUniversityClass(university_class)} - + + {university_class && ( + + {getUniversityClass(university_class)} + + )} ); }; diff --git a/src/screens/suggestedPeople/SPBody.tsx b/src/screens/suggestedPeople/SPBody.tsx index 16b5ae9b..21e86f14 100644 --- a/src/screens/suggestedPeople/SPBody.tsx +++ b/src/screens/suggestedPeople/SPBody.tsx @@ -12,8 +12,8 @@ import { ScreenType, SuggestedPeopleDataType, } from '../../types'; -import {normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; -import UniversityIcon from '../../components/profile'; +import {isIPhoneX, normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; +import UniversityIcon from '../../components/profile/UniversityIcon'; interface SPBodyProps { item: SuggestedPeopleDataType; index: number; @@ -87,24 +87,22 @@ const SPBody: React.FC = ({ {backgroundImage} - {firstItem && 'Suggested People'} - - navigation.navigate('MutualBadgeHolders', { - badge_id: 40, - badge_title: 'Brown University Football', - }) - }> - {/* */} - + + {firstItem && 'Suggested People'} + + navigation.navigate('MutualBadgeHolders', { + badge_id: 40, + badge_title: 'Brown University Football', + }) + }> + + + @@ -149,6 +147,16 @@ const styles = StyleSheet.create({ justifyContent: 'space-between', alignSelf: 'center', }, + topContainer: { + height: isIPhoneX() ? SCREEN_HEIGHT * 0.11 : SCREEN_HEIGHT * 0.13, + flexDirection: 'column', + justifyContent: 'space-between', + }, + universityIconContainer: { + width: normalize(31), + height: normalize(38), + left: '5%', + }, marginManager: {marginHorizontal: '5%'}, image: { position: 'absolute', -- cgit v1.2.3-70-g09d2