diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-29 16:44:41 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-06-29 16:44:41 -0400 |
commit | 9d30c0c211e6b0b1b87e5de93a043e6e9f06beb3 (patch) | |
tree | cd4fb828626b91402deb674601e1013a181d91b3 /src/components/camera/GalleryIcon.tsx | |
parent | f6fdd5d913c29855644f226d09d6cba60faf6e21 (diff) |
Cleanup code, Fix gallery icon bug
Diffstat (limited to 'src/components/camera/GalleryIcon.tsx')
-rw-r--r-- | src/components/camera/GalleryIcon.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/components/camera/GalleryIcon.tsx b/src/components/camera/GalleryIcon.tsx index ab226323..c49ace7d 100644 --- a/src/components/camera/GalleryIcon.tsx +++ b/src/components/camera/GalleryIcon.tsx @@ -1,6 +1,6 @@ import {useNavigation} from '@react-navigation/native'; import React from 'react'; -import {Image, Text, TouchableOpacity} from 'react-native'; +import {Image, Text, TouchableOpacity, View} from 'react-native'; import {ScreenType} from '../../types'; import {navigateToImagePicker} from '../../utils/camera'; import {styles} from './styles'; @@ -8,7 +8,7 @@ import {styles} from './styles'; interface GalleryIconProps { screenType: ScreenType; title: string; - mostRecentPhoto: string; + mostRecentPhotoUri: string; } /* @@ -18,20 +18,22 @@ interface GalleryIconProps { export const GalleryIcon: React.FC<GalleryIconProps> = ({ screenType, title, - mostRecentPhoto, + mostRecentPhotoUri, }) => { const navigation = useNavigation(); return ( <TouchableOpacity onPress={() => navigateToImagePicker(navigation, screenType, title)} style={styles.saveButton}> - {mostRecentPhoto !== '' && ( + {mostRecentPhotoUri !== '' ? ( <Image - source={{uri: mostRecentPhoto}} + source={{uri: mostRecentPhotoUri}} width={40} height={40} style={styles.galleryIcon} /> + ) : ( + <View style={styles.galleryIconEmpty} /> )} <Text style={styles.saveButtonLabel}>Gallery</Text> </TouchableOpacity> |