diff options
author | Ashm Walia <40498934+ashmgarv@users.noreply.github.com> | 2020-10-19 17:14:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 20:14:37 -0400 |
commit | 88fb33d1fe1cd0785e4a92cb3c20d0fafb2da54d (patch) | |
tree | b2e8d474b2c0b02f4e91cd33fa0d5f9842d3a018 /src/components/profile/Moment.tsx | |
parent | 1b7fef188ec2aee0706fc1204432315db3d4fec6 (diff) |
Merged changes to make sure moments view and search work (#62)
Diffstat (limited to 'src/components/profile/Moment.tsx')
-rw-r--r-- | src/components/profile/Moment.tsx | 23 |
1 files changed, 15 insertions, 8 deletions
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)']}> |