aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-07-16 14:25:42 -0400
committerIvan Chen <ivan@tagg.id>2021-07-16 14:25:42 -0400
commitcd05de0e8f95fca4086977fefdd0b8ea8f7ef687 (patch)
tree4bdec43be95c7a9cd9e434700cfd1ec99bb4d6ae
parent17ac3b21f6db0107d3c5eeb8885884fa8cfa5a72 (diff)
Hide capture button
-rw-r--r--src/screens/moments/CameraScreen.tsx60
1 files changed, 34 insertions, 26 deletions
diff --git a/src/screens/moments/CameraScreen.tsx b/src/screens/moments/CameraScreen.tsx
index ee5834cb..18e04261 100644
--- a/src/screens/moments/CameraScreen.tsx
+++ b/src/screens/moments/CameraScreen.tsx
@@ -123,33 +123,37 @@ const CameraScreen: React.FC<CameraScreenProps> = ({route, navigation}) => {
) : (
<FlipButton cameraType={cameraType} setCameraType={setCameraType} />
)}
- <TouchableOpacity
- activeOpacity={1}
- onLongPress={() => {
- takeVideo(cameraRef, (vid) => {
- navigateToCaptionScreen(true, vid.uri);
- });
- setIsRecording(true);
- }}
- onPressOut={async () => {
- if (await cameraRef.current?.isRecording()) {
- cameraRef.current?.stopRecording();
- setIsRecording(false);
+ {!showSaveButton ? (
+ <TouchableOpacity
+ style={
+ isRecording
+ ? styles.captureButtonVideoContainer
+ : styles.captureButtonContainer
}
- }}
- onPress={() => {
- takePicture(cameraRef, (pic) => {
- setShowSaveButton(true);
- setMediaFromGallery(pic.uri);
- });
- }}
- style={
- isRecording
- ? styles.captureButtonVideoContainer
- : styles.captureButtonContainer
- }>
- <View style={styles.captureButton} />
- </TouchableOpacity>
+ activeOpacity={1}
+ onLongPress={() => {
+ takeVideo(cameraRef, (vid) => {
+ navigateToCaptionScreen(true, vid.uri);
+ });
+ setIsRecording(true);
+ }}
+ onPressOut={async () => {
+ if (await cameraRef.current?.isRecording()) {
+ cameraRef.current?.stopRecording();
+ setIsRecording(false);
+ }
+ }}
+ onPress={() => {
+ takePicture(cameraRef, (pic) => {
+ setShowSaveButton(true);
+ setMediaFromGallery(pic.uri);
+ });
+ }}>
+ <View style={styles.captureButton} />
+ </TouchableOpacity>
+ ) : (
+ <View style={styles.captureButtonPlaceholder} />
+ )}
{isRecording && (
<AnimatedCircularProgress
size={95}
@@ -217,6 +221,10 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
},
+ captureButtonPlaceholder: {
+ width: 93,
+ height: 93,
+ },
captureButtonContainer: {
alignSelf: 'center',
backgroundColor: 'transparent',