diff options
Diffstat (limited to 'src/screens')
-rw-r--r-- | src/screens/profile/MomentCommentsScreen.tsx | 23 |
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> |