diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-06-30 15:47:24 -0400 |
|---|---|---|
| committer | Ivan Chen <ivan@tagg.id> | 2021-06-30 15:47:24 -0400 |
| commit | 56ec3a62ebbade90f3d0fb3ff2ccbcbfc091672b (patch) | |
| tree | 6533eb5db111e0675ca3e38390678036254d35ab /src/screens/moments/CameraScreen.tsx | |
| parent | 159ae12d6679441d16791bbf23d05240e3779101 (diff) | |
Cleanup code
Diffstat (limited to 'src/screens/moments/CameraScreen.tsx')
| -rw-r--r-- | src/screens/moments/CameraScreen.tsx | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/screens/moments/CameraScreen.tsx b/src/screens/moments/CameraScreen.tsx index 104774c0..7b71f9e5 100644 --- a/src/screens/moments/CameraScreen.tsx +++ b/src/screens/moments/CameraScreen.tsx @@ -66,17 +66,24 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { ); }, [capturedImage]); - console.log(capturedImage); - /* - * Appears once a picture has been captured to navigate to the caption screen - */ - const handleNext = () => { + const navigateToCropper = (uri: string) => { + navigation.navigate('ZoomInCropper', { + screenType, + title, + media: { + uri, + isVideo: false, // TODO: only support image for now + }, + }); + }; + + const navigateToCaptionScreen = () => { navigation.navigate('CaptionScreen', { screenType, title, media: { uri: capturedImage, - isVideo: false, // TODO: false for now + isVideo: false, // TODO: only support image for now }, }); }; @@ -126,7 +133,7 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { <View style={styles.bottomRightContainer}> {capturedImage ? ( <TaggSquareButton - onPress={handleNext} + onPress={navigateToCaptionScreen} title={'Next'} buttonStyle={'large'} buttonColor={'blue'} @@ -139,16 +146,7 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => { mostRecentPhotoUri={mostRecentPhoto} callback={() => navigateToImagePicker((pic) => { - if (pic.filename) { - navigation.navigate('ZoomInCropper', { - screenType, - title, - media: { - uri: pic.path, - isVideo: false, - }, - }); - } + navigateToCropper(pic.path); }) } /> |
