From f62eaec4f70ffaf1c5bf82a831acff542eec4957 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Fri, 2 Jul 2021 16:14:30 -0400 Subject: Support picking video from gallery --- src/screens/moments/CameraScreen.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/screens') diff --git a/src/screens/moments/CameraScreen.tsx b/src/screens/moments/CameraScreen.tsx index 0f2e3b5d..c759e5db 100644 --- a/src/screens/moments/CameraScreen.tsx +++ b/src/screens/moments/CameraScreen.tsx @@ -129,7 +129,6 @@ const CameraScreen: React.FC = ({route, navigation}) => { onPressOut={async () => { if (await cameraRef.current?.isRecording()) { cameraRef.current?.stopRecording(); - } else { } }} onPress={() => { @@ -155,15 +154,20 @@ const CameraScreen: React.FC = ({route, navigation}) => { ) : ( { - const filename = pic.filename; + callback={(media) => { + const filename = media.filename; if ( filename && (filename.endsWith('gif') || filename.endsWith('GIF')) ) { - showGIFFailureAlert(() => navigateToCropper(pic.path)); + showGIFFailureAlert(() => navigateToCropper(media.path)); } else { - navigateToCropper(pic.path); + // is this a video? + if (media.duration !== null) { + navigateToCaptionScreen(true, media.path); + } else { + navigateToCropper(media.path); + } } }} /> -- cgit v1.2.3-70-g09d2