aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Moment.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/profile/Moment.tsx')
-rw-r--r--src/components/profile/Moment.tsx23
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)']}>