From 6b9ca4b67c47ca799b3a624efa340f18d76b3b53 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Fri, 23 Jul 2021 19:32:21 -0400 Subject: Remove tabbar in moment comment --- src/screens/profile/MomentCommentsScreen.tsx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src') 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 = ({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`), -- cgit v1.2.3-70-g09d2 From 65a29b596f48bd9509da2af5c723b0a47f45a4bf Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Fri, 23 Jul 2021 19:32:27 -0400 Subject: Set default camera to be back --- src/screens/moments/CameraScreen.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/screens/moments/CameraScreen.tsx b/src/screens/moments/CameraScreen.tsx index ecf19f3a..27412486 100644 --- a/src/screens/moments/CameraScreen.tsx +++ b/src/screens/moments/CameraScreen.tsx @@ -27,7 +27,7 @@ const CameraScreen: React.FC = ({route, navigation}) => { const {screenType, selectedCategory} = route.params; const cameraRef = createRef(); const tabBarHeight = useBottomTabBarHeight(); - const [cameraType, setCameraType] = useState('front'); + const [cameraType, setCameraType] = useState('back'); const [flashMode, setFlashMode] = useState('off'); const [mostRecentPhoto, setMostRecentPhoto] = useState(''); const [isRecording, setIsRecording] = useState(false); -- cgit v1.2.3-70-g09d2 From 6211f59248d8cc37d6b6fd52e65258d1e3b585f1 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Fri, 23 Jul 2021 19:36:51 -0400 Subject: Hide tab bar in edit moment --- src/screens/profile/CaptionScreen.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 6ba1791c..3ee0bd5b 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -92,6 +92,15 @@ const CaptionScreen: React.FC = ({route, navigation}) => { setMomentCategory(route.params.selectedCategory); }, [route.params.selectedCategory]); + useEffect(() => { + // if we're editing, hide tab bar + if (moment) { + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: false, + }); + } + }, [route.params.moment]); + useEffect(() => { let listString = ''; // Append non-truncated usernames together and no more than 21 characters total @@ -271,7 +280,14 @@ const CaptionScreen: React.FC = ({route, navigation}) => {