aboutsummaryrefslogtreecommitdiff
path: root/src/screens/profile/MomentCommentsScreen.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-02-04 16:58:40 -0500
committerIvan Chen <ivan@tagg.id>2021-02-09 14:27:21 -0500
commitc9a8f87a29e12bfb78939fa9a94b6f8919b04836 (patch)
tree61036e1603a5de42c33825d786d9e787addb4012 /src/screens/profile/MomentCommentsScreen.tsx
parentf28ef2d4ac61475d7bd9728634b80f7c0760ff58 (diff)
refactored header styles
# Conflicts: # src/components/common/FriendsButton.tsx # src/screens/profile/FriendsListScreen.tsx # src/screens/profile/MomentCommentsScreen.tsx
Diffstat (limited to 'src/screens/profile/MomentCommentsScreen.tsx')
-rw-r--r--src/screens/profile/MomentCommentsScreen.tsx27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/screens/profile/MomentCommentsScreen.tsx b/src/screens/profile/MomentCommentsScreen.tsx
index ec193db5..4a902e9e 100644
--- a/src/screens/profile/MomentCommentsScreen.tsx
+++ b/src/screens/profile/MomentCommentsScreen.tsx
@@ -1,5 +1,5 @@
import {RouteProp, useNavigation} from '@react-navigation/native';
-import React, {useState} from 'react';
+import React, {useEffect, useState} from 'react';
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {SafeAreaView} from 'react-native-safe-area-context';
import BackIcon from '../../assets/icons/back-arrow.svg';
@@ -7,9 +7,14 @@ 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 +44,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}