diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-06-30 14:27:25 -0400 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-06-30 14:27:25 -0400 |
| commit | 3b7297189633cda8b886fa06f4b9d4787b6aa7c7 (patch) | |
| tree | 14e88a1559480f4546a26216e2e35b94567bd674 /src/screens/moments/CameraScreen.tsx | |
| parent | 2f3244dfa11cc23b804930ad448222bbff4f022a (diff) | |
Clean up code, Remove tab bar logic to use modal style instead
Diffstat (limited to 'src/screens/moments/CameraScreen.tsx')
| -rw-r--r-- | src/screens/moments/CameraScreen.tsx | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/src/screens/moments/CameraScreen.tsx b/src/screens/moments/CameraScreen.tsx index c6ed1116..1826f9d7 100644 --- a/src/screens/moments/CameraScreen.tsx +++ b/src/screens/moments/CameraScreen.tsx @@ -1,8 +1,8 @@ import CameraRoll from '@react-native-community/cameraroll'; import {useBottomTabBarHeight} from '@react-navigation/bottom-tabs'; -import {RouteProp, useFocusEffect} from '@react-navigation/core'; +import {RouteProp} from '@react-navigation/core'; import {StackNavigationProp} from '@react-navigation/stack'; -import React, {createRef, useCallback, useEffect, useState} from 'react'; +import React, {createRef, useEffect, useState} from 'react'; import {StyleSheet, TouchableOpacity, View} from 'react-native'; import {CameraType, FlashMode, RNCamera} from 'react-native-camera'; import CloseIcon from '../../assets/ionicons/close-outline.svg'; @@ -37,22 +37,6 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { const [showSaveButton, setShowSaveButton] = useState<boolean>(false); /* - * Removes bottom navigation bar on current screen and add it back when navigating away - */ - useFocusEffect( - useCallback(() => { - navigation.dangerouslyGetParent()?.setOptions({ - tabBarVisible: false, - }); - return () => { - navigation.dangerouslyGetParent()?.setOptions({ - tabBarVisible: true, - }); - }; - }, [navigation]), - ); - - /* * Chooses the last picture from gallery to display as the gallery button icon */ useEffect(() => { @@ -75,9 +59,10 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { navigation.navigate('CaptionScreen', { screenType, title, - image: { - filename: capturedImage, - path: capturedImage, + media: { + filename: 'dont have that info', + uri: capturedImage, + isVideo: false, // TODO: false for now }, }); }; @@ -116,7 +101,10 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { )} <TouchableOpacity onPress={() => - takePicture(cameraRef, setShowSaveButton, setCapturedImage) + takePicture(cameraRef, (pic) => { + setShowSaveButton(true); + setCapturedImage(pic.uri); + }) } style={styles.captureButtonContainer}> <View style={styles.captureButton} /> @@ -155,11 +143,6 @@ const styles = StyleSheet.create({ flexDirection: 'column', backgroundColor: 'black', }, - preview: { - flex: 1, - justifyContent: 'flex-end', - alignItems: 'center', - }, captureButtonContainer: { alignSelf: 'center', backgroundColor: 'transparent', |
