@holper/react-native-holper-storybook 0.6.81 → 0.6.83

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.
@@ -3,7 +3,7 @@ import * as ExpoImagePicker from 'expo-image-picker';
3
3
 
4
4
  const ImagePicker = async (avatar) => {
5
5
  const image = await ExpoImagePicker.launchImageLibraryAsync({
6
- mediaTypes: ExpoImagePicker.MediaTypeOptions.Images,
6
+ mediaTypes: ExpoImagePicker.MediaType.Images,
7
7
  allowsEditing: avatar,
8
8
  aspect: [4, 3],
9
9
  quality: 1,
@@ -52,134 +52,135 @@ const TakePicture = ({
52
52
  repeatPictureText,
53
53
  usePictureText,
54
54
  }) => {
55
- const [permission, requestPermission] = useCameraPermissions();
56
- const [type, setType] = useState('back');
57
- const [image, setImage] = useState(null);
58
- const [takingPicture, setTakingPicture] = useState(false);
59
- const camera = useRef();
60
-
61
- const flipCamera = () => {
62
- setType((current) => (current === 'back' ? 'front' : 'back'));
63
- };
64
-
65
- const takePicture = async () => {
66
- if (camera) {
67
- setTakingPicture(true);
68
- const tempImage = await camera.current.takePictureAsync({ quality: 1.0 });
69
-
70
- if (avatar) {
71
- const avatarImage = await ImageManipulator.manipulateAsync(
72
- tempImage.localUri || tempImage.uri,
73
- [
74
- {
75
- crop: {
76
- originX: 0,
77
- originY: (tempImage.height - tempImage.width) / 2,
78
- width: tempImage.width,
79
- height: tempImage.width,
80
- },
81
- },
82
- ],
83
- { compress: 1.0, format: ImageManipulator.SaveFormat.PNG }
84
- );
85
-
86
- setImage(avatarImage);
87
- setTakingPicture(false);
88
- } else {
89
- setImage(tempImage);
90
- setTakingPicture(false);
91
- }
92
- }
93
- };
94
-
95
- const repeatPhoto = () => {
96
- setImage(null);
97
- };
98
-
99
- const usePhoto = () => {
100
- onClose(typeof image === 'object' ? image.uri : image);
101
- setImage(null);
102
- };
103
-
104
- const closeModal = () => {
105
- setImage(null);
106
- onClose();
107
- };
108
-
109
- if (!permission?.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
- );
118
- }
55
+ // const [permission, requestPermission] = useCameraPermissions();
56
+ // const [type, setType] = useState('back');
57
+ // const [image, setImage] = useState(null);
58
+ // const [takingPicture, setTakingPicture] = useState(false);
59
+ // const camera = useRef();
60
+
61
+ // const flipCamera = () => {
62
+ // setType((current) => (current === 'back' ? 'front' : 'back'));
63
+ // };
64
+
65
+ // const takePicture = async () => {
66
+ // if (camera) {
67
+ // setTakingPicture(true);
68
+ // const tempImage = await camera.current.takePictureAsync({ quality: 1.0 });
69
+
70
+ // if (avatar) {
71
+ // const avatarImage = await ImageManipulator.manipulateAsync(
72
+ // tempImage.localUri || tempImage.uri,
73
+ // [
74
+ // {
75
+ // crop: {
76
+ // originX: 0,
77
+ // originY: (tempImage.height - tempImage.width) / 2,
78
+ // width: tempImage.width,
79
+ // height: tempImage.width,
80
+ // },
81
+ // },
82
+ // ],
83
+ // { compress: 1.0, format: ImageManipulator.SaveFormat.PNG }
84
+ // );
85
+
86
+ // setImage(avatarImage);
87
+ // setTakingPicture(false);
88
+ // } else {
89
+ // setImage(tempImage);
90
+ // setTakingPicture(false);
91
+ // }
92
+ // }
93
+ // };
94
+
95
+ // const repeatPhoto = () => {
96
+ // setImage(null);
97
+ // };
98
+
99
+ // const usePhoto = () => {
100
+ // onClose(typeof image === 'object' ? image.uri : image);
101
+ // setImage(null);
102
+ // };
103
+
104
+ // const closeModal = () => {
105
+ // setImage(null);
106
+ // onClose();
107
+ // };
108
+
109
+ // if (!permission?.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
+ // );
118
+ // }
119
119
 
120
120
  return (
121
- <Modal
122
- animationType='slide'
123
- transparent={false}
124
- visible={visible}
125
- onRequestClose={onClose}
126
- >
127
- <Container style={style.cameraContainer}>
128
- <CameraView
129
- ref={camera}
130
- style={style.cameraContainer}
131
- facing={type}
132
- ratio={DESIRED_RATIO}
133
- />
134
- {/* {avatar && isiOS && <SvgCircle />}
135
-
136
- <View style={style.cameraFlipContainer}>
137
- <TouchableOpacity onPress={closeModal} style={style.closeIcon}>
138
- <Ionicons
139
- name='close-outline'
140
- color={Colors.darkblue}
141
- size={24}
142
- />
143
- </TouchableOpacity>
144
- <TouchableOpacity style={style.cameraFlipBtn} onPress={flipCamera}>
145
- <Ionicons
146
- name='camera-reverse-outline'
147
- style={style.cameraFlipIcon}
148
- color={Colors.white}
149
- size={40}
150
- />
151
- </TouchableOpacity>
152
- <TouchableOpacity
153
- style={style.cameraRecordBtn}
154
- onPress={takePicture}
155
- >
156
- <Ionicons
157
- name='radio-button-on-outline'
158
- color={Colors.red}
159
- size={60}
160
- />
161
- </TouchableOpacity>
162
- </View>
163
-
164
- {avatar && isAndroid && <SvgCircle />}
165
- </CameraView> */}
166
-
167
- {takingPicture && (
168
- <View style={style.cameraTakingPictureOverlay}>
169
- <ActivityIndicator color={Colors.darkblue} />
170
- <Text color='white'>{processingPictureMessage} ...</Text>
171
- </View>
172
- )}
173
- <ConfirmPictureModal
174
- visible={image !== null}
175
- image={image}
176
- repeatPictureText={repeatPictureText}
177
- usePictureText={usePictureText}
178
- onRepeatPhoto={repeatPhoto}
179
- onUsePhoto={usePhoto}
180
- />
181
- </Container>
182
- </Modal>
121
+ <Text>asdsdf</Text>
122
+ // <Modal
123
+ // animationType='slide'
124
+ // transparent={false}
125
+ // visible={visible}
126
+ // onRequestClose={onClose}
127
+ // >
128
+ // <Container style={style.cameraContainer}>
129
+ // <CameraView
130
+ // ref={camera}
131
+ // style={style.cameraContainer}
132
+ // facing={type}
133
+ // ratio={DESIRED_RATIO}
134
+ // >
135
+ // {avatar && isiOS && <SvgCircle />}
136
+
137
+ // <View style={style.cameraFlipContainer}>
138
+ // <TouchableOpacity onPress={closeModal} style={style.closeIcon}>
139
+ // <Ionicons
140
+ // name='close-outline'
141
+ // color={Colors.darkblue}
142
+ // size={24}
143
+ // />
144
+ // </TouchableOpacity>
145
+ // <TouchableOpacity style={style.cameraFlipBtn} onPress={flipCamera}>
146
+ // <Ionicons
147
+ // name='camera-reverse-outline'
148
+ // style={style.cameraFlipIcon}
149
+ // color={Colors.white}
150
+ // size={40}
151
+ // />
152
+ // </TouchableOpacity>
153
+ // <TouchableOpacity
154
+ // style={style.cameraRecordBtn}
155
+ // onPress={takePicture}
156
+ // >
157
+ // <Ionicons
158
+ // name='radio-button-on-outline'
159
+ // color={Colors.red}
160
+ // size={60}
161
+ // />
162
+ // </TouchableOpacity>
163
+ // </View>
164
+
165
+ // {avatar && isAndroid && <SvgCircle />}
166
+ // </CameraView>
167
+
168
+ // {takingPicture && (
169
+ // <View style={style.cameraTakingPictureOverlay}>
170
+ // <ActivityIndicator color={Colors.darkblue} />
171
+ // <Text color='white'>{processingPictureMessage} ...</Text>
172
+ // </View>
173
+ // )}
174
+ // <ConfirmPictureModal
175
+ // visible={image !== null}
176
+ // image={image}
177
+ // repeatPictureText={repeatPictureText}
178
+ // usePictureText={usePictureText}
179
+ // onRepeatPhoto={repeatPhoto}
180
+ // onUsePhoto={usePhoto}
181
+ // />
182
+ // </Container>
183
+ // </Modal>
183
184
  );
184
185
  };
185
186
 
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.81",
5
+ "version": "0.6.83",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "lib",