diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/moments/Moment.tsx | 44 | ||||
-rw-r--r-- | src/components/moments/MomentPost.tsx | 4 |
2 files changed, 46 insertions, 2 deletions
diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx index a43a2830..ec9129c5 100644 --- a/src/components/moments/Moment.tsx +++ b/src/components/moments/Moment.tsx @@ -91,7 +91,13 @@ const Moment: React.FC<MomentProps> = ({ mediaType: 'any', }) .then((picture) => { - if (picture.path && picture.filename) { + if ( + picture.path && + picture.filename && + (picture.filename.endsWith('gif') || picture.filename.endsWith('GIF')) + ) { + showGIFFailureAlert(picture); + } else if (picture.path && picture.filename) { navigation.navigate('ZoomInCropper', { screenType, title, @@ -110,6 +116,42 @@ const Moment: React.FC<MomentProps> = ({ }); }; + /* Handles GIF files */ + const showGIFFailureAlert = (picture) => + Alert.alert( + 'Warning', + 'The app currently cannot handle GIFs, and will only save a static image.', + [ + { + text: 'Cancel', + onPress: () => {}, + style: 'cancel', + }, + { + text: 'Post', + 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]}> diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx index cb3a138b..f5a256d6 100644 --- a/src/components/moments/MomentPost.tsx +++ b/src/components/moments/MomentPost.tsx @@ -78,7 +78,9 @@ const MomentPost: React.FC<MomentPostProps> = ({ moment.moment_url.endsWith('jpg') || moment.moment_url.endsWith('JPG') || moment.moment_url.endsWith('PNG') || - moment.moment_url.endsWith('png') + moment.moment_url.endsWith('png') || + moment.moment_url.endsWith('GIF') || + moment.moment_url.endsWith('gif') ); /* |