diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-07-09 18:40:30 -0400 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-07-09 18:40:30 -0400 |
| commit | dff83dc855e9500bc228a1491601e660527afa10 (patch) | |
| tree | f9f0eef6ef001a27af2f98790e08e77e3c955dd4 /src/screens | |
| parent | 9bbba285b989cd6bf1a9543b4fa0e97e2379616c (diff) | |
Allow preselect category from profile screen
Diffstat (limited to 'src/screens')
| -rw-r--r-- | src/screens/moments/CameraScreen.tsx | 6 | ||||
| -rw-r--r-- | src/screens/profile/CaptionScreen.tsx | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/screens/moments/CameraScreen.tsx b/src/screens/moments/CameraScreen.tsx index 07c9b059..5f9412fb 100644 --- a/src/screens/moments/CameraScreen.tsx +++ b/src/screens/moments/CameraScreen.tsx @@ -30,7 +30,7 @@ interface CameraScreenProps { navigation: CameraScreenNavigationProps; } const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { - const {screenType} = route.params; + const {screenType, selectedCategory} = route.params; const cameraRef = createRef<RNCamera>(); const tabBarHeight = useBottomTabBarHeight(); const [cameraType, setCameraType] = useState<keyof CameraType>('front'); @@ -71,6 +71,7 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { uri, isVideo: false, }, + selectedCategory, }); }; @@ -94,6 +95,9 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { setShowSaveButton(false); setMediaFromGallery(''); } else { + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: true, + }); navigation.goBack(); } }; diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 484070d2..1232eb66 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -115,6 +115,9 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { const handleFailed = (noCategory = false) => { setLoading(false); + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: true, + }); setTimeout(() => { if (noCategory) { Alert.alert(ERROR_NO_MOMENT_CATEGORY); @@ -125,6 +128,9 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { }; const handleSuccess = () => { setLoading(false); + navigation.dangerouslyGetParent()?.setOptions({ + tabBarVisible: true, + }); if (!moment) { // if posting, pop all screens until at camera screen (default upload screen) // then switch to the profile tab |
