aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/screens/upload/EditMedia.tsx61
-rw-r--r--src/utils/camera.ts7
2 files changed, 39 insertions, 29 deletions
diff --git a/src/screens/upload/EditMedia.tsx b/src/screens/upload/EditMedia.tsx
index 1d42e675..e53e2e43 100644
--- a/src/screens/upload/EditMedia.tsx
+++ b/src/screens/upload/EditMedia.tsx
@@ -339,32 +339,38 @@ export const EditMedia: React.FC<EditMediaProps> = ({route, navigation}) => {
</TouchableOpacity>
</View>
)}
- <View style={styles.bottomContainer}>
- <SaveButton
- style={styles.saveButton}
- onPress={() => processVideo(saveImageToGallery)}
- />
- <TaggSquareButton
- style={styles.button}
- onPress={() =>
- processVideo((uri) =>
- navigation.navigate('CaptionScreen', {
- screenType,
- media: {
- uri: uri,
- isVideo: media.isVideo,
- },
- selectedCategory,
- }),
- )
- }
- title={'Next'}
- buttonStyle={'large'}
- buttonColor={'blue'}
- labelColor={'white'}
- labelStyle={styles.buttonLabel}
- />
- </View>
+ {hideTrimmer && (
+ <View style={styles.bottomContainer}>
+ <SaveButton
+ style={styles.saveButton}
+ onPress={() =>
+ processVideo((uri) =>
+ saveImageToGallery(uri, media.isVideo ? 'video' : 'photo'),
+ )
+ }
+ />
+ <TaggSquareButton
+ style={styles.button}
+ onPress={() =>
+ processVideo((uri) =>
+ navigation.navigate('CaptionScreen', {
+ screenType,
+ media: {
+ uri: uri,
+ isVideo: media.isVideo,
+ },
+ selectedCategory,
+ }),
+ )
+ }
+ title={'Next'}
+ buttonStyle={'large'}
+ buttonColor={'blue'}
+ labelColor={'white'}
+ labelStyle={styles.buttonLabel}
+ />
+ </View>
+ )}
</View>
);
};
@@ -383,9 +389,10 @@ const styles = StyleSheet.create({
marginLeft: '5%',
},
bottomContainer: {
+ position: 'absolute',
+ bottom: SCREEN_HEIGHT * 0.1,
width: SCREEN_WIDTH * 0.8,
justifyContent: 'space-between',
- marginBottom: SCREEN_HEIGHT * 0.1,
alignItems: 'center',
alignSelf: 'center',
flexDirection: 'row',
diff --git a/src/utils/camera.ts b/src/utils/camera.ts
index 5485b1ca..9d7ff67f 100644
--- a/src/utils/camera.ts
+++ b/src/utils/camera.ts
@@ -48,8 +48,11 @@ export const takeVideo = (
}
};
-export const saveImageToGallery = (capturedImageURI: string) => {
- CameraRoll.save(capturedImageURI, {album: 'Recents', type: 'photo'})
+export const saveImageToGallery = (
+ capturedImageURI: string,
+ type: 'photo' | 'video',
+) => {
+ CameraRoll.save(capturedImageURI, {album: 'Recents', type: type})
.then((_res) => Alert.alert('Saved to device!'))
.catch((_err) => Alert.alert('Failed to save to device!'));
};