Skip to content

Commit 4ca4731

Browse files
committed
Merge branch 'release/5.0.0'
2 parents 72e6eda + 68905c4 commit 4ca4731

7 files changed

Lines changed: 2028 additions & 60 deletions

File tree

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ react-native link react-native-svg
2323
npm install react-native-qrcode-svg --save
2424
```
2525

26-
### Examples
26+
## Examples
2727

2828
```
2929
import QRCode from 'react-native-qrcode-svg';
@@ -88,7 +88,7 @@ render() {
8888
```
8989

9090

91-
### Props
91+
## Props
9292

9393
Name | Default | Description
9494
----------------|------------|--------------
@@ -99,6 +99,7 @@ logo | null | Image source object. Ex. {uri: 'base64string'} or {require(
9999
logoSize | 20% of size | Size of the imprinted logo. Bigger logo = less error correction in QR code
100100
logoBackgroundColor | backgroundColor | The logo gets a filled quadratic background with this color. Use 'transparent' if your logo already has its own backdrop.
101101
getRef | null | Get SVG ref for further usage
102+
ecl | 'M' | Error correction level
102103

103104

104105
## Saving generated code to gallery
@@ -127,8 +128,12 @@ saveQrToDisk() {
127128
```
128129

129130

130-
### Dependencies
131+
## Dependencies
132+
133+
### PeerDependencies
131134

132135
* [react-native-svg](https://github.com/magicismight/react-native-svg)
133136

134-
* [javascript-qrcode](https://github.com/siciarek/javascript-qrcode)
137+
### Dependencies
138+
139+
* [node-qrcode](https://github.com/soldair/node-qrcode)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-qrcode-svg",
3-
"version": "4.0.2",
3+
"version": "5.0.0",
44
"description": "A QR Code generator for React Native based on react-native-svg and javascript-qrcode.",
55
"main": "index.js",
66
"scripts": {
@@ -41,7 +41,7 @@
4141
"react-native-svg": "^5.1.5"
4242
},
4343
"dependencies": {
44-
"javascript-qrcode": "git+https://git@github.com/awesomejerry/javascript-qrcode.git"
44+
"qrcode": "^0.8.1"
4545
},
4646
"devDependencies": {
4747
"babel-eslint": "^7.2.2",

src/__tests__/Matrix-test.js

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
11
import genMatrix from '../genMatrix'
22

3-
const expected = [
4-
[ 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 ],
5-
[ 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1 ],
6-
[ 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1 ],
7-
[ 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1 ],
8-
[ 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1 ],
9-
[ 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1 ],
10-
[ 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 ],
11-
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
12-
[ 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0 ],
13-
[ 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1 ],
14-
[ 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1 ],
15-
[ 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0 ],
16-
[ 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1 ],
17-
[ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1 ],
18-
[ 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1 ],
19-
[ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0 ],
20-
[ 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1 ],
21-
[ 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0 ],
22-
[ 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1 ],
23-
[ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0 ],
24-
[ 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1 ]
25-
]
26-
27-
it('generates correctly', () => {
3+
it('generates with ecl:M correctly', () => {
284
const matrix = genMatrix('test')
29-
expect(matrix).toEqual(expected)
5+
expect(matrix).toMatchSnapshot()
6+
})
7+
8+
it('generates with ecl:L correctly', () => {
9+
const matrix = genMatrix('test', 'L')
10+
expect(matrix).toMatchSnapshot()
11+
})
12+
13+
it('generates with ecl:H correctly', () => {
14+
const matrix = genMatrix('test', 'H')
15+
expect(matrix).toMatchSnapshot()
16+
})
17+
18+
it('generates with ecl:Q correctly', () => {
19+
const matrix = genMatrix('test', 'Q')
20+
expect(matrix).toMatchSnapshot()
3021
})

0 commit comments

Comments
 (0)