diff options
Diffstat (limited to 'src/screens')
-rw-r--r-- | src/screens/profile/CaptionScreen.tsx | 4 | ||||
-rw-r--r-- | src/screens/profile/IndividualMoment.tsx | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index d65a8451..9417d1be 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -78,7 +78,7 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { if (statusCode === 200 && checkImageUploadStatus(data)) { Alert.alert('The picture was uploaded successfully!'); updateMoments(true); - navigation.navigate('Profile'); + navigation.navigate('Profile', {isProfileView: false}); } else { Alert.alert('An error occured while uploading. Please try again!'); } @@ -95,7 +95,7 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { title="Cancel" buttonStyle={styles.button} onPress={() => { - navigation.navigate('Profile'); + navigation.navigate('Profile', {isProfileView: false}); }} /> <Button diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx index 377898c1..639c0965 100644 --- a/src/screens/profile/IndividualMoment.tsx +++ b/src/screens/profile/IndividualMoment.tsx @@ -7,7 +7,7 @@ import {RouteProp} from '@react-navigation/native'; import {StackNavigationProp} from '@react-navigation/stack'; import {CaptionScreenHeader} from '../../components/profile'; import {AuthContext} from '../../routes/authentication'; -import {MomentStackParams} from 'src/routes/profile/MomentStack'; +import {ProfileStackParams} from 'src/routes/profile/ProfileStack'; import moment from 'moment'; import Animated from 'react-native-reanimated'; @@ -20,11 +20,11 @@ const NO_USER: UserType = { * Individual moment view opened when user clicks on a moment tile */ type IndividualMomentRouteProp = RouteProp< - MomentStackParams, + ProfileStackParams, 'IndividualMoment' >; type IndividualMomentNavigationProp = StackNavigationProp< - MomentStackParams, + ProfileStackParams, 'IndividualMoment' >; interface IndividualMomentProps { @@ -42,6 +42,7 @@ const IndividualMoment: React.FC<IndividualMomentProps> = ({ date_time, moment_id, } = route.params.moment; + const {isProfileView} = route.params; const { user: {userId}, } = React.useContext(AuthContext); @@ -95,7 +96,7 @@ const IndividualMoment: React.FC<IndividualMomentProps> = ({ title="Close" buttonStyle={styles.button} onPress={() => { - navigation.navigate('Profile'); + navigation.navigate('Profile', {isProfileView: isProfileView}); }} /> </View> |