aboutsummaryrefslogtreecommitdiff
path: root/src/components/camera
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/camera')
-rw-r--r--src/components/camera/GalleryIcon.tsx24
-rw-r--r--src/components/camera/SaveButton.tsx4
2 files changed, 6 insertions, 22 deletions
diff --git a/src/components/camera/GalleryIcon.tsx b/src/components/camera/GalleryIcon.tsx
index bc8b1d41..8d396550 100644
--- a/src/components/camera/GalleryIcon.tsx
+++ b/src/components/camera/GalleryIcon.tsx
@@ -1,14 +1,12 @@
-import {useNavigation} from '@react-navigation/native';
import React from 'react';
import {Image, Text, TouchableOpacity, View} from 'react-native';
-import {ScreenType} from '../../types';
import {navigateToImagePicker} from '../../utils/camera';
+import {Image as ImageType} from 'react-native-image-crop-picker';
import {styles} from './styles';
interface GalleryIconProps {
- screenType: ScreenType;
- title: string;
mostRecentPhotoUri: string;
+ callback: (pic: ImageType) => void;
}
/*
@@ -16,26 +14,12 @@ interface GalleryIconProps {
* On click, navigates to the image picker
*/
export const GalleryIcon: React.FC<GalleryIconProps> = ({
- screenType,
- title,
mostRecentPhotoUri,
+ callback,
}) => {
- const navigation = useNavigation();
return (
<TouchableOpacity
- onPress={() =>
- navigateToImagePicker((pic) =>
- navigation.navigate('ZoomInCropper', {
- screenType,
- title,
- media: {
- filename: pic.filename,
- uri: pic.path,
- isVideo: false,
- },
- }),
- )
- }
+ onPress={() => navigateToImagePicker(callback)}
style={styles.saveButton}>
{mostRecentPhotoUri !== '' ? (
<Image
diff --git a/src/components/camera/SaveButton.tsx b/src/components/camera/SaveButton.tsx
index 840cc804..0e220497 100644
--- a/src/components/camera/SaveButton.tsx
+++ b/src/components/camera/SaveButton.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import {Text, TouchableOpacity} from 'react-native';
import SaveIcon from '../../assets/icons/camera/save.svg';
-import {downloadImage} from '../../utils/camera';
+import {saveImageToGallery} from '../../utils/camera';
import {styles} from './styles';
interface SaveButtonProps {
@@ -15,7 +15,7 @@ interface SaveButtonProps {
export const SaveButton: React.FC<SaveButtonProps> = ({capturedImageURI}) => (
<TouchableOpacity
onPress={() => {
- downloadImage(capturedImageURI);
+ saveImageToGallery(capturedImageURI);
}}
style={styles.saveButton}>
<SaveIcon width={40} height={40} />