diff options
Diffstat (limited to 'src/components/moments/Moment.tsx')
-rw-r--r-- | src/components/moments/Moment.tsx | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx index a43a2830..04d35825 100644 --- a/src/components/moments/Moment.tsx +++ b/src/components/moments/Moment.tsx @@ -91,7 +91,14 @@ const Moment: React.FC<MomentProps> = ({ mediaType: 'any', }) .then((picture) => { - if (picture.path && picture.filename) { + if ( + (picture.filename.endsWith('gif') || + picture.filename.endsWith('GIF')) && + picture.path && + picture.filename + ) { + showAlert(picture); + } else if (picture.path && picture.filename) { navigation.navigate('ZoomInCropper', { screenType, title, @@ -110,6 +117,42 @@ const Moment: React.FC<MomentProps> = ({ }); }; + /* Handles GIF files */ + const showAlert = (picture) => + Alert.alert( + 'Warning', + 'The cropped image will not be a GIF, but will only include the first frame of the GIF. Continue?', + [ + { + text: 'Cancel', + onPress: () => {}, + style: 'cancel', + }, + { + text: 'Continue', + onPress: () => { + navigation.navigate('ZoomInCropper', { + screenType, + title, + media: { + filename: picture.filename, + uri: picture.path, + isVideo: false, + }, + }); + }, + style: 'default', + }, + ], + { + cancelable: true, + onDismiss: () => + Alert.alert( + 'This alert was dismissed by tapping outside of the alert dialog.', + ), + }, + ); + return ( <View style={[styles.container, externalStyles?.container]}> <View style={[styles.header, externalStyles?.header]}> |