react-native-biometric-verifier 0.0.12 → 0.0.13

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.
@@ -15,6 +15,21 @@ export const COLORS = {
15
15
  textLight: '#FFFFFF',
16
16
  shadow: '#00000033', // semi-transparent shadow
17
17
  };
18
+ // utils/constants.js
19
+ export const LOADING_TYPES = {
20
+ NONE: 'NONE',
21
+ CAMERA_INIT: 'CAMERA_INIT',
22
+ CAPTURING_PHOTO: 'CAPTURING_PHOTO',
23
+ IMAGE_PROCESSING: 'IMAGE_PROCESSING',
24
+ FACE_RECOGNITION: 'FACE_RECOGNITION',
25
+ NETWORK_REQUEST: 'NETWORK_REQUEST',
26
+ LOCATION_PERMISSION: 'LOCATION_PERMISSION',
27
+ GETTING_LOCATION: 'GETTING_LOCATION',
28
+ CALCULATING_DISTANCE: 'CALCULATING_DISTANCE',
29
+ LOCATION_VERIFICATION: 'LOCATION_VERIFICATION',
30
+ };
31
+
32
+ // Rest of your existing constants...
18
33
 
19
34
  // ====== ANIMATION STATES ======
20
35
  export const ANIMATION_STATES = {
@@ -1,61 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { View, Text, Image } from 'react-native';
3
- import Icon from 'react-native-vector-icons/MaterialIcons';
4
- import PropTypes from 'prop-types';
5
- import { COLORS} from '../utils/constants';
6
- import { styles } from './styles';
7
-
8
- export const EmployeeCard = ({ employeeData,apiurl }) => {
9
- const [imageError, setImageError] = useState(false);
10
-
11
- if (!employeeData || typeof employeeData !== 'object') {
12
- console.warn('EmployeeCard: Invalid or missing employeeData');
13
- return null;
14
- }
15
-
16
- const { facename, faceid, imageurl } = employeeData;
17
-
18
- const employeeName = facename || 'Unknown Employee';
19
- const employeeId = faceid || 'N/A';
20
- const imageSource = !imageError && imageurl
21
- ? { uri: `${apiurl}file/filedownload/photo/${imageurl}` }
22
- : { uri: `${apiurl}file/getCommonFile/image/camera.png` }; // Add a local fallback image in assets
23
-
24
- return (
25
- <View style={styles.employeeCard}>
26
- {/* Employee Image */}
27
- <View style={styles.employeeImageContainer}>
28
- <Image
29
- source={imageSource}
30
- style={styles.employeeImage}
31
- resizeMode="cover"
32
- onError={() => {
33
- console.error(`Error loading image for employee: ${employeeName}`);
34
- setImageError(true);
35
- }}
36
- />
37
- <View style={styles.employeeImageOverlay} />
38
- </View>
39
-
40
- {/* Employee Info */}
41
- <Text style={styles.empName}>{employeeName}</Text>
42
- <Text style={styles.empId}> ID: {employeeId}</Text>
43
-
44
- {/* Verified Badge */}
45
- <View style={styles.employeeDetails}>
46
- <View style={styles.detailItem}>
47
- <Icon name="verified-user" size={16} color={COLORS.success} />
48
- <Text style={styles.detailText}>Identity Verified</Text>
49
- </View>
50
- </View>
51
- </View>
52
- );
53
- };
54
-
55
- EmployeeCard.propTypes = {
56
- employeeData: PropTypes.shape({
57
- facename: PropTypes.string,
58
- faceid: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
59
- imageurl: PropTypes.string,
60
- }),
61
- };
@@ -1,200 +0,0 @@
1
- import { StyleSheet, Platform } from 'react-native';
2
- import { COLORS } from '../utils/constants';
3
-
4
- export const styles = StyleSheet.create({
5
- modalBg: {
6
- flex: 1,
7
- backgroundColor: 'rgba(0, 0, 0, 0.7)',
8
- justifyContent: 'center',
9
- alignItems: 'center',
10
- paddingHorizontal: 20,
11
- },
12
- close: {
13
- position: 'absolute',
14
- top: 20,
15
- right: 20,
16
- zIndex: 10,
17
- backgroundColor: 'rgba(255, 255, 255, 0.2)',
18
- borderRadius: 20,
19
- padding: 5,
20
- },
21
- title: {
22
- fontSize: 26,
23
- fontWeight: '700',
24
- color: COLORS.light,
25
- marginBottom: 5,
26
- textAlign: 'center',
27
- fontFamily: Platform.OS === 'ios' ? 'Helvetica Neue' : 'sans-serif',
28
- },
29
- subTitle: {
30
- fontSize: 18,
31
- color: COLORS.light,
32
- marginBottom: 25,
33
- fontWeight: '600',
34
- textAlign: 'center',
35
- opacity: 0.9,
36
- fontFamily: Platform.OS === 'ios' ? 'Helvetica Neue' : 'sans-serif-medium',
37
- },
38
- indicatorContainer: {
39
- justifyContent: 'center',
40
- alignItems: 'center',
41
- marginVertical: 25,
42
- },
43
- employeeCard: {
44
- alignItems: 'center',
45
- marginVertical: 20,
46
- width: '100%',
47
- padding: 20,
48
- backgroundColor: 'rgba(255, 255, 255, 0.9)',
49
- borderRadius: 16,
50
- shadowColor: '#000',
51
- shadowOffset: { width: 0, height: 4 },
52
- shadowOpacity: 0.1,
53
- shadowRadius: 6,
54
- elevation: 3,
55
- },
56
- employeeImageContainer: {
57
- width: 100,
58
- height: 100,
59
- borderRadius: 50,
60
- borderWidth: 3,
61
- borderColor: COLORS.primary,
62
- position: 'relative',
63
- overflow: 'hidden',
64
- },
65
- employeeImage: {
66
- width: '100%',
67
- height: '100%',
68
- },
69
- employeeImageOverlay: {
70
- ...StyleSheet.absoluteFillObject,
71
- backgroundColor: 'rgba(108, 99, 255, 0.1)',
72
- },
73
- empName: {
74
- fontSize: 20,
75
- fontWeight: '600',
76
- marginTop: 15,
77
- color: COLORS.dark,
78
- fontFamily: Platform.OS === 'ios' ? 'Helvetica Neue' : 'sans-serif-medium',
79
- },
80
- empId: {
81
- fontSize: 15,
82
- color: COLORS.gray,
83
- marginTop: 5,
84
- fontFamily: Platform.OS === 'ios' ? 'Helvetica Neue' : 'sans-serif',
85
- },
86
- employeeDetails: {
87
- flexDirection: 'row',
88
- marginTop: 15,
89
- justifyContent: 'center',
90
- flexWrap: 'wrap',
91
- },
92
- detailItem: {
93
- flexDirection: 'row',
94
- alignItems: 'center',
95
- marginHorizontal: 8,
96
- marginVertical: 4,
97
- },
98
- detailText: {
99
- fontSize: 13,
100
- color: COLORS.gray,
101
- marginLeft: 5,
102
- fontFamily: Platform.OS === 'ios' ? 'Helvetica Neue' : 'sans-serif',
103
- },
104
- notificationBox: {
105
- padding: 15,
106
- borderRadius: 12,
107
- marginVertical: 10,
108
- width: '100%',
109
- flexDirection: 'row',
110
- alignItems: 'center',
111
- shadowColor: '#000',
112
- shadowOffset: { width: 0, height: 2 },
113
- shadowOpacity: 0.1,
114
- shadowRadius: 4,
115
- elevation: 2,
116
- },
117
- info: {
118
- backgroundColor: 'rgba(33, 150, 243, 0.15)',
119
- borderLeftWidth: 4,
120
- borderLeftColor: COLORS.light,
121
- },
122
- success: {
123
- backgroundColor: 'rgba(76, 175, 80, 0.15)',
124
- borderLeftWidth: 4,
125
- borderLeftColor: COLORS.success,
126
- },
127
- error: {
128
- backgroundColor: 'rgba(244, 67, 54, 0.15)',
129
- borderLeftWidth: 4,
130
- borderLeftColor: COLORS.error,
131
- },
132
- notificationIcon: {
133
- marginRight: 10,
134
- },
135
- notificationText: {
136
- fontSize: 14,
137
- color: COLORS.light,
138
- fontWeight: '500',
139
- flex: 1,
140
- fontFamily: Platform.OS === 'ios' ? 'Helvetica Neue' : 'sans-serif',
141
- },
142
- timerContainer: {
143
- marginTop: 20,
144
- alignItems: 'center',
145
- },
146
- timerCircle: {
147
- width: 80,
148
- height: 80,
149
- borderRadius: 40,
150
- backgroundColor: 'rgba(255, 255, 255, 0.2)',
151
- justifyContent: 'center',
152
- alignItems: 'center',
153
- position: 'relative',
154
- },
155
- timerProgressContainer: {
156
- position: 'absolute',
157
- width: '100%',
158
- height: '100%',
159
- },
160
- timerProgress: {
161
- width: 76,
162
- height: 76,
163
- borderRadius: 38,
164
- borderWidth: 3,
165
- borderColor: COLORS.light,
166
- borderLeftColor: 'transparent',
167
- borderBottomColor: 'transparent',
168
- },
169
- timerText: {
170
- fontSize: 20,
171
- fontWeight: '700',
172
- color: COLORS.light,
173
- fontFamily: Platform.OS === 'ios' ? 'Helvetica Neue' : 'sans-serif-medium',
174
- },
175
- timerLabel: {
176
- fontSize: 14,
177
- color: COLORS.light,
178
- marginTop: 5,
179
- opacity: 0.8,
180
- fontFamily: Platform.OS === 'ios' ? 'Helvetica Neue' : 'sans-serif',
181
- },
182
- capturedImageContainer: {
183
- marginVertical: 15,
184
- alignItems: 'center',
185
- justifyContent: 'center',
186
- },
187
- capturedImage: {
188
- width: 120,
189
- height: 120,
190
- borderRadius: 10,
191
- borderWidth: 2,
192
- borderColor: COLORS.primary,
193
- },
194
- capturedImageText: {
195
- marginTop: 8,
196
- fontSize: 14,
197
- color: COLORS.light,
198
- textAlign: 'center',
199
- },
200
- });