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/screens/profile/ProfileScreen.tsx | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

(limited to 'src/screens/profile/ProfileScreen.tsx')

diff --git a/src/screens/profile/ProfileScreen.tsx b/src/screens/profile/ProfileScreen.tsx
index cc388ffd..7d11fa2a 100644
--- a/src/screens/profile/ProfileScreen.tsx
+++ b/src/screens/profile/ProfileScreen.tsx
@@ -2,20 +2,28 @@ import React from 'react';
 import {StatusBar} from 'react-native';
 import Animated from 'react-native-reanimated';
 import {Content, Cover, TabsGradient} from '../../components';
-import {AuthContext} from '../../routes/authentication';
+import {RouteProp} from '@react-navigation/native';
+import {ProfileStackParams} from '../../routes/profile';
 
 /**
- * Profile Screen for a user's logged in profile
+ * Profile Screen for a user's profile
  * including posts, messaging, and settings
  */
-const ProfileScreen: React.FC = () => {
-  const {user} = React.useContext(AuthContext);
+
+type ProfileScreenRouteProps = RouteProp<ProfileStackParams, 'Profile'>;
+
+interface ProfileOnboardingProps {
+  route: ProfileScreenRouteProps;
+}
+
+const ProfileScreen: React.FC<ProfileOnboardingProps> = ({route}) => {
+  const {isProfileView} = route.params;
   const y = Animated.useValue(0);
   return (
     <>
       <StatusBar />
-      <Cover {...{y, user}} />
-      <Content {...{y, user}} />
+      <Cover {...{y, isProfileView}} />
+      <Content {...{y, isProfileView}} />
       <TabsGradient />
     </>
   );
-- 
cgit v1.2.3-70-g09d2

