aboutsummaryrefslogtreecommitdiff
path: root/src/components/camera/GalleryIcon.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-06-30 15:18:57 -0400
committerIvan Chen <ivan@tagg.id>2021-06-30 15:18:57 -0400
commitc548f8df62c3775058ffa18e201ca230a641e6c1 (patch)
tree19e1f72cbc6f46f9ad98d2800e6f6d36a8c4dd43 /src/components/camera/GalleryIcon.tsx
parentd22e3508a4122575c064bbcb2df94a6e07bce7eb (diff)
Cleanup code
Diffstat (limited to 'src/components/camera/GalleryIcon.tsx')
-rw-r--r--src/components/camera/GalleryIcon.tsx24
1 files changed, 4 insertions, 20 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