@holper/react-native-holper-storybook 0.6.75 → 0.6.77
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.
- package/lib/components/CustomChatView/index.js +73 -0
- package/lib/components/CustomChatView/style.js +10 -0
- package/lib/components/TakePicture/index.js +23 -45
- package/lib/components/TakePicture/style.js +19 -11
- package/lib/components/UploadDocument/index.js +8 -6
- package/lib/components/index.js +28 -27
- package/lib/configs/constants.js +123 -122
- package/package.json +33 -17
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import MapView, { PROVIDER_GOOGLE } from "react-native-maps";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Platform, TouchableOpacity, Alert, Linking } from "react-native";
|
|
5
|
+
import { MapStyle } from "../../configs/constants";
|
|
6
|
+
import styles from "./style";
|
|
7
|
+
|
|
8
|
+
const CustomChatView = ({ currentMessage, containerStyle, mapViewStyle }) => {
|
|
9
|
+
const openMapAsync = async () => {
|
|
10
|
+
const { location = {} } = currentMessage;
|
|
11
|
+
|
|
12
|
+
const mapScheme = Platform.select({
|
|
13
|
+
ios: "maps:0,0?q=",
|
|
14
|
+
android: "geo:0,0?q=",
|
|
15
|
+
});
|
|
16
|
+
const latLng = `${location.latitude},${location.longitude}`;
|
|
17
|
+
const label = `${currentMessage.user.name}`;
|
|
18
|
+
|
|
19
|
+
const url = Platform.select({
|
|
20
|
+
ios: `${mapScheme}${label}@${latLng}`,
|
|
21
|
+
android: `${mapScheme}${latLng}(${label})`,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const supported = await Linking.canOpenURL(url);
|
|
26
|
+
if (supported) {
|
|
27
|
+
return Linking.openURL(url);
|
|
28
|
+
}
|
|
29
|
+
Alert.alert("Opening the map is not supported.");
|
|
30
|
+
} catch ({ message }) {
|
|
31
|
+
Alert.alert(message);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
if (currentMessage.location) {
|
|
36
|
+
return (
|
|
37
|
+
<TouchableOpacity
|
|
38
|
+
style={[styles.container, containerStyle]}
|
|
39
|
+
onPress={openMapAsync}
|
|
40
|
+
>
|
|
41
|
+
<MapView
|
|
42
|
+
style={[styles.mapView, mapViewStyle]}
|
|
43
|
+
region={{
|
|
44
|
+
latitude: currentMessage.location.latitude,
|
|
45
|
+
longitude: currentMessage.location.longitude,
|
|
46
|
+
latitudeDelta: currentMessage.location.latitudeDelta || 0.0922,
|
|
47
|
+
longitudeDelta: currentMessage.location.longitudeDelta || 0.0421,
|
|
48
|
+
}}
|
|
49
|
+
customMapStyle={MapStyle}
|
|
50
|
+
provider={PROVIDER_GOOGLE}
|
|
51
|
+
scrollEnabled={false}
|
|
52
|
+
zoomEnabled={false}
|
|
53
|
+
/>
|
|
54
|
+
</TouchableOpacity>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return null;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
CustomChatView.propTypes = {
|
|
62
|
+
currentMessage: PropTypes.object,
|
|
63
|
+
containerStyle: PropTypes.object,
|
|
64
|
+
mapViewStyle: PropTypes.object,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
CustomChatView.defaultProps = {
|
|
68
|
+
currentMessage: {},
|
|
69
|
+
containerStyle: {},
|
|
70
|
+
mapViewStyle: {},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default CustomChatView;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useRef
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import {
|
|
4
4
|
Modal,
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
ActivityIndicator,
|
|
9
9
|
} from 'react-native';
|
|
10
10
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
11
|
-
import {
|
|
11
|
+
import { CameraView, useCameraPermissions } from 'expo-camera';
|
|
12
12
|
import * as ImageManipulator from 'expo-image-manipulator';
|
|
13
13
|
import { Svg, Defs, Rect, Mask, Circle } from 'react-native-svg';
|
|
14
14
|
import Text from '../Text';
|
|
15
15
|
import Container from '../Container';
|
|
16
|
-
import
|
|
16
|
+
import Button from '../Button';
|
|
17
17
|
import { Colors } from '../../configs/constants';
|
|
18
18
|
import { ConfirmPictureModal } from './confirmPictureModal';
|
|
19
19
|
import style from './style';
|
|
@@ -47,44 +47,19 @@ const TakePicture = ({
|
|
|
47
47
|
onClose,
|
|
48
48
|
avatar,
|
|
49
49
|
cameraErrorMessage,
|
|
50
|
+
requestPermissionsMessage,
|
|
50
51
|
processingPictureMessage,
|
|
51
52
|
repeatPictureText,
|
|
52
53
|
usePictureText,
|
|
53
54
|
}) => {
|
|
54
|
-
const [
|
|
55
|
-
const [type, setType] = useState(
|
|
55
|
+
const [permission, requestPermission] = useCameraPermissions();
|
|
56
|
+
const [type, setType] = useState('back');
|
|
56
57
|
const [image, setImage] = useState(null);
|
|
57
58
|
const [takingPicture, setTakingPicture] = useState(false);
|
|
58
|
-
const [ratio, setRatio] = useState(DESIRED_RATIO);
|
|
59
59
|
const camera = useRef();
|
|
60
60
|
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
(async () => {
|
|
63
|
-
const { status } = await Camera.requestCameraPermissionsAsync();
|
|
64
|
-
setHasCameraPermission(status === 'granted');
|
|
65
|
-
})();
|
|
66
|
-
}, [visible]);
|
|
67
|
-
|
|
68
|
-
const prepareRatio = async () => {
|
|
69
|
-
if (isAndroid && camera) {
|
|
70
|
-
const ratios = await Camera.getSupportedRatiosAsync();
|
|
71
|
-
|
|
72
|
-
// See if the current device has your desired ratio, otherwise get the maximum supported one
|
|
73
|
-
// Usually the last element of 'ratios' is the maximum supported ratio
|
|
74
|
-
const supportedRatio =
|
|
75
|
-
ratios.find((ratio) => ratio === DESIRED_RATIO) ||
|
|
76
|
-
ratios[ratios.length - 1];
|
|
77
|
-
|
|
78
|
-
setRatio(supportedRatio);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
61
|
const flipCamera = () => {
|
|
83
|
-
setType(
|
|
84
|
-
type === Camera.Constants.Type.back
|
|
85
|
-
? Camera.Constants.Type.front
|
|
86
|
-
: Camera.Constants.Type.back
|
|
87
|
-
);
|
|
62
|
+
setType((current) => (current === 'back' ? 'front' : 'back'));
|
|
88
63
|
};
|
|
89
64
|
|
|
90
65
|
const takePicture = async () => {
|
|
@@ -131,12 +106,15 @@ const TakePicture = ({
|
|
|
131
106
|
onClose();
|
|
132
107
|
};
|
|
133
108
|
|
|
134
|
-
if (
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
109
|
+
if (!permission || permission.status !== 'granted') {
|
|
110
|
+
return (
|
|
111
|
+
<View style={style.cameraPermissionsContainer}>
|
|
112
|
+
<Text color='red'>{cameraErrorMessage}</Text>
|
|
113
|
+
<Button onPress={requestPermission} color='inverted'>
|
|
114
|
+
<Text color='white'>{requestPermissionsMessage}</Text>
|
|
115
|
+
</Button>
|
|
116
|
+
</View>
|
|
117
|
+
);
|
|
140
118
|
}
|
|
141
119
|
|
|
142
120
|
return (
|
|
@@ -144,16 +122,14 @@ const TakePicture = ({
|
|
|
144
122
|
animationType='slide'
|
|
145
123
|
transparent={false}
|
|
146
124
|
visible={visible}
|
|
147
|
-
onRequestClose={
|
|
125
|
+
onRequestClose={onClose}
|
|
148
126
|
>
|
|
149
127
|
<Container style={style.cameraContainer}>
|
|
150
|
-
<
|
|
128
|
+
<CameraView
|
|
151
129
|
ref={camera}
|
|
152
130
|
style={style.cameraContainer}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
onCameraReady={prepareRatio} // You can only get the supported ratios when the camera is mounted
|
|
156
|
-
ratio={ratio}
|
|
131
|
+
facing={type}
|
|
132
|
+
ratio={DESIRED_RATIO}
|
|
157
133
|
>
|
|
158
134
|
{avatar && isiOS && <SvgCircle />}
|
|
159
135
|
|
|
@@ -186,7 +162,7 @@ const TakePicture = ({
|
|
|
186
162
|
</View>
|
|
187
163
|
|
|
188
164
|
{avatar && isAndroid && <SvgCircle />}
|
|
189
|
-
</
|
|
165
|
+
</CameraView>
|
|
190
166
|
|
|
191
167
|
{takingPicture && (
|
|
192
168
|
<View style={style.cameraTakingPictureOverlay}>
|
|
@@ -212,6 +188,7 @@ TakePicture.defaultProps = {
|
|
|
212
188
|
onClose: () => {},
|
|
213
189
|
avatar: false,
|
|
214
190
|
cameraErrorMessage: ' ',
|
|
191
|
+
requestPermissionsMessage: ' ',
|
|
215
192
|
processingPictureMessage: ' ',
|
|
216
193
|
repeatPictureText: ' ',
|
|
217
194
|
usePictureText: ' ',
|
|
@@ -222,6 +199,7 @@ TakePicture.propTypes = {
|
|
|
222
199
|
onClose: PropTypes.func.isRequired,
|
|
223
200
|
avatar: PropTypes.bool,
|
|
224
201
|
cameraErrorMessage: PropTypes.string.isRequired,
|
|
202
|
+
requestPermissionsMessage: PropTypes.string.isRequired,
|
|
225
203
|
processingPictureMessage: PropTypes.string.isRequired,
|
|
226
204
|
repeatPictureText: PropTypes.string.isRequired,
|
|
227
205
|
usePictureText: PropTypes.string.isRequired,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
cameraContainer: {
|
|
8
8
|
flex: 1,
|
|
9
9
|
...StyleSheet.absoluteFillObject,
|
|
10
|
-
position: 'absolute'
|
|
10
|
+
position: 'absolute',
|
|
11
11
|
},
|
|
12
12
|
closeIcon: {
|
|
13
13
|
position: 'absolute',
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
borderRadius: 15,
|
|
20
20
|
backgroundColor: Colors.lightblue,
|
|
21
21
|
alignItems: 'center',
|
|
22
|
-
justifyContent: 'center'
|
|
22
|
+
justifyContent: 'center',
|
|
23
23
|
},
|
|
24
24
|
cameraFlipContainer: {
|
|
25
25
|
flex: 1,
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
flexDirection: 'row',
|
|
28
28
|
position: 'relative',
|
|
29
29
|
marginBottom: 20,
|
|
30
|
-
...StyleSheet.absoluteFillObject
|
|
30
|
+
...StyleSheet.absoluteFillObject,
|
|
31
31
|
},
|
|
32
32
|
cameraFlipBtn: {
|
|
33
33
|
flex: 0.2,
|
|
@@ -35,17 +35,17 @@ export default {
|
|
|
35
35
|
alignItems: 'center',
|
|
36
36
|
paddingLeft: 15,
|
|
37
37
|
paddingBottom: 10,
|
|
38
|
-
height: 60
|
|
38
|
+
height: 60,
|
|
39
39
|
},
|
|
40
40
|
cameraFlipIcon: {
|
|
41
41
|
position: 'absolute',
|
|
42
42
|
bottom: 10,
|
|
43
|
-
left: 25
|
|
43
|
+
left: 25,
|
|
44
44
|
},
|
|
45
45
|
cameraRecordBtn: {
|
|
46
46
|
position: 'absolute',
|
|
47
47
|
bottom: 0,
|
|
48
|
-
left:
|
|
48
|
+
left: width / 2 - 25,
|
|
49
49
|
},
|
|
50
50
|
cameraRetakePhoto: {
|
|
51
51
|
height: 40,
|
|
@@ -58,17 +58,17 @@ export default {
|
|
|
58
58
|
paddingHorizontal: 30,
|
|
59
59
|
position: 'absolute',
|
|
60
60
|
bottom: 0,
|
|
61
|
-
left: 0
|
|
61
|
+
left: 0,
|
|
62
62
|
},
|
|
63
63
|
cameraRetakePhotoText: {
|
|
64
|
-
color: Colors.white
|
|
64
|
+
color: Colors.white,
|
|
65
65
|
},
|
|
66
66
|
cameraTakingPictureOverlay: {
|
|
67
67
|
...StyleSheet.absoluteFillObject,
|
|
68
68
|
justifyContent: 'center',
|
|
69
69
|
alignItems: 'center',
|
|
70
70
|
zIndex: 999,
|
|
71
|
-
backgroundColor: 'rgba(0, 0, 0, 0.8)'
|
|
71
|
+
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
|
72
72
|
},
|
|
73
73
|
cameraTakenImageContainer: {
|
|
74
74
|
backgroundColor: 'rgba(0,0,0,0.9)',
|
|
@@ -76,12 +76,20 @@ export default {
|
|
|
76
76
|
...StyleSheet.absoluteFillObject,
|
|
77
77
|
position: 'absolute',
|
|
78
78
|
justifyContent: 'center',
|
|
79
|
-
alignItems: 'center'
|
|
79
|
+
alignItems: 'center',
|
|
80
80
|
},
|
|
81
81
|
cameraTakenImage: {
|
|
82
82
|
width: width - 30,
|
|
83
83
|
height: width - 30,
|
|
84
84
|
alignSelf: 'center',
|
|
85
|
-
position: 'relative'
|
|
85
|
+
position: 'relative',
|
|
86
|
+
},
|
|
87
|
+
cameraPermissionsContainer: {
|
|
88
|
+
flex: 1,
|
|
89
|
+
...StyleSheet.absoluteFillObject,
|
|
90
|
+
position: 'absolute',
|
|
91
|
+
backgroundColor: Colors.white,
|
|
92
|
+
justifyContent: 'center',
|
|
93
|
+
alignItems: 'center',
|
|
86
94
|
},
|
|
87
95
|
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ActivityIndicator,
|
|
7
7
|
Platform,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
import {
|
|
9
|
+
import { CameraView, useCameraPermissions } from 'expo-camera';
|
|
10
10
|
import * as MediaLibrary from 'expo-media-library';
|
|
11
11
|
import * as ExpoImagePicker from 'expo-image-picker';
|
|
12
12
|
import Text from '../Text';
|
|
@@ -35,6 +35,7 @@ const UploadDocument = ({
|
|
|
35
35
|
file,
|
|
36
36
|
onPermissionDenied,
|
|
37
37
|
}) => {
|
|
38
|
+
const [permission, requestPermission] = useCameraPermissions();
|
|
38
39
|
const [showMediaModal, setShowMediaModal] = useState(false);
|
|
39
40
|
const [showCamera, setShowCamera] = useState(false);
|
|
40
41
|
const [image, setImage] = useState(null);
|
|
@@ -42,7 +43,7 @@ const UploadDocument = ({
|
|
|
42
43
|
|
|
43
44
|
useEffect(() => {
|
|
44
45
|
(async () => {
|
|
45
|
-
await
|
|
46
|
+
await requestPermission();
|
|
46
47
|
iOS
|
|
47
48
|
? await MediaLibrary.requestPermissionsAsync()
|
|
48
49
|
: await ExpoImagePicker.getMediaLibraryPermissionsAsync();
|
|
@@ -60,10 +61,7 @@ const UploadDocument = ({
|
|
|
60
61
|
|
|
61
62
|
switch (method) {
|
|
62
63
|
case 'camera':
|
|
63
|
-
|
|
64
|
-
await Camera.getCameraPermissionsAsync();
|
|
65
|
-
|
|
66
|
-
if (cameraStatus !== 'granted') {
|
|
64
|
+
if (permission && permission.status !== 'granted') {
|
|
67
65
|
onPermissionDenied();
|
|
68
66
|
return;
|
|
69
67
|
}
|
|
@@ -167,6 +165,8 @@ const UploadDocument = ({
|
|
|
167
165
|
|
|
168
166
|
<TakePicture
|
|
169
167
|
visible={showCamera}
|
|
168
|
+
cameraErrorMessage={takePicture.cameraErrorMessage}
|
|
169
|
+
requestPermissionsMessage={takePicture.requestPermissionsMessage}
|
|
170
170
|
processingPictureMessage={takePicture.processingPictureMessage}
|
|
171
171
|
repeatPictureText={takePicture.repeatPictureText}
|
|
172
172
|
usePictureText={takePicture.usePictureText}
|
|
@@ -204,6 +204,7 @@ UploadDocument.defaultProps = {
|
|
|
204
204
|
},
|
|
205
205
|
takePicture: {
|
|
206
206
|
cameraErrorMessage: ' ',
|
|
207
|
+
requestPermissionsMessage: ' ',
|
|
207
208
|
processingPictureMessage: ' ',
|
|
208
209
|
repeatPictureText: ' ',
|
|
209
210
|
usePictureText: ' ',
|
|
@@ -230,6 +231,7 @@ UploadDocument.propTypes = {
|
|
|
230
231
|
}),
|
|
231
232
|
takePicture: PropTypes.shape({
|
|
232
233
|
cameraErrorMessage: PropTypes.string,
|
|
234
|
+
requestPermissionsMessage: PropTypes.string,
|
|
233
235
|
processingPictureMessage: PropTypes.string,
|
|
234
236
|
repeatPictureText: PropTypes.string,
|
|
235
237
|
usePictureText: PropTypes.string,
|
package/lib/components/index.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
export { default as Button } from
|
|
2
|
-
export { default as Card } from
|
|
3
|
-
export { default as ConfirmationModal } from
|
|
4
|
-
export { default as Container } from
|
|
5
|
-
export { default as DeckSwiper } from
|
|
6
|
-
export { default as FlashMessage, sendMessage } from
|
|
7
|
-
export { default as FloatingContainer } from
|
|
8
|
-
export { default as Footer } from
|
|
9
|
-
export { default as Header } from
|
|
10
|
-
export { default as ImagePicker } from
|
|
11
|
-
export { default as ImageResponsive } from
|
|
12
|
-
export { default as ImageViewer } from
|
|
13
|
-
export { default as Input } from
|
|
14
|
-
export { default as InputPin } from
|
|
15
|
-
export { default as MenuItem } from
|
|
16
|
-
export { default as NavigationTitle } from
|
|
17
|
-
export { default as Notification } from
|
|
18
|
-
export { default as Select } from
|
|
19
|
-
export { default as SwipeablePanel } from
|
|
20
|
-
export { default as Switch } from
|
|
21
|
-
export { default as TakePicture } from
|
|
22
|
-
export { default as Text } from
|
|
23
|
-
export { default as Textarea } from
|
|
24
|
-
export { default as TimeOutButton } from
|
|
25
|
-
export { default as UploadDocument } from
|
|
26
|
-
export { default as VirtualKeyboard } from
|
|
27
|
-
export { default as withPreventDoubleClick } from
|
|
1
|
+
export { default as Button } from "./Button";
|
|
2
|
+
export { default as Card } from "./Card";
|
|
3
|
+
export { default as ConfirmationModal } from "./ConfirmationModal";
|
|
4
|
+
export { default as Container } from "./Container";
|
|
5
|
+
export { default as DeckSwiper } from "./DeckSwiper";
|
|
6
|
+
export { default as FlashMessage, sendMessage } from "./FlashMessage";
|
|
7
|
+
export { default as FloatingContainer } from "./FloatingContainer";
|
|
8
|
+
export { default as Footer } from "./Footer";
|
|
9
|
+
export { default as Header } from "./Header";
|
|
10
|
+
export { default as ImagePicker } from "./ImagePicker";
|
|
11
|
+
export { default as ImageResponsive } from "./ImageResponsive";
|
|
12
|
+
export { default as ImageViewer } from "./ImageViewer";
|
|
13
|
+
export { default as Input } from "./Input";
|
|
14
|
+
export { default as InputPin } from "./InputPin";
|
|
15
|
+
export { default as MenuItem } from "./MenuItem";
|
|
16
|
+
export { default as NavigationTitle } from "./NavigationTitle";
|
|
17
|
+
export { default as Notification } from "./Notification";
|
|
18
|
+
export { default as Select } from "./Select";
|
|
19
|
+
export { default as SwipeablePanel } from "./SwipeablePanel";
|
|
20
|
+
export { default as Switch } from "./Switch";
|
|
21
|
+
export { default as TakePicture } from "./TakePicture";
|
|
22
|
+
export { default as Text } from "./Text";
|
|
23
|
+
export { default as Textarea } from "./Textarea";
|
|
24
|
+
export { default as TimeOutButton } from "./TimeOutButton";
|
|
25
|
+
export { default as UploadDocument } from "./UploadDocument";
|
|
26
|
+
export { default as VirtualKeyboard } from "./VirtualKeyboard";
|
|
27
|
+
export { default as withPreventDoubleClick } from "./PreventDoubleClick";
|
|
28
|
+
export { default as CustomChatView } from "./CustomChatView";
|
package/lib/configs/constants.js
CHANGED
|
@@ -1,262 +1,263 @@
|
|
|
1
1
|
export const Colors = {
|
|
2
2
|
// Blacks and Whites
|
|
3
|
-
transparent:
|
|
4
|
-
white:
|
|
5
|
-
gray:
|
|
6
|
-
dimgray:
|
|
7
|
-
darkgray:
|
|
8
|
-
whiteice:
|
|
9
|
-
whitepearl:
|
|
3
|
+
transparent: "transparent",
|
|
4
|
+
white: "#FFFFFF",
|
|
5
|
+
gray: "#D0D0D0",
|
|
6
|
+
dimgray: "#CFCFCF",
|
|
7
|
+
darkgray: "#2E3640",
|
|
8
|
+
whiteice: "#E7EAEE",
|
|
9
|
+
whitepearl: "#F7F8F9",
|
|
10
10
|
// Greens
|
|
11
|
-
lightgreen:
|
|
12
|
-
green:
|
|
11
|
+
lightgreen: "#64FFA5",
|
|
12
|
+
green: "#3FE384",
|
|
13
13
|
// Blues
|
|
14
|
-
lightblue:
|
|
15
|
-
midblue:
|
|
16
|
-
darkblue:
|
|
17
|
-
brightblue:
|
|
18
|
-
mediumblue:
|
|
19
|
-
blue:
|
|
14
|
+
lightblue: "#E4E9F2",
|
|
15
|
+
midblue: "#727C8E",
|
|
16
|
+
darkblue: "#515C6F",
|
|
17
|
+
brightblue: "#00D8FF",
|
|
18
|
+
mediumblue: "#F2F7FE",
|
|
19
|
+
blue: "#2A539C",
|
|
20
|
+
attentionBlue: "#dbf0fe",
|
|
20
21
|
// Violet
|
|
21
|
-
violet:
|
|
22
|
-
placeboPurple:
|
|
22
|
+
violet: "#300049",
|
|
23
|
+
placeboPurple: "#F0ECFE",
|
|
23
24
|
// Reds
|
|
24
|
-
lightred:
|
|
25
|
-
red:
|
|
25
|
+
lightred: "#FFC1C1",
|
|
26
|
+
red: "#FD4C4C",
|
|
26
27
|
// Yellow
|
|
27
|
-
lightyellow:
|
|
28
|
-
yellow:
|
|
29
|
-
gold:
|
|
28
|
+
lightyellow: "#F3F2D3",
|
|
29
|
+
yellow: "#FDD100",
|
|
30
|
+
gold: "#D4AF37",
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
export const borderRadius = 8;
|
|
33
34
|
|
|
34
35
|
export const ConstantsWS = Object.freeze({
|
|
35
|
-
HIRING:
|
|
36
|
-
CANCELED:
|
|
37
|
-
CANCELED_BY_PROFESSIONAL:
|
|
38
|
-
NOT_CONFIRMED:
|
|
39
|
-
NOT_STARTED:
|
|
40
|
-
POSTULATION:
|
|
41
|
-
NOTIFICATION:
|
|
42
|
-
CHAT:
|
|
43
|
-
MAP:
|
|
44
|
-
RECOMMENDATION:
|
|
45
|
-
ISSUE:
|
|
46
|
-
CLOSED:
|
|
47
|
-
USER:
|
|
36
|
+
HIRING: "HIRING",
|
|
37
|
+
CANCELED: "CANCELED",
|
|
38
|
+
CANCELED_BY_PROFESSIONAL: "CANCELED_BY_PROFESSIONAL",
|
|
39
|
+
NOT_CONFIRMED: "NOT_CONFIRMED",
|
|
40
|
+
NOT_STARTED: "NOT_STARTED",
|
|
41
|
+
POSTULATION: "POSTULATION",
|
|
42
|
+
NOTIFICATION: "NOTIFICATION",
|
|
43
|
+
CHAT: "CHAT",
|
|
44
|
+
MAP: "MAP",
|
|
45
|
+
RECOMMENDATION: "RECOMMENDATION",
|
|
46
|
+
ISSUE: "ISSUE",
|
|
47
|
+
CLOSED: "CLOSED",
|
|
48
|
+
USER: "USER",
|
|
48
49
|
});
|
|
49
50
|
|
|
50
51
|
export const HiringStatus = Object.freeze({
|
|
51
|
-
PENDING:
|
|
52
|
-
ON_THE_WAY:
|
|
53
|
-
ARRIVAL_CONFIRMED:
|
|
54
|
-
IN_PROGRESS:
|
|
55
|
-
PAYMENT:
|
|
56
|
-
PAYMENT_ERROR:
|
|
57
|
-
DONE:
|
|
58
|
-
CANCELED:
|
|
59
|
-
UNPAID:
|
|
52
|
+
PENDING: "pending",
|
|
53
|
+
ON_THE_WAY: "onTheWay",
|
|
54
|
+
ARRIVAL_CONFIRMED: "arrivalConfirmed",
|
|
55
|
+
IN_PROGRESS: "inProgress",
|
|
56
|
+
PAYMENT: "payment",
|
|
57
|
+
PAYMENT_ERROR: "paymentError",
|
|
58
|
+
DONE: "done",
|
|
59
|
+
CANCELED: "canceled",
|
|
60
|
+
UNPAID: "unpaid",
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
export const CouponStatus = Object.freeze({
|
|
63
|
-
PENDING:
|
|
64
|
-
IN_USE:
|
|
65
|
-
EXPIRED:
|
|
66
|
-
DONE:
|
|
64
|
+
PENDING: "pending",
|
|
65
|
+
IN_USE: "inUse",
|
|
66
|
+
EXPIRED: "expired",
|
|
67
|
+
DONE: "DONE",
|
|
67
68
|
});
|
|
68
69
|
|
|
69
70
|
export const NotificationsTypes = Object.freeze({
|
|
70
71
|
/** New hiring is created */
|
|
71
|
-
NEW_HIRING:
|
|
72
|
+
NEW_HIRING: "newHiring",
|
|
72
73
|
/** Professional accept immediate hiring */
|
|
73
|
-
HIRING_IMMEDIATE:
|
|
74
|
+
HIRING_IMMEDIATE: "hiringImmediate",
|
|
74
75
|
/** Professional accept scheduled hiring */
|
|
75
|
-
HIRING_SCHEDULED:
|
|
76
|
-
HIRING_ACCEPTED:
|
|
77
|
-
HIRING_CANCELED:
|
|
78
|
-
HIRING_ON_THE_WAY:
|
|
79
|
-
HIRING_ARRIVAL_CONFIRMED:
|
|
80
|
-
HIRING_IN_PROGRESS:
|
|
81
|
-
HIRING_DONE:
|
|
82
|
-
HIRING_DELAY:
|
|
83
|
-
HIRING_DELAY_TRAFFIC:
|
|
84
|
-
HIRING_DELAY_ACCIDENT:
|
|
85
|
-
HIRING_DELAY_WORK:
|
|
86
|
-
HIRING_EXTRA_TASK:
|
|
87
|
-
HIRING_EXTRA_TASK_ACCEPTED:
|
|
88
|
-
HIRING_EXTRA_TASK_REJECTED:
|
|
89
|
-
HIRING_PAYMENT_REJECTED:
|
|
90
|
-
HIRING_RATING:
|
|
91
|
-
NEW_MESSAGE:
|
|
76
|
+
HIRING_SCHEDULED: "hiringScheduled",
|
|
77
|
+
HIRING_ACCEPTED: "hiringAccepted",
|
|
78
|
+
HIRING_CANCELED: "hiringCanceled",
|
|
79
|
+
HIRING_ON_THE_WAY: "hiringOnTheWay",
|
|
80
|
+
HIRING_ARRIVAL_CONFIRMED: "hiringArrivalConfirmed",
|
|
81
|
+
HIRING_IN_PROGRESS: "hiringInProgress",
|
|
82
|
+
HIRING_DONE: "hiringDone",
|
|
83
|
+
HIRING_DELAY: "hiringDelay",
|
|
84
|
+
HIRING_DELAY_TRAFFIC: "hiringDelayTraffic",
|
|
85
|
+
HIRING_DELAY_ACCIDENT: "hiringDelayAccident",
|
|
86
|
+
HIRING_DELAY_WORK: "hiringDelayWork",
|
|
87
|
+
HIRING_EXTRA_TASK: "hiringExtraTask",
|
|
88
|
+
HIRING_EXTRA_TASK_ACCEPTED: "hiringExtraTaskAccepted",
|
|
89
|
+
HIRING_EXTRA_TASK_REJECTED: "hiringExtraTaskRejected",
|
|
90
|
+
HIRING_PAYMENT_REJECTED: "hiringPaymentRejected",
|
|
91
|
+
HIRING_RATING: "hiringRating",
|
|
92
|
+
NEW_MESSAGE: "newMessage",
|
|
92
93
|
/** Reminder for the client to open the door */
|
|
93
|
-
REMINDER_OPEN_DOOR:
|
|
94
|
+
REMINDER_OPEN_DOOR: "reminderOpenDoor",
|
|
94
95
|
/** Reminder for the professional to start the path */
|
|
95
|
-
REMINDER_START_PATH:
|
|
96
|
+
REMINDER_START_PATH: "reminderStartPath",
|
|
96
97
|
/** Reminder for the professional when the start time is passed */
|
|
97
|
-
REMINDER_DELAYED:
|
|
98
|
+
REMINDER_DELAYED: "reminderDelay",
|
|
98
99
|
/** Reminder for the professional when arrived to mark the arrival confirmed */
|
|
99
|
-
REMINDER_ARRIVED:
|
|
100
|
+
REMINDER_ARRIVED: "reminderArrived",
|
|
100
101
|
/** Reminder for the professional to start the progress */
|
|
101
|
-
REMINDER_START_PROGRESS:
|
|
102
|
+
REMINDER_START_PROGRESS: "reminderStartProgress",
|
|
102
103
|
});
|
|
103
104
|
|
|
104
105
|
export const MapStyle = [
|
|
105
106
|
{
|
|
106
|
-
elementType:
|
|
107
|
+
elementType: "geometry",
|
|
107
108
|
stylers: [
|
|
108
109
|
{
|
|
109
|
-
color:
|
|
110
|
+
color: "#f5f5f5",
|
|
110
111
|
},
|
|
111
112
|
],
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
|
-
elementType:
|
|
115
|
+
elementType: "labels.icon",
|
|
115
116
|
stylers: [
|
|
116
117
|
{
|
|
117
|
-
visibility:
|
|
118
|
+
visibility: "off",
|
|
118
119
|
},
|
|
119
120
|
],
|
|
120
121
|
},
|
|
121
122
|
{
|
|
122
|
-
elementType:
|
|
123
|
+
elementType: "labels.text.fill",
|
|
123
124
|
stylers: [
|
|
124
125
|
{
|
|
125
|
-
color:
|
|
126
|
+
color: "#616161",
|
|
126
127
|
},
|
|
127
128
|
],
|
|
128
129
|
},
|
|
129
130
|
{
|
|
130
|
-
elementType:
|
|
131
|
+
elementType: "labels.text.stroke",
|
|
131
132
|
stylers: [
|
|
132
133
|
{
|
|
133
|
-
color:
|
|
134
|
+
color: "#f5f5f5",
|
|
134
135
|
},
|
|
135
136
|
],
|
|
136
137
|
},
|
|
137
138
|
{
|
|
138
|
-
featureType:
|
|
139
|
-
elementType:
|
|
139
|
+
featureType: "administrative.land_parcel",
|
|
140
|
+
elementType: "labels.text.fill",
|
|
140
141
|
stylers: [
|
|
141
142
|
{
|
|
142
|
-
color:
|
|
143
|
+
color: "#bdbdbd",
|
|
143
144
|
},
|
|
144
145
|
],
|
|
145
146
|
},
|
|
146
147
|
{
|
|
147
|
-
featureType:
|
|
148
|
-
elementType:
|
|
148
|
+
featureType: "poi",
|
|
149
|
+
elementType: "geometry",
|
|
149
150
|
stylers: [
|
|
150
151
|
{
|
|
151
|
-
color:
|
|
152
|
+
color: "#eeeeee",
|
|
152
153
|
},
|
|
153
154
|
],
|
|
154
155
|
},
|
|
155
156
|
{
|
|
156
|
-
featureType:
|
|
157
|
-
elementType:
|
|
157
|
+
featureType: "poi",
|
|
158
|
+
elementType: "labels.text.fill",
|
|
158
159
|
stylers: [
|
|
159
160
|
{
|
|
160
|
-
color:
|
|
161
|
+
color: "#757575",
|
|
161
162
|
},
|
|
162
163
|
],
|
|
163
164
|
},
|
|
164
165
|
{
|
|
165
|
-
featureType:
|
|
166
|
-
elementType:
|
|
166
|
+
featureType: "poi.park",
|
|
167
|
+
elementType: "geometry",
|
|
167
168
|
stylers: [
|
|
168
169
|
{
|
|
169
|
-
color:
|
|
170
|
+
color: "#e5e5e5",
|
|
170
171
|
},
|
|
171
172
|
],
|
|
172
173
|
},
|
|
173
174
|
{
|
|
174
|
-
featureType:
|
|
175
|
-
elementType:
|
|
175
|
+
featureType: "poi.park",
|
|
176
|
+
elementType: "labels.text.fill",
|
|
176
177
|
stylers: [
|
|
177
178
|
{
|
|
178
|
-
color:
|
|
179
|
+
color: "#9e9e9e",
|
|
179
180
|
},
|
|
180
181
|
],
|
|
181
182
|
},
|
|
182
183
|
{
|
|
183
|
-
featureType:
|
|
184
|
-
elementType:
|
|
184
|
+
featureType: "road",
|
|
185
|
+
elementType: "geometry",
|
|
185
186
|
stylers: [
|
|
186
187
|
{
|
|
187
|
-
color:
|
|
188
|
+
color: "#ffffff",
|
|
188
189
|
},
|
|
189
190
|
],
|
|
190
191
|
},
|
|
191
192
|
{
|
|
192
|
-
featureType:
|
|
193
|
-
elementType:
|
|
193
|
+
featureType: "road.arterial",
|
|
194
|
+
elementType: "labels.text.fill",
|
|
194
195
|
stylers: [
|
|
195
196
|
{
|
|
196
|
-
color:
|
|
197
|
+
color: "#757575",
|
|
197
198
|
},
|
|
198
199
|
],
|
|
199
200
|
},
|
|
200
201
|
{
|
|
201
|
-
featureType:
|
|
202
|
-
elementType:
|
|
202
|
+
featureType: "road.highway",
|
|
203
|
+
elementType: "geometry",
|
|
203
204
|
stylers: [
|
|
204
205
|
{
|
|
205
|
-
color:
|
|
206
|
+
color: "#dadada",
|
|
206
207
|
},
|
|
207
208
|
],
|
|
208
209
|
},
|
|
209
210
|
{
|
|
210
|
-
featureType:
|
|
211
|
-
elementType:
|
|
211
|
+
featureType: "road.highway",
|
|
212
|
+
elementType: "labels.text.fill",
|
|
212
213
|
stylers: [
|
|
213
214
|
{
|
|
214
|
-
color:
|
|
215
|
+
color: "#616161",
|
|
215
216
|
},
|
|
216
217
|
],
|
|
217
218
|
},
|
|
218
219
|
{
|
|
219
|
-
featureType:
|
|
220
|
-
elementType:
|
|
220
|
+
featureType: "road.local",
|
|
221
|
+
elementType: "labels.text.fill",
|
|
221
222
|
stylers: [
|
|
222
223
|
{
|
|
223
|
-
color:
|
|
224
|
+
color: "#9e9e9e",
|
|
224
225
|
},
|
|
225
226
|
],
|
|
226
227
|
},
|
|
227
228
|
{
|
|
228
|
-
featureType:
|
|
229
|
-
elementType:
|
|
229
|
+
featureType: "transit.line",
|
|
230
|
+
elementType: "geometry",
|
|
230
231
|
stylers: [
|
|
231
232
|
{
|
|
232
|
-
color:
|
|
233
|
+
color: "#e5e5e5",
|
|
233
234
|
},
|
|
234
235
|
],
|
|
235
236
|
},
|
|
236
237
|
{
|
|
237
|
-
featureType:
|
|
238
|
-
elementType:
|
|
238
|
+
featureType: "transit.station",
|
|
239
|
+
elementType: "geometry",
|
|
239
240
|
stylers: [
|
|
240
241
|
{
|
|
241
|
-
color:
|
|
242
|
+
color: "#eeeeee",
|
|
242
243
|
},
|
|
243
244
|
],
|
|
244
245
|
},
|
|
245
246
|
{
|
|
246
|
-
featureType:
|
|
247
|
-
elementType:
|
|
247
|
+
featureType: "water",
|
|
248
|
+
elementType: "geometry",
|
|
248
249
|
stylers: [
|
|
249
250
|
{
|
|
250
|
-
color:
|
|
251
|
+
color: "#c9c9c9",
|
|
251
252
|
},
|
|
252
253
|
],
|
|
253
254
|
},
|
|
254
255
|
{
|
|
255
|
-
featureType:
|
|
256
|
-
elementType:
|
|
256
|
+
featureType: "water",
|
|
257
|
+
elementType: "labels.text.fill",
|
|
257
258
|
stylers: [
|
|
258
259
|
{
|
|
259
|
-
color:
|
|
260
|
+
color: "#9e9e9e",
|
|
260
261
|
},
|
|
261
262
|
],
|
|
262
263
|
},
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"main": "lib/index.js",
|
|
3
3
|
"name": "@holper/react-native-holper-storybook",
|
|
4
4
|
"description": "A component library for Holper projects",
|
|
5
|
-
"version": "0.6.
|
|
5
|
+
"version": "0.6.77",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
8
8
|
"lib",
|
|
@@ -27,35 +27,39 @@
|
|
|
27
27
|
"storybook-publish": "./build.sh"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@react-native-async-storage/async-storage": "1.
|
|
30
|
+
"@react-native-async-storage/async-storage": "1.23.1",
|
|
31
31
|
"@react-native-community/datetimepicker": "8.2.0",
|
|
32
|
-
"@react-native-community/slider": "4.
|
|
32
|
+
"@react-native-community/slider": "4.5.5",
|
|
33
33
|
"deprecated-react-native-prop-types": "^5.0.0",
|
|
34
|
-
"expo": "
|
|
35
|
-
"expo-asset": "~
|
|
36
|
-
"expo-camera": "~
|
|
37
|
-
"expo-font": "~
|
|
38
|
-
"expo-image
|
|
39
|
-
"expo-image-
|
|
40
|
-
"expo-
|
|
41
|
-
"expo-
|
|
34
|
+
"expo": "^52.0.35",
|
|
35
|
+
"expo-asset": "~11.0.3",
|
|
36
|
+
"expo-camera": "~16.0.16",
|
|
37
|
+
"expo-font": "~13.0.3",
|
|
38
|
+
"expo-image": "~2.0.5",
|
|
39
|
+
"expo-image-manipulator": "~13.0.6",
|
|
40
|
+
"expo-image-picker": "~16.0.6",
|
|
41
|
+
"expo-media-library": "~17.0.6",
|
|
42
|
+
"expo-status-bar": "~2.0.1",
|
|
42
43
|
"moment": "^2.30.1",
|
|
43
44
|
"prop-types": "^15.8.1",
|
|
44
|
-
"react": "18.
|
|
45
|
-
"react-dom": "18.
|
|
46
|
-
"react-native": "0.
|
|
45
|
+
"react": "18.3.1",
|
|
46
|
+
"react-dom": "18.3.1",
|
|
47
|
+
"react-native": "0.76.7",
|
|
47
48
|
"react-native-countdown-circle-timer": "^3.2.1",
|
|
48
49
|
"react-native-deck-swiper": "^2.0.16",
|
|
49
50
|
"react-native-dropdown-picker": "^5.4.6",
|
|
50
51
|
"react-native-flash-message": "^0.4.2",
|
|
51
|
-
"react-native-
|
|
52
|
+
"react-native-maps": "1.18.0",
|
|
53
|
+
"react-native-maps-directions": "1.9.0",
|
|
54
|
+
"react-native-safe-area-context": "4.12.0",
|
|
52
55
|
"react-native-status-bar-height": "^2.6.0",
|
|
53
|
-
"react-native-svg": "
|
|
56
|
+
"react-native-svg": "15.8.0",
|
|
54
57
|
"react-native-vector-icons": "^10.0.3",
|
|
55
58
|
"react-native-web": "~0.19.10"
|
|
56
59
|
},
|
|
57
60
|
"devDependencies": {
|
|
58
61
|
"@babel/core": "^7.23.9",
|
|
62
|
+
"@babel/traverse": "^7.26.9",
|
|
59
63
|
"@storybook/addon-actions": "^7.6.11",
|
|
60
64
|
"@storybook/addon-knobs": "^7.0.2",
|
|
61
65
|
"@storybook/addon-links": "^7.6.11",
|
|
@@ -65,12 +69,24 @@
|
|
|
65
69
|
"@storybook/react-native": "^6.5.7",
|
|
66
70
|
"@storybook/react-native-server": "^6.5.8",
|
|
67
71
|
"babel-loader": "^9.1.3",
|
|
68
|
-
"expo-dev-client": "~
|
|
72
|
+
"expo-dev-client": "~5.0.12"
|
|
69
73
|
},
|
|
70
74
|
"peerDependencies": {
|
|
71
75
|
"expo-camera": ">=13.0.0",
|
|
72
76
|
"react": ">=18.0.0",
|
|
73
77
|
"react-dom": ">=18.0.0",
|
|
74
78
|
"react-native": ">=0.71.0"
|
|
79
|
+
},
|
|
80
|
+
"expo": {
|
|
81
|
+
"doctor": {
|
|
82
|
+
"reactNativeDirectoryCheck": {
|
|
83
|
+
"exclude": [
|
|
84
|
+
"react-native-maps",
|
|
85
|
+
"react-native-maps-directions",
|
|
86
|
+
"react-native-status-bar-height"
|
|
87
|
+
],
|
|
88
|
+
"listUnknownPackages": false
|
|
89
|
+
}
|
|
90
|
+
}
|
|
75
91
|
}
|
|
76
92
|
}
|