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 = ({title, images}) => { +const Moment: React.FC = ({title, images, isProfileView}) => { const navigation = useNavigation(); const navigateToImagePicker = () => { @@ -36,17 +37,23 @@ const Moment: React.FC = ({title, images}) => { }); } }) - .catch((err) => {Alert.alert('Unable to upload moment!');}); + .catch((err) => { + Alert.alert('Unable to upload moment!'); + }); }; return ( {title} - navigateToImagePicker()} - /> + {!isProfileView ? ( + navigateToImagePicker()} + /> + ) : ( + + )} = ({title, images}) => { images.map((imageObj: MomentType) => ( ))} - {(images === undefined || images.length === 0) && ( + {(images === undefined || images.length === 0) && !isProfileView && ( navigateToImagePicker()}> -- cgit v1.2.3-70-g09d2