aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/moments/Moment.tsx6
-rw-r--r--src/components/moments/MomentTile.tsx12
2 files changed, 15 insertions, 3 deletions
diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx
index 1ec5511e..f905bfe3 100644
--- a/src/components/moments/Moment.tsx
+++ b/src/components/moments/Moment.tsx
@@ -61,7 +61,11 @@ const Moment: React.FC<MomentProps> = ({title, images, isProfileView}) => {
style={styles.scrollContainer}>
{images &&
images.map((imageObj: MomentType) => (
- <MomentTile key={imageObj.moment_id} moment={imageObj} />
+ <MomentTile
+ key={imageObj.moment_id}
+ moment={imageObj}
+ isProfileView={isProfileView}
+ />
))}
{(images === undefined || images.length === 0) && !isProfileView && (
<TouchableOpacity onPress={() => navigateToImagePicker()}>
diff --git a/src/components/moments/MomentTile.tsx b/src/components/moments/MomentTile.tsx
index 1d483875..787957e0 100644
--- a/src/components/moments/MomentTile.tsx
+++ b/src/components/moments/MomentTile.tsx
@@ -2,17 +2,25 @@ import {useNavigation} from '@react-navigation/native';
import React from 'react';
import {StyleSheet, View, Image, TouchableOpacity} from 'react-native';
import {MomentType} from 'src/types';
+import {ProfileContext} from '../../routes';
interface MomentTileProps {
moment: MomentType;
+ isProfileView: boolean;
}
-const MomentTile: React.FC<MomentTileProps> = ({moment}) => {
+const MomentTile: React.FC<MomentTileProps> = ({moment, isProfileView}) => {
const navigation = useNavigation();
+
+ //Username is needed by the IndividualMoment screen
+ const {
+ user: {username},
+ } = React.useContext(ProfileContext);
+
const {path_hash} = moment;
return (
<TouchableOpacity
onPress={() => {
- navigation.push('IndividualMoment', {moment});
+ navigation.push('IndividualMoment', {moment, isProfileView, username});
}}>
<View style={styles.image}>
<Image style={styles.image} source={{uri: path_hash}} />