diff --git a/components/CameraScreen.tsx b/components/CameraScreen.tsx index 14a56acf8..cc3d75eae 100644 --- a/components/CameraScreen.tsx +++ b/components/CameraScreen.tsx @@ -1,19 +1,19 @@ import React, { useState, useRef } from 'react'; -import { Animated, ImageURISource, SafeAreaView, StatusBar, StyleSheet, TouchableOpacity, View } from 'react-native'; +import { Animated, SafeAreaView, StatusBar, StyleSheet, TouchableOpacity, View } from 'react-native'; import { Camera, CameraApi, CameraType, Orientation } from 'react-native-camera-kit'; import loc from '../loc'; import { Icon } from '@rneui/base'; +const AnimatedIcon = Animated.createAnimatedComponent(Icon); + interface CameraScreenProps { onCancelButtonPress: () => void; showImagePickerButton?: boolean; showFilePickerButton?: boolean; onImagePickerButtonPress?: () => void; onFilePickerButtonPress?: () => void; - torchOnImage?: ImageURISource; - torchOffImage?: ImageURISource; + onReadCode?: (event: any) => void; - cameraFlipImage?: ImageURISource; } const CameraScreen: React.FC = ({ @@ -22,10 +22,8 @@ const CameraScreen: React.FC = ({ showFilePickerButton, onImagePickerButtonPress, onFilePickerButtonPress, - torchOnImage, - torchOffImage, + onReadCode, - cameraFlipImage, }) => { const cameraRef = useRef(null); const [torchMode, setTorchMode] = useState(false); @@ -51,7 +49,7 @@ const CameraScreen: React.FC = ({ inputRange: [1, 4], outputRange: ['180deg', '-90deg'], }); - const uiRotationStyle = rotateUi ? { transform: [{ rotate: uiRotation }] } : undefined; + const uiRotationStyle = rotateUi ? { transform: [{ rotate: uiRotation }] } : {}; function rotateUiTo(rotationValue: number) { Animated.timing(orientationAnim, { @@ -67,10 +65,11 @@ const CameraScreen: React.FC = ({