diff options
author | Shravya Ramesh <37447613+shravyaramesh@users.noreply.github.com> | 2021-02-11 14:06:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 14:06:04 -0800 |
commit | bcede9945a10ce7bf67aeeaf7f94e1a8984e7c0d (patch) | |
tree | 229e130c90307507e68f17b016f81cf310822ccf /src/screens/profile/MomentCommentsScreen.tsx | |
parent | da61f04d037d92fce7cf9852a3be79eb41158d5a (diff) | |
parent | 2561d20e17a697726d6b77accf79c9da2d1f6ef6 (diff) |
Merge branch 'master' into tma641-animation-tutorial
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%', |