diff options
author | Ivan Chen <ivan@tagg.id> | 2021-03-27 20:30:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-27 20:30:36 -0400 |
commit | 67fb6f5cae06dfbcb359dd6468cb66ad85fa230d (patch) | |
tree | eaf092811d5be72e89e4dec9942dc59a1f8a0211 /src/components/profile/ProfileHeader.tsx | |
parent | bef5728b24a71d1bf327a72e425346020a997037 (diff) | |
parent | bf0a2abf8bab333ff0d87bc07002e6f96199ce3b (diff) |
Merge pull request #330 from ankit-thanekar007/tma-722-cornell-fe
[TMA 722] : Cornell FrontEnd changes
Diffstat (limited to 'src/components/profile/ProfileHeader.tsx')
-rw-r--r-- | src/components/profile/ProfileHeader.tsx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/components/profile/ProfileHeader.tsx b/src/components/profile/ProfileHeader.tsx index e5bd9d93..2c623c2b 100644 --- a/src/components/profile/ProfileHeader.tsx +++ b/src/components/profile/ProfileHeader.tsx @@ -1,7 +1,6 @@ import React, {useState} from 'react'; import {StyleSheet, Text, View} from 'react-native'; import {useSelector} from 'react-redux'; -import UniversityIcon from './UniversityIcon'; import {PROFILE_CUTOUT_TOP_Y} from '../../constants'; import {RootState} from '../../store/rootreducer'; import {ScreenType} from '../../types'; @@ -9,6 +8,7 @@ import {normalize} from '../../utils'; import Avatar from './Avatar'; import FriendsCount from './FriendsCount'; import ProfileMoreInfoDrawer from './ProfileMoreInfoDrawer'; +import UniversityIcon from './UniversityIcon'; type ProfileHeaderProps = { userXId: string | undefined; @@ -24,11 +24,11 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({ handleBlockUnblock, }) => { const { - profile: {name = '', university_class = 2021} = {}, + profile: {name = '', university_class = 2021, university}, user: {username: userXName = ''}, - } = userXId - ? useSelector((state: RootState) => state.userX[screenType][userXId]) - : useSelector((state: RootState) => state.user); + } = useSelector((state: RootState) => + userXId ? state.userX[screenType][userXId] : state.user, + ); const [drawerVisible, setDrawerVisible] = useState(false); const [firstName, lastName] = [...name.split(' ')]; return ( @@ -59,10 +59,7 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({ )} <View style={styles.friendsAndUniversity}> <FriendsCount screenType={screenType} userXId={userXId} /> - <UniversityIcon - university="brown" - university_class={university_class} - /> + <UniversityIcon {...{university, university_class}} /> </View> </View> </View> |