From 014af4ac61bae6e38a4965ceb274b147ac3395c6 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Tue, 29 Jun 2021 23:01:24 +0900 Subject: Construct and merge with master --- src/components/moments/Moment.tsx | 45 ++++++++++++++++++++++++++++++++++- src/components/moments/MomentPost.tsx | 4 +++- 2 files changed, 47 insertions(+), 2 deletions(-) (limited to 'src') 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 = ({ 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 = ({ }); }; + /* 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 ( 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 = ({ 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') ); /* -- cgit v1.2.3-70-g09d2 From 1c1975265fb6013c34c8e766a7f11b0c5b8d1e11 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Thu, 1 Jul 2021 01:23:19 +0900 Subject: Respond to comments --- src/assets/images/test-thumbnail.jpg | Bin 0 -> 203285 bytes src/components/moments/Moment.tsx | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/assets/images/test-thumbnail.jpg (limited to 'src') diff --git a/src/assets/images/test-thumbnail.jpg b/src/assets/images/test-thumbnail.jpg new file mode 100644 index 00000000..b67eab01 Binary files /dev/null and b/src/assets/images/test-thumbnail.jpg differ diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx index 04d35825..6054639a 100644 --- a/src/components/moments/Moment.tsx +++ b/src/components/moments/Moment.tsx @@ -97,7 +97,7 @@ const Moment: React.FC = ({ picture.path && picture.filename ) { - showAlert(picture); + showGIFFailureAlert(picture); } else if (picture.path && picture.filename) { navigation.navigate('ZoomInCropper', { screenType, @@ -118,10 +118,10 @@ const Moment: React.FC = ({ }; /* Handles GIF files */ - const showAlert = (picture) => + const showGIFFailureAlert = (picture) => Alert.alert( 'Warning', - 'The cropped image will not be a GIF, but will only include the first frame of the GIF. Continue?', + 'The app currently cannot handle GIFs, and will only save a static image. Continue?', [ { text: 'Cancel', -- cgit v1.2.3-70-g09d2 From 4eda8db632ca996ff9712872b2076a8675a63523 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Thu, 1 Jul 2021 03:52:50 +0900 Subject: Updates from product --- src/components/moments/Moment.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx index 6054639a..ec9129c5 100644 --- a/src/components/moments/Moment.tsx +++ b/src/components/moments/Moment.tsx @@ -92,10 +92,9 @@ const Moment: React.FC = ({ }) .then((picture) => { if ( - (picture.filename.endsWith('gif') || - picture.filename.endsWith('GIF')) && picture.path && - picture.filename + picture.filename && + (picture.filename.endsWith('gif') || picture.filename.endsWith('GIF')) ) { showGIFFailureAlert(picture); } else if (picture.path && picture.filename) { @@ -121,7 +120,7 @@ const Moment: React.FC = ({ const showGIFFailureAlert = (picture) => Alert.alert( 'Warning', - 'The app currently cannot handle GIFs, and will only save a static image. Continue?', + 'The app currently cannot handle GIFs, and will only save a static image.', [ { text: 'Cancel', @@ -129,7 +128,7 @@ const Moment: React.FC = ({ style: 'cancel', }, { - text: 'Continue', + text: 'Post', onPress: () => { navigation.navigate('ZoomInCropper', { screenType, -- cgit v1.2.3-70-g09d2 From c6900bc62b2ea9a1eb07088ac02556c0dd1d5ebc Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Thu, 1 Jul 2021 04:00:53 +0900 Subject: Redo extraneous file --- src/assets/images/test-thumbnail.jpg | Bin 203285 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/assets/images/test-thumbnail.jpg (limited to 'src') diff --git a/src/assets/images/test-thumbnail.jpg b/src/assets/images/test-thumbnail.jpg deleted file mode 100644 index b67eab01..00000000 Binary files a/src/assets/images/test-thumbnail.jpg and /dev/null differ -- cgit v1.2.3-70-g09d2