@momo-kits/camerakit 0.0.53-beta.8 → 0.0.53-beta.9
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/CameraKit.js +10 -5
- package/package.json +4 -3
- package/publish.sh +1 -1
package/CameraKit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { StyleSheet, View } from 'react-native';
|
|
4
|
-
import { Camera } from '
|
|
4
|
+
import { Camera } from 'camerakit';
|
|
5
5
|
|
|
6
6
|
const styles = StyleSheet.create({
|
|
7
7
|
container: {
|
|
@@ -9,6 +9,7 @@ const styles = StyleSheet.create({
|
|
|
9
9
|
},
|
|
10
10
|
camera: {
|
|
11
11
|
flex: 1,
|
|
12
|
+
backgroundColor: 'black'
|
|
12
13
|
},
|
|
13
14
|
});
|
|
14
15
|
|
|
@@ -33,10 +34,14 @@ class CameraKit extends React.Component {
|
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
async capture(options) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
try {
|
|
38
|
+
const data = await this.camera?.capture(options);
|
|
39
|
+
const { onImageCaptured } = this.props;
|
|
40
|
+
if (typeof onImageCaptured === 'function') {
|
|
41
|
+
onImageCaptured({ ...data, url: data.uri });
|
|
42
|
+
}
|
|
43
|
+
} catch (e) {
|
|
44
|
+
console.warn(e);
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/camerakit",
|
|
3
|
-
"version": "0.0.53-beta.
|
|
3
|
+
"version": "0.0.53-beta.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@momo-platform/versions": "4.0.2"
|
|
7
|
+
"@momo-platform/versions": "4.0.2",
|
|
8
|
+
"camerakit": "git+https://oauth2:glpat-x9P49rY2rKesd2_EuzRZ@gitlab.com/momo-platform/react-native-camera-kit.git#v1.1"
|
|
8
9
|
},
|
|
9
10
|
"peerDependencies": {
|
|
10
11
|
"react": "16.9.0",
|
|
@@ -12,4 +13,4 @@
|
|
|
12
13
|
},
|
|
13
14
|
"devDependencies": {},
|
|
14
15
|
"license": "MoMo"
|
|
15
|
-
}
|
|
16
|
+
}
|
package/publish.sh
CHANGED