@momo-kits/qrcode 0.0.32-beta → 0.0.32
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 +21 -1
- package/QRCodeView.js +40 -1
- package/index.js +6 -1
- package/package.json +7 -15
- package/publish.sh +2 -2
- package/babel.config.js +0 -1
package/BarCodeView.js
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { ViewPropTypes, PixelRatio } from 'react-native';
|
|
4
|
+
import { RCTBarCode } from '@momo-kits/core';
|
|
5
|
+
|
|
6
|
+
const ratio = PixelRatio.get();
|
|
7
|
+
function BarCodeView(props) {
|
|
8
|
+
return (
|
|
9
|
+
<RCTBarCode ratio={ratio} {...props} />
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
BarCodeView.propTypes = {
|
|
14
|
+
code: PropTypes.string,
|
|
15
|
+
width: PropTypes.number,
|
|
16
|
+
height: PropTypes.number,
|
|
17
|
+
ratio: PropTypes.number,
|
|
18
|
+
...ViewPropTypes,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default BarCodeView;
|
package/QRCodeView.js
CHANGED
|
@@ -1 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { ViewPropTypes, PixelRatio, Image } from 'react-native';
|
|
4
|
+
import { RCTQRCode } from '@momo-kits/core';
|
|
5
|
+
|
|
6
|
+
const ratio = PixelRatio.get();
|
|
7
|
+
const ic_logo = 'https://img.mservice.io/momo_app_v2/new_version/img/appx_image/ic_momo.png';
|
|
8
|
+
|
|
9
|
+
function QRCodeView(props) {
|
|
10
|
+
const { showLogo, size = 0 } = props || {};
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<RCTQRCode ratio={ratio} {...props} />
|
|
14
|
+
{showLogo
|
|
15
|
+
? (
|
|
16
|
+
<Image
|
|
17
|
+
source={{ uri: ic_logo }}
|
|
18
|
+
style={{
|
|
19
|
+
width: size / 6,
|
|
20
|
+
height: size / 6,
|
|
21
|
+
position: 'absolute',
|
|
22
|
+
marginTop: size / 2 - size / 12,
|
|
23
|
+
marginLeft: size / 2 - size / 12
|
|
24
|
+
}}
|
|
25
|
+
/>
|
|
26
|
+
) : null}
|
|
27
|
+
</>
|
|
28
|
+
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
QRCodeView.propTypes = {
|
|
33
|
+
code: PropTypes.string,
|
|
34
|
+
size: PropTypes.number,
|
|
35
|
+
ratio: PropTypes.number,
|
|
36
|
+
showLogo: PropTypes.bool,
|
|
37
|
+
...ViewPropTypes,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
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,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/qrcode",
|
|
3
|
-
"version": "0.0.32
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"prop-types": "^15.7.2",
|
|
8
|
-
"react": "16.9.0"
|
|
9
|
-
},
|
|
6
|
+
"dependencies": {},
|
|
10
7
|
"peerDependencies": {
|
|
8
|
+
"react-native": ">=0.55",
|
|
9
|
+
"prop-types": "^15.7.2",
|
|
11
10
|
"react": "16.9.0",
|
|
12
|
-
"
|
|
13
|
-
},
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
"metro-react-native-babel-preset": "^0.64.0",
|
|
16
|
-
"@babel/core": "^7.12.9",
|
|
17
|
-
"@babel/runtime": "^7.12.5"
|
|
11
|
+
"@momo-kits/core": "latest"
|
|
18
12
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"preset": "react-native"
|
|
22
|
-
}
|
|
13
|
+
"devDependencies": {},
|
|
14
|
+
"license": "MoMo"
|
|
23
15
|
}
|
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']};
|