@holper/react-native-holper-storybook 0.6.101 → 0.6.103
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.
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
flex: 1,
|
|
10
10
|
justifyContent: 'center',
|
|
11
11
|
alignItems: 'center',
|
|
12
|
-
position: 'relative'
|
|
12
|
+
position: 'relative',
|
|
13
13
|
},
|
|
14
14
|
closeIcon: {
|
|
15
15
|
position: 'absolute',
|
|
@@ -21,17 +21,17 @@ export default {
|
|
|
21
21
|
borderRadius: 15,
|
|
22
22
|
backgroundColor: Colors.lightblue,
|
|
23
23
|
alignItems: 'center',
|
|
24
|
-
justifyContent: 'center'
|
|
24
|
+
justifyContent: 'center',
|
|
25
25
|
},
|
|
26
26
|
body: {
|
|
27
27
|
width,
|
|
28
28
|
height,
|
|
29
29
|
alignSelf: 'center',
|
|
30
|
-
position: 'relative'
|
|
30
|
+
position: 'relative',
|
|
31
31
|
},
|
|
32
32
|
activityIndicator: {
|
|
33
|
-
top:
|
|
34
|
-
left:
|
|
35
|
-
position: 'absolute'
|
|
36
|
-
}
|
|
33
|
+
top: height / 2 - 100,
|
|
34
|
+
left: width / 2 - 20,
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
},
|
|
37
37
|
};
|
|
@@ -13,35 +13,32 @@ export const ConfirmPictureModal = ({
|
|
|
13
13
|
image,
|
|
14
14
|
repeatPictureText,
|
|
15
15
|
usePictureText,
|
|
16
|
-
}) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
style={avatar ? style.cameraTakenImage : style.cameraContainer}
|
|
31
|
-
/>
|
|
16
|
+
}) => (
|
|
17
|
+
<Modal
|
|
18
|
+
animationType='slide'
|
|
19
|
+
transparent={false}
|
|
20
|
+
visible={visible}
|
|
21
|
+
onRequestClose={() => {}}
|
|
22
|
+
>
|
|
23
|
+
<View style={style.cameraTakenImageContainer}>
|
|
24
|
+
<ImageResponsive
|
|
25
|
+
source={{
|
|
26
|
+
uri: image ? image.uri : null,
|
|
27
|
+
}}
|
|
28
|
+
style={avatar ? style.cameraTakenImage : style.cameraContainer}
|
|
29
|
+
/>
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</View>
|
|
31
|
+
<View style={style.cameraRetakePhoto}>
|
|
32
|
+
<TouchableOpacity onPress={onRepeatPhoto}>
|
|
33
|
+
<Text style={style.cameraRetakePhotoText}>{repeatPictureText}</Text>
|
|
34
|
+
</TouchableOpacity>
|
|
35
|
+
<TouchableOpacity onPress={onUsePhoto}>
|
|
36
|
+
<Text style={style.cameraRetakePhotoText}>{usePictureText}</Text>
|
|
37
|
+
</TouchableOpacity>
|
|
41
38
|
</View>
|
|
42
|
-
</
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
</View>
|
|
40
|
+
</Modal>
|
|
41
|
+
);
|
|
45
42
|
|
|
46
43
|
ConfirmPictureModal.defaultProps = {
|
|
47
44
|
visible: false,
|
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
import React, { useState, useEffect } from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import ConfirmationModal from '../ConfirmationModal';
|
|
14
|
-
import ImagePicker from '../ImagePicker';
|
|
15
|
-
import ImageViewer from '../ImageViewer';
|
|
16
|
-
import TakePicture from '../TakePicture';
|
|
17
|
-
import { Colors } from '../../configs/constants';
|
|
18
|
-
import style from './style';
|
|
19
|
-
|
|
20
|
-
const iOS = Platform.OS === 'ios';
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { View, TouchableOpacity, ActivityIndicator } from "react-native";
|
|
4
|
+
import * as ExpoImagePicker from "expo-image-picker";
|
|
5
|
+
import Text from "../Text";
|
|
6
|
+
import Button from "../Button";
|
|
7
|
+
import ConfirmationModal from "../ConfirmationModal";
|
|
8
|
+
import ImagePicker from "../ImagePicker";
|
|
9
|
+
import ImageViewer from "../ImageViewer";
|
|
10
|
+
import TakePicture from "../TakePicture";
|
|
11
|
+
import { Colors } from "../../configs/constants";
|
|
12
|
+
import style from "./style";
|
|
21
13
|
|
|
22
14
|
const UploadDocument = ({
|
|
23
15
|
title,
|
|
@@ -40,11 +32,7 @@ const UploadDocument = ({
|
|
|
40
32
|
const [loading, setLoading] = useState(true);
|
|
41
33
|
|
|
42
34
|
useEffect(() => {
|
|
43
|
-
(async () =>
|
|
44
|
-
iOS
|
|
45
|
-
? await MediaLibrary.requestPermissionsAsync()
|
|
46
|
-
: await ExpoImagePicker.getMediaLibraryPermissionsAsync();
|
|
47
|
-
})();
|
|
35
|
+
(async () => await ExpoImagePicker.requestMediaLibraryPermissionsAsync())();
|
|
48
36
|
}, []);
|
|
49
37
|
|
|
50
38
|
useEffect(() => {
|
|
@@ -57,18 +45,17 @@ const UploadDocument = ({
|
|
|
57
45
|
setShowMediaModal(false);
|
|
58
46
|
|
|
59
47
|
switch (method) {
|
|
60
|
-
case
|
|
48
|
+
case "camera":
|
|
61
49
|
setTimeout(async () => {
|
|
62
50
|
setShowCamera(true);
|
|
63
51
|
}, 500);
|
|
64
52
|
break;
|
|
65
|
-
case
|
|
53
|
+
case "gallery":
|
|
66
54
|
setTimeout(async () => {
|
|
67
|
-
const {
|
|
68
|
-
|
|
69
|
-
: await ExpoImagePicker.getMediaLibraryPermissionsAsync();
|
|
55
|
+
const { granted } =
|
|
56
|
+
await ExpoImagePicker.requestMediaLibraryPermissionsAsync();
|
|
70
57
|
|
|
71
|
-
if (
|
|
58
|
+
if (!granted) {
|
|
72
59
|
onPermissionDenied();
|
|
73
60
|
return;
|
|
74
61
|
}
|
|
@@ -94,10 +81,10 @@ const UploadDocument = ({
|
|
|
94
81
|
<View>
|
|
95
82
|
<ImageViewer
|
|
96
83
|
source={{
|
|
97
|
-
uri: typeof image ===
|
|
84
|
+
uri: typeof image === "object" ? image.uri : image,
|
|
98
85
|
}}
|
|
99
86
|
style={style.image}
|
|
100
|
-
resizeMode=
|
|
87
|
+
resizeMode="cover"
|
|
101
88
|
avatar
|
|
102
89
|
onLoadEnd={() => setLoading(false)}
|
|
103
90
|
/>
|
|
@@ -113,12 +100,12 @@ const UploadDocument = ({
|
|
|
113
100
|
<Text
|
|
114
101
|
style={style.titleUploaded}
|
|
115
102
|
numberOfLines={1}
|
|
116
|
-
ellipsizeMode=
|
|
103
|
+
ellipsizeMode="tail"
|
|
117
104
|
>
|
|
118
105
|
{title}
|
|
119
106
|
</Text>
|
|
120
107
|
<TouchableOpacity onPress={() => setShowMediaModal(true)}>
|
|
121
|
-
<Text size=
|
|
108
|
+
<Text size="tiny" style={style.reUpload}>
|
|
122
109
|
{reUploadButtonText}
|
|
123
110
|
</Text>
|
|
124
111
|
</TouchableOpacity>
|
|
@@ -128,17 +115,17 @@ const UploadDocument = ({
|
|
|
128
115
|
<View style={style.noUploaded}>
|
|
129
116
|
{icon}
|
|
130
117
|
<Text
|
|
131
|
-
size=
|
|
118
|
+
size="large"
|
|
132
119
|
style={style.title}
|
|
133
120
|
numberOfLines={1}
|
|
134
|
-
ellipsizeMode=
|
|
121
|
+
ellipsizeMode="tail"
|
|
135
122
|
>
|
|
136
123
|
{title}
|
|
137
124
|
</Text>
|
|
138
|
-
<Text size=
|
|
125
|
+
<Text size="small" style={style.description}>
|
|
139
126
|
{description}
|
|
140
127
|
</Text>
|
|
141
|
-
<Button variant=
|
|
128
|
+
<Button variant="dim" onPress={() => setShowMediaModal(true)}>
|
|
142
129
|
<Text>{uploadButtonText}</Text>
|
|
143
130
|
</Button>
|
|
144
131
|
</View>
|
|
@@ -148,9 +135,9 @@ const UploadDocument = ({
|
|
|
148
135
|
visible={showMediaModal}
|
|
149
136
|
inverted={inverted}
|
|
150
137
|
title={mediaModal.title}
|
|
151
|
-
onConfirm={() => pickUploadMethod(
|
|
138
|
+
onConfirm={() => pickUploadMethod("camera")}
|
|
152
139
|
confirmText={mediaModal.confirmText}
|
|
153
|
-
onCancel={() => pickUploadMethod(
|
|
140
|
+
onCancel={() => pickUploadMethod("gallery")}
|
|
154
141
|
cancelText={mediaModal.cancelText}
|
|
155
142
|
onClose={() => setShowMediaModal(false)}
|
|
156
143
|
>
|
|
@@ -179,10 +166,10 @@ const UploadDocument = ({
|
|
|
179
166
|
};
|
|
180
167
|
|
|
181
168
|
UploadDocument.defaultProps = {
|
|
182
|
-
title:
|
|
183
|
-
description:
|
|
184
|
-
uploadButtonText:
|
|
185
|
-
reUploadButtonText:
|
|
169
|
+
title: " ",
|
|
170
|
+
description: " ",
|
|
171
|
+
uploadButtonText: " ",
|
|
172
|
+
reUploadButtonText: " ",
|
|
186
173
|
completed: false,
|
|
187
174
|
inverted: false,
|
|
188
175
|
isAvatarPicker: false,
|
|
@@ -191,17 +178,17 @@ UploadDocument.defaultProps = {
|
|
|
191
178
|
file: null,
|
|
192
179
|
onPermissionDenied: () => {},
|
|
193
180
|
mediaModal: {
|
|
194
|
-
title:
|
|
195
|
-
confirmText:
|
|
196
|
-
cancelText:
|
|
197
|
-
description:
|
|
181
|
+
title: " ",
|
|
182
|
+
confirmText: " ",
|
|
183
|
+
cancelText: " ",
|
|
184
|
+
description: " ",
|
|
198
185
|
},
|
|
199
186
|
takePicture: {
|
|
200
|
-
cameraErrorMessage:
|
|
201
|
-
requestPermissionsMessage:
|
|
202
|
-
processingPictureMessage:
|
|
203
|
-
repeatPictureText:
|
|
204
|
-
usePictureText:
|
|
187
|
+
cameraErrorMessage: " ",
|
|
188
|
+
requestPermissionsMessage: " ",
|
|
189
|
+
processingPictureMessage: " ",
|
|
190
|
+
repeatPictureText: " ",
|
|
191
|
+
usePictureText: " ",
|
|
205
192
|
},
|
|
206
193
|
};
|
|
207
194
|
|
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.103",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
8
8
|
"lib",
|
|
@@ -28,22 +28,21 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@react-native-async-storage/async-storage": "2.1.2",
|
|
31
|
-
"@react-native-community/datetimepicker": "8.
|
|
31
|
+
"@react-native-community/datetimepicker": "8.4.1",
|
|
32
32
|
"@react-native-community/slider": "4.5.6",
|
|
33
|
-
"expo": "
|
|
34
|
-
"expo-asset": "~11.1.
|
|
35
|
-
"expo-camera": "~16.1.
|
|
36
|
-
"expo-font": "~13.3.
|
|
37
|
-
"expo-image": "~2.
|
|
33
|
+
"expo": "~53.0.24",
|
|
34
|
+
"expo-asset": "~11.1.7",
|
|
35
|
+
"expo-camera": "~16.1.11",
|
|
36
|
+
"expo-font": "~13.3.2",
|
|
37
|
+
"expo-image": "~2.4.1",
|
|
38
38
|
"expo-image-manipulator": "~13.1.7",
|
|
39
39
|
"expo-image-picker": "~16.1.4",
|
|
40
|
-
"expo-media-library": "~17.1.7",
|
|
41
40
|
"expo-status-bar": "~2.2.3",
|
|
42
41
|
"moment": "^2.30.1",
|
|
43
42
|
"prop-types": "^15.8.1",
|
|
44
43
|
"react": "19.0.0",
|
|
45
44
|
"react-dom": "19.0.0",
|
|
46
|
-
"react-native": "0.79.
|
|
45
|
+
"react-native": "0.79.6",
|
|
47
46
|
"react-native-countdown-circle-timer": "^3.2.1",
|
|
48
47
|
"react-native-deck-swiper": "^2.0.16",
|
|
49
48
|
"react-native-dropdown-picker": "^5.4.6",
|
|
@@ -68,7 +67,7 @@
|
|
|
68
67
|
"@storybook/react-native": "^6.5.7",
|
|
69
68
|
"@storybook/react-native-server": "^6.5.8",
|
|
70
69
|
"babel-loader": "^9.1.3",
|
|
71
|
-
"expo-dev-client": "~5.2.
|
|
70
|
+
"expo-dev-client": "~5.2.4"
|
|
72
71
|
},
|
|
73
72
|
"peerDependencies": {
|
|
74
73
|
"expo-camera": ">=13.0.0",
|