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}) => {