aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
authorAshm Walia <ashmwalia@outlook.com>2021-01-27 08:24:43 -0800
committerAshm Walia <ashmwalia@outlook.com>2021-01-27 08:24:43 -0800
commit85c0f668665696ba8127ee1ea436d10ec0af955f (patch)
tree9b0cf515a04fabdb30f1583ec08b8d813a09c027 /src/screens
parent755f4f540d3e759ff9ad3bc35c64b6f7fc83998b (diff)
Pre-final
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/profile/MomentCommentsScreen.tsx23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/screens/profile/MomentCommentsScreen.tsx b/src/screens/profile/MomentCommentsScreen.tsx
index 9fd5aaa0..764b9228 100644
--- a/src/screens/profile/MomentCommentsScreen.tsx
+++ b/src/screens/profile/MomentCommentsScreen.tsx
@@ -6,7 +6,9 @@ import BackIcon from '../../assets/icons/back-arrow.svg';
import {TabsGradient} from '../../components';
import {AddComment} from '../../components/';
import CommentsContainer from '../../components/comments/CommentsContainer';
+import {ADD_COMMENT_TEXT} from '../../constants/strings';
import {MainStackParams} from '../../routes/main';
+import {CommentType} from '../../types';
import {SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
/**
@@ -27,8 +29,12 @@ interface MomentCommentsScreenProps {
const MomentCommentsScreen: React.FC<MomentCommentsScreenProps> = ({route}) => {
const navigation = useNavigation();
const {moment_id, screenType} = route.params;
- const [newCommentsAvailable, setNewCommentsAvailable] = useState(true);
+
const [commentsLength, setCommentsLength] = useState<number>(0);
+ const [newCommentsAvailable, setNewCommentsAvailable] = React.useState(true);
+ const [commentObjectInFocus, setCommentObjectInFocus] = useState<
+ CommentType | undefined
+ >(undefined);
return (
<View style={styles.background}>
@@ -45,17 +51,26 @@ const MomentCommentsScreen: React.FC<MomentCommentsScreenProps> = ({route}) => {
</View>
<View style={styles.body}>
<CommentsContainer
- moment_id={moment_id}
+ objectId={moment_id}
screenType={screenType}
setCommentsLength={setCommentsLength}
newCommentsAvailable={newCommentsAvailable}
setNewCommentsAvailable={setNewCommentsAvailable}
+ setCommentObjectInFocus={setCommentObjectInFocus}
+ commentObjectInFocus={commentObjectInFocus}
typeOfComment={'Comment'}
/>
<AddComment
- placeholderText={'Add a comment..'}
+ placeholderText={
+ commentObjectInFocus
+ ? ADD_COMMENT_TEXT(commentObjectInFocus.commenter.username)
+ : ADD_COMMENT_TEXT()
+ }
setNewCommentsAvailable={setNewCommentsAvailable}
- moment_id={moment_id}
+ objectId={
+ commentObjectInFocus ? commentObjectInFocus.comment_id : moment_id
+ }
+ isThreadInFocus={commentObjectInFocus ? true : false}
/>
</View>
</SafeAreaView>