@momo-kits/qrcode 0.0.32-beta → 0.0.38-beta
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/BarCodeView.js +33 -1
- package/QRCodeView.js +53 -1
- package/index.js +6 -1
- package/package.json +6 -15
- package/publish.sh +2 -2
- package/babel.config.js +0 -1
package/BarCodeView.js
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { requireNativeComponent, ViewPropTypes, PixelRatio } from 'react-native';
|
|
4
|
+
|
|
5
|
+
const iface = {
|
|
6
|
+
name: 'RCTBarCode',
|
|
7
|
+
propTypes: {
|
|
8
|
+
code: PropTypes.string,
|
|
9
|
+
width: PropTypes.number,
|
|
10
|
+
height: PropTypes.number,
|
|
11
|
+
ratio: PropTypes.number,
|
|
12
|
+
...ViewPropTypes,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const RCTBarCode = requireNativeComponent('RCTBarCode', iface);
|
|
17
|
+
const ratio = PixelRatio.get();
|
|
18
|
+
|
|
19
|
+
function BarCodeView(props) {
|
|
20
|
+
return (
|
|
21
|
+
<RCTBarCode ratio={ratio} {...props} />
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
BarCodeView.propTypes = {
|
|
26
|
+
code: PropTypes.string,
|
|
27
|
+
width: PropTypes.number,
|
|
28
|
+
height: PropTypes.number,
|
|
29
|
+
ratio: PropTypes.number,
|
|
30
|
+
...ViewPropTypes,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default BarCodeView;
|
package/QRCodeView.js
CHANGED
|
@@ -1 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import {
|
|
4
|
+
requireNativeComponent, ViewPropTypes, PixelRatio, Image
|
|
5
|
+
} from 'react-native';
|
|
6
|
+
|
|
7
|
+
const iface = {
|
|
8
|
+
name: 'QRCodeView',
|
|
9
|
+
propTypes: {
|
|
10
|
+
code: PropTypes.string,
|
|
11
|
+
size: PropTypes.number,
|
|
12
|
+
ratio: PropTypes.number,
|
|
13
|
+
showLogo: PropTypes.bool,
|
|
14
|
+
...ViewPropTypes,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const RCTQRCode = requireNativeComponent('RCTQRCode', iface);
|
|
19
|
+
const ratio = PixelRatio.get();
|
|
20
|
+
const ic_logo = 'https://img.mservice.io/momo_app_v2/new_version/img/appx_image/ic_momo.png';
|
|
21
|
+
|
|
22
|
+
function QRCodeView(props) {
|
|
23
|
+
const { showLogo, size = 0 } = props || {};
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<RCTQRCode ratio={ratio} {...props} />
|
|
27
|
+
{showLogo
|
|
28
|
+
? (
|
|
29
|
+
<Image
|
|
30
|
+
source={{ uri: ic_logo }}
|
|
31
|
+
style={{
|
|
32
|
+
width: size / 6,
|
|
33
|
+
height: size / 6,
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
marginTop: size / 2 - size / 12,
|
|
36
|
+
marginLeft: size / 2 - size / 12
|
|
37
|
+
}}
|
|
38
|
+
/>
|
|
39
|
+
) : null}
|
|
40
|
+
</>
|
|
41
|
+
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
QRCodeView.propTypes = {
|
|
46
|
+
code: PropTypes.string,
|
|
47
|
+
size: PropTypes.number,
|
|
48
|
+
ratio: PropTypes.number,
|
|
49
|
+
showLogo: PropTypes.bool,
|
|
50
|
+
...ViewPropTypes,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default QRCodeView;
|
package/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import BarCodeView from './BarCodeView';
|
|
2
|
+
import QRCodeView from './QRCodeView';
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
BarCodeView, QRCodeView
|
|
6
|
+
};
|
package/package.json
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/qrcode",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38-beta",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"dependencies": {
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"react-native": ">=0.55",
|
|
7
9
|
"prop-types": "^15.7.2",
|
|
8
10
|
"react": "16.9.0"
|
|
9
11
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"react-native": ">=0.55"
|
|
13
|
-
},
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
"metro-react-native-babel-preset": "^0.64.0",
|
|
16
|
-
"@babel/core": "^7.12.9",
|
|
17
|
-
"@babel/runtime": "^7.12.5"
|
|
18
|
-
},
|
|
19
|
-
"license": "MOMO",
|
|
20
|
-
"jest": {
|
|
21
|
-
"preset": "react-native"
|
|
22
|
-
}
|
|
12
|
+
"devDependencies": {},
|
|
13
|
+
"license": "MoMo"
|
|
23
14
|
}
|
package/publish.sh
CHANGED
|
@@ -12,7 +12,7 @@ echo VERSION: $VERSION
|
|
|
12
12
|
rsync -r --verbose --exclude '*.mdx' --exclude '*Demo.js' --exclude 'props-type.js' --exclude 'prop-types.js' ./* dist
|
|
13
13
|
|
|
14
14
|
# #babel component to dist
|
|
15
|
-
babel ./dist -d dist --copy-files
|
|
15
|
+
#babel ./dist -d dist --copy-files
|
|
16
16
|
|
|
17
17
|
#copy option
|
|
18
18
|
#cp -r ./src/ dist
|
|
@@ -26,4 +26,4 @@ cd ..
|
|
|
26
26
|
rm -rf dist
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/qrcode new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/qrcode"}'
|
package/babel.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports={presets:['module:metro-react-native-babel-preset']};
|