From ab7fa09af967e0a8cf2ca53dfb24f8bc8a6886f7 Mon Sep 17 00:00:00 2001
From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com>
Date: Sun, 18 Oct 2020 16:37:32 -0700
Subject: [TMA 279] Ability to search and view someone's profile (#58)

* Batch one : major changes

* WIP checkpoint

* The one before the final touch

* Probable final touch

* ran yarn lint D:

* linter broke something

* fixed a small bug

* Addressed a small nitpick

* Well abstracted now

Co-authored-by: Ivan Chen <ivan@thetaggid.com>
---
 src/components/profile/ProfileHeader.tsx | 14 ++++++++++----
 1 file changed, 10 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 ec382357..62c103fd 100644
--- a/src/components/profile/ProfileHeader.tsx
+++ b/src/components/profile/ProfileHeader.tsx
@@ -4,16 +4,22 @@ import Avatar from './Avatar';
 import FollowCount from './FollowCount';
 import {View, Text, StyleSheet} from 'react-native';
 import {SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
-import {AuthContext} from '../../routes/authentication';
+import {AuthContext, ProfileContext} from '../../routes/';
 
-const ProfileHeader: React.FC = () => {
+type ProfileHeaderProps = {
+  isProfileView: boolean;
+};
+
+const ProfileHeader: React.FC<ProfileHeaderProps> = ({isProfileView}) => {
   const {
     profile: {name},
-  } = React.useContext(AuthContext);
+  } = isProfileView
+    ? React.useContext(ProfileContext)
+    : React.useContext(AuthContext);
   return (
     <View style={styles.container}>
       <View style={styles.row}>
-        <Avatar style={styles.avatar} />
+        <Avatar style={styles.avatar} isProfileView={isProfileView} />
         <View style={styles.header}>
           <Text style={styles.name}>{name}</Text>
           <View style={styles.row}>
-- 
cgit v1.2.3-70-g09d2

