diff options
author | Ivan Chen <ivan@tagg.id> | 2021-07-23 19:36:51 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-07-23 19:36:51 -0400 |
commit | 6211f59248d8cc37d6b6fd52e65258d1e3b585f1 (patch) | |
tree | abc55c7e622b9548bfb8daa9ddc303c7867c24ae | |
parent | 65a29b596f48bd9509da2af5c723b0a47f45a4bf (diff) |
Hide tab bar in edit moment
-rw-r--r-- | src/screens/profile/CaptionScreen.tsx | 18 |
1 files changed, 17 insertions, 1 deletions
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 @@ -93,6 +93,15 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { }, [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 // e.g. "@ivan.tagg" @@ -271,7 +280,14 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { <Button title="Cancel" buttonStyle={styles.button} - onPress={() => navigation.goBack()} + onPress={() => { + if (moment) { + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: true, + }); + } + navigation.goBack(); + }} /> </View> <CaptionScreenHeader style={styles.header} title={'Moments'} /> |