diff options
| author | Ivan Chen <ivan@thetaggid.com> | 2021-01-29 17:37:11 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-29 17:37:11 -0500 |
| commit | c08699f541089aed989f3f481d10f890c3064170 (patch) | |
| tree | 1951a6b12f451d6ffe53c886c96fb0e360568efe /src/screens | |
| parent | 77002bb0e78d5c47e6daca14e8c699706a3f94a2 (diff) | |
| parent | cf77496e68b9ef97c833da35fcef2a29bd1f9ae5 (diff) | |
Merge pull request #207 from ashmgarv/tma605
[TMA 605] Allow comment reply redirection from notifications tab
Diffstat (limited to 'src/screens')
| -rw-r--r-- | src/screens/main/NotificationsScreen.tsx | 2 | ||||
| -rw-r--r-- | src/screens/profile/IndividualMoment.tsx | 9 | ||||
| -rw-r--r-- | src/screens/profile/MomentCommentsScreen.tsx | 5 |
3 files changed, 7 insertions, 9 deletions
diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx index 4bdee942..d9952aa8 100644 --- a/src/screens/main/NotificationsScreen.tsx +++ b/src/screens/main/NotificationsScreen.tsx @@ -70,7 +70,7 @@ const NotificationsScreen: React.FC = () => { //Called when user leaves the screen return () => resetNewNotificationFlag(); - }, [newNotificationReceived]), + }, [newNotificationReceived, dispatch, refreshNotifications]), ); // handles storing and fetching the "previously viewed" information diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx index ea0c8fb6..8c1dc327 100644 --- a/src/screens/profile/IndividualMoment.tsx +++ b/src/screens/profile/IndividualMoment.tsx @@ -4,12 +4,12 @@ import {StackNavigationProp} from '@react-navigation/stack'; import React from 'react'; import {FlatList, StyleSheet, View} from 'react-native'; import {useSelector} from 'react-redux'; -import {ProfileStackParams} from 'src/routes/main/ProfileStack'; import { IndividualMomentTitleBar, MomentPostContent, MomentPostHeader, } from '../../components'; +import {MainStackParams} from '../../routes'; import {RootState} from '../../store/rootreducer'; import {MomentType} from '../../types'; import {SCREEN_HEIGHT, SCREEN_WIDTH, StatusBarHeight} from '../../utils'; @@ -17,12 +17,9 @@ import {SCREEN_HEIGHT, SCREEN_WIDTH, StatusBarHeight} from '../../utils'; /** * Individual moment view opened when user clicks on a moment tile */ -type IndividualMomentRouteProp = RouteProp< - ProfileStackParams, - 'IndividualMoment' ->; +type IndividualMomentRouteProp = RouteProp<MainStackParams, 'IndividualMoment'>; type IndividualMomentNavigationProp = StackNavigationProp< - ProfileStackParams, + MainStackParams, 'IndividualMoment' >; interface IndividualMomentProps { diff --git a/src/screens/profile/MomentCommentsScreen.tsx b/src/screens/profile/MomentCommentsScreen.tsx index 58422f0f..5c3b8579 100644 --- a/src/screens/profile/MomentCommentsScreen.tsx +++ b/src/screens/profile/MomentCommentsScreen.tsx @@ -28,7 +28,7 @@ interface MomentCommentsScreenProps { const MomentCommentsScreen: React.FC<MomentCommentsScreenProps> = ({route}) => { const navigation = useNavigation(); - const {moment_id, screenType} = route.params; + const {moment_id, screenType, comment_id} = route.params; //Receives comment length from child CommentsContainer const [commentsLength, setCommentsLength] = useState<number>(0); @@ -55,6 +55,7 @@ const MomentCommentsScreen: React.FC<MomentCommentsScreenProps> = ({route}) => { <View style={styles.body}> <CommentsContainer objectId={moment_id} + commentId={comment_id} screenType={screenType} setCommentsLength={setCommentsLength} newCommentsAvailable={newCommentsAvailable} @@ -107,7 +108,7 @@ const styles = StyleSheet.create({ fontWeight: '400', }, body: { - width: SCREEN_WIDTH, + width: SCREEN_WIDTH * 0.9, height: SCREEN_HEIGHT * 0.8, paddingTop: '3%', }, |
