From 88fb33d1fe1cd0785e4a92cb3c20d0fafb2da54d Mon Sep 17 00:00:00 2001
From: Ashm Walia <40498934+ashmgarv@users.noreply.github.com>
Date: Mon, 19 Oct 2020 17:14:37 -0700
Subject: Merged changes to make sure moments view and search work (#62)

---
 src/components/profile/Moment.tsx | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

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

diff --git a/src/components/profile/Moment.tsx b/src/components/profile/Moment.tsx
index be7cbfba..1ec5511e 100644
--- a/src/components/profile/Moment.tsx
+++ b/src/components/profile/Moment.tsx
@@ -15,9 +15,10 @@ import {MomentType} from 'src/types';
 interface MomentProps {
   title: string;
   images: MomentType[] | undefined;
+  isProfileView: boolean;
 }
 
-const Moment: React.FC<MomentProps> = ({title, images}) => {
+const Moment: React.FC<MomentProps> = ({title, images, isProfileView}) => {
   const navigation = useNavigation();
 
   const navigateToImagePicker = () => {
@@ -36,17 +37,23 @@ const Moment: React.FC<MomentProps> = ({title, images}) => {
           });
         }
       })
-      .catch((err) => {Alert.alert('Unable to upload moment!');});
+      .catch((err) => {
+        Alert.alert('Unable to upload moment!');
+      });
   };
   return (
     <View style={styles.container}>
       <View style={styles.header}>
         <Text style={styles.titleText}>{title}</Text>
-        <PlusIcon
-          width={21}
-          height={21}
-          onPress={() => navigateToImagePicker()}
-        />
+        {!isProfileView ? (
+          <PlusIcon
+            width={21}
+            height={21}
+            onPress={() => navigateToImagePicker()}
+          />
+        ) : (
+          <React.Fragment />
+        )}
       </View>
       <ScrollView
         horizontal
@@ -56,7 +63,7 @@ const Moment: React.FC<MomentProps> = ({title, images}) => {
           images.map((imageObj: MomentType) => (
             <MomentTile key={imageObj.moment_id} moment={imageObj} />
           ))}
-        {(images === undefined || images.length === 0) && (
+        {(images === undefined || images.length === 0) && !isProfileView && (
           <TouchableOpacity onPress={() => navigateToImagePicker()}>
             <LinearGradient
               colors={['rgba(105, 141, 211, 1)', 'rgba(105, 141, 211, 0.3)']}>
-- 
cgit v1.2.3-70-g09d2

