From e8324a7278a82d926acceedc10921f0b14e6d403 Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Mon, 29 Mar 2021 14:00:39 -0400
Subject: updated helper function, cleaned up code, prevent friends navigation

---
 src/components/profile/ProfileHeader.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/components/profile/ProfileHeader.tsx')

diff --git a/src/components/profile/ProfileHeader.tsx b/src/components/profile/ProfileHeader.tsx
index e5bd9d93..b5dda399 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;
@@ -26,9 +26,9 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({
   const {
     profile: {name = '', university_class = 2021} = {},
     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 (
-- 
cgit v1.2.3-70-g09d2

