@holper/react-native-holper-storybook 0.6.80 → 0.6.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -106,7 +106,7 @@ const TakePicture = ({
|
|
|
106
106
|
onClose();
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
if (!permission
|
|
109
|
+
if (!permission?.granted) {
|
|
110
110
|
return (
|
|
111
111
|
<View style={style.cameraPermissionsContainer}>
|
|
112
112
|
<Text color='red'>{cameraErrorMessage}</Text>
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
ActivityIndicator,
|
|
7
7
|
Platform,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
import { CameraView, useCameraPermissions } from 'expo-camera';
|
|
10
9
|
import * as MediaLibrary from 'expo-media-library';
|
|
11
10
|
import * as ExpoImagePicker from 'expo-image-picker';
|
|
12
11
|
import Text from '../Text';
|
|
@@ -35,7 +34,6 @@ const UploadDocument = ({
|
|
|
35
34
|
file,
|
|
36
35
|
onPermissionDenied,
|
|
37
36
|
}) => {
|
|
38
|
-
const [permission, requestPermission] = useCameraPermissions();
|
|
39
37
|
const [showMediaModal, setShowMediaModal] = useState(false);
|
|
40
38
|
const [showCamera, setShowCamera] = useState(false);
|
|
41
39
|
const [image, setImage] = useState(null);
|
|
@@ -43,7 +41,6 @@ const UploadDocument = ({
|
|
|
43
41
|
|
|
44
42
|
useEffect(() => {
|
|
45
43
|
(async () => {
|
|
46
|
-
await requestPermission();
|
|
47
44
|
iOS
|
|
48
45
|
? await MediaLibrary.requestPermissionsAsync()
|
|
49
46
|
: await ExpoImagePicker.getMediaLibraryPermissionsAsync();
|
|
@@ -62,11 +59,6 @@ const UploadDocument = ({
|
|
|
62
59
|
switch (method) {
|
|
63
60
|
case 'camera':
|
|
64
61
|
setTimeout(async () => {
|
|
65
|
-
if (permission && permission.status !== 'granted') {
|
|
66
|
-
onPermissionDenied();
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
62
|
setShowCamera(true);
|
|
71
63
|
}, 500);
|
|
72
64
|
break;
|