aboutsummaryrefslogtreecommitdiff
path: root/src/components/camera/FlashButton.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/camera/FlashButton.tsx')
-rw-r--r--src/components/camera/FlashButton.tsx53
1 files changed, 30 insertions, 23 deletions
diff --git a/src/components/camera/FlashButton.tsx b/src/components/camera/FlashButton.tsx
index 06a4e44e..65c773d9 100644
--- a/src/components/camera/FlashButton.tsx
+++ b/src/components/camera/FlashButton.tsx
@@ -1,8 +1,9 @@
+import {BlurView} from '@react-native-community/blur';
import React, {Dispatch, SetStateAction} from 'react';
-import {Text, TouchableOpacity} from 'react-native';
+import {Text, TouchableOpacity, View} from 'react-native';
import {FlashMode} from 'react-native-camera';
-import FlashOffIcon from '../../assets/icons/camera/flash-off.svg';
import FlashOnIcon from '../../assets/icons/camera/flash-on.svg';
+import FlashOffIcon from '../../assets/icons/camera/flash-off.svg';
import {styles} from './styles';
interface FlashButtonProps {
@@ -16,27 +17,33 @@ interface FlashButtonProps {
export const FlashButton: React.FC<FlashButtonProps> = ({
flashMode,
setFlashMode,
-}) => (
- <TouchableOpacity
- onPress={() => setFlashMode(flashMode === 'on' ? 'off' : 'on')}
- style={styles.flashButtonContainer}>
- {flashMode === 'on' ? (
- <FlashOnIcon
- height={30}
- width={20}
- color={'white'}
- style={styles.flashIcon}
- />
- ) : (
- <FlashOffIcon
- height={30}
- width={20}
- color={'white'}
- style={styles.flashIcon}
+}) => {
+ return (
+ <>
+ <BlurView
+ blurType={'ultraThinMaterialDark'}
+ blurAmount={1}
+ style={styles.blurView}
/>
- )}
- <Text style={styles.saveButtonLabel}>Flash</Text>
- </TouchableOpacity>
-);
+ <TouchableOpacity
+ onPress={() => setFlashMode(flashMode === 'on' ? 'off' : 'on')}
+ style={styles.flashButtonContainerBackground}>
+ <View
+ style={[
+ styles.flashButtonContainer,
+ // eslint-disable-next-line react-native/no-inline-styles
+ {opacity: flashMode === 'off' ? 0.5 : 1},
+ ]}>
+ {flashMode === 'off' ? (
+ <FlashOffIcon height={30} width={20} color={'white'} />
+ ) : (
+ <FlashOnIcon height={30} width={20} color={'white'} />
+ )}
+ <Text style={styles.saveButtonLabel}>Flash</Text>
+ </View>
+ </TouchableOpacity>
+ </>
+ );
+};
export default FlashButton;