diff options
Diffstat (limited to 'src/screens/profile/MomentCommentsScreen.tsx')
-rw-r--r-- | src/screens/profile/MomentCommentsScreen.tsx | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/screens/profile/MomentCommentsScreen.tsx b/src/screens/profile/MomentCommentsScreen.tsx index ec193db5..b0208f6f 100644 --- a/src/screens/profile/MomentCommentsScreen.tsx +++ b/src/screens/profile/MomentCommentsScreen.tsx @@ -1,15 +1,19 @@ import {RouteProp, useNavigation} from '@react-navigation/native'; -import React, {useState} from 'react'; -import {StyleSheet, Text, TouchableOpacity, View} from 'react-native'; +import React, {useEffect, useState} from 'react'; +import {StyleSheet, View} from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; -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 {headerBarOptions, MainStackParams} from '../../routes/main'; import {CommentType} from '../../types'; -import {normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; +import { + HeaderHeight, + normalize, + SCREEN_HEIGHT, + SCREEN_WIDTH, +} from '../../utils'; /** * Comments Screen for an image uploaded @@ -39,19 +43,15 @@ const MomentCommentsScreen: React.FC<MomentCommentsScreenProps> = ({route}) => { CommentType | undefined >(undefined); + useEffect(() => { + navigation.setOptions({ + ...headerBarOptions('black', `${commentsLength} Comments`), + }); + }, [commentsLength, navigation]); + return ( <View style={styles.background}> <SafeAreaView> - <View style={styles.header}> - <TouchableOpacity - style={styles.headerButton} - onPress={() => { - navigation.pop(); - }}> - <BackIcon height={'100%'} width={'100%'} color={'white'} /> - </TouchableOpacity> - <Text style={styles.headerText}>{commentsLength + ' Comments'}</Text> - </View> <View style={styles.body}> <CommentsContainer objectId={moment_id} @@ -110,6 +110,7 @@ const styles = StyleSheet.create({ fontWeight: '400', }, body: { + marginTop: HeaderHeight, width: SCREEN_WIDTH * 0.9, height: SCREEN_HEIGHT * 0.8, paddingTop: '3%', |