diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-23 19:32:21 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-07-23 19:32:21 -0400 |
commit | 6b9ca4b67c47ca799b3a624efa340f18d76b3b53 (patch) | |
tree | 2b057112637e21b708dea4ff627098ed4674030a /src | |
parent | 3ea48445e330b89ad0d78b3964e933a7d4d30395 (diff) |
Remove tabbar in moment comment
Diffstat (limited to 'src')
-rw-r--r-- | src/screens/profile/MomentCommentsScreen.tsx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/screens/profile/MomentCommentsScreen.tsx b/src/screens/profile/MomentCommentsScreen.tsx index 7dfe8ae9..490edd53 100644 --- a/src/screens/profile/MomentCommentsScreen.tsx +++ b/src/screens/profile/MomentCommentsScreen.tsx @@ -1,5 +1,9 @@ -import {RouteProp, useNavigation} from '@react-navigation/native'; -import React, {useEffect, useState} from 'react'; +import { + RouteProp, + useFocusEffect, + useNavigation, +} from '@react-navigation/native'; +import React, {useCallback, useEffect, useState} from 'react'; import {StyleSheet, View} from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; import {TabsGradient} from '../../components'; @@ -52,6 +56,19 @@ const MomentCommentsScreen: React.FC<MomentCommentsScreenProps> = ({route}) => { CommentType | CommentThreadType | undefined >(); + useFocusEffect( + useCallback(() => { + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: false, + }); + return () => { + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: true, + }); + }; + }, [navigation]), + ); + useEffect(() => { navigation.setOptions({ ...headerBarOptions('black', `${commentsLength} Comments`), |