react-native-qrcode-svg
Advanced tools
Comparing version 6.0.6 to 6.0.7
{ | ||
"name": "react-native-qrcode-svg", | ||
"version": "6.0.6", | ||
"version": "6.0.7", | ||
"description": "A QR Code generator for React Native based on react-native-svg and javascript-qrcode.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,12 +15,28 @@ [![NPM](https://nodei.co/npm/react-native-qrcode-svg.png)](https://npmjs.org/package/react-native-qrcode-svg) | ||
<img src="https://raw.githubusercontent.com/awesomejerry/react-native-qrcode-svg/master/screenshot/android.png" width="150"> | ||
<img src="https://raw.githubusercontent.com/awesomejerry/react-native-qrcode-svg/master/screenshot/ios.png" width="150"> | ||
| Android | iOS | | ||
| - | - | | ||
| <img src="https://raw.githubusercontent.com/awesomejerry/react-native-qrcode-svg/master/screenshot/android.png" width="240"> | <img src="https://raw.githubusercontent.com/awesomejerry/react-native-qrcode-svg/master/screenshot/ios.png" width="240"> | | ||
## Installation | ||
Please install react-native-svg first. | ||
Install dependency packages | ||
```bash | ||
yarn add react-native-svg react-native-qrcode-svg | ||
``` | ||
npm install react-native-svg --save | ||
Or | ||
```bash | ||
npm i -S react-native-svg react-native-qrcode-svg | ||
``` | ||
If you are using `React Native 0.60.+` go to the folder **your-project/ios** and run `pod install`, and you're done. | ||
If not, use one of the following method to link. | ||
## Link with `react-native link` | ||
If you are using `React Native <= 0.59.X`, link the native project: | ||
```bash | ||
react-native link react-native-svg | ||
npm install react-native-qrcode-svg --save | ||
``` | ||
@@ -30,6 +46,6 @@ | ||
``` | ||
```jsx | ||
import QRCode from 'react-native-qrcode-svg'; | ||
//Simple usage, defaults for all but the value | ||
// Simple usage, defaults for all but the value | ||
render() { | ||
@@ -42,6 +58,5 @@ return ( | ||
}; | ||
``` | ||
``` | ||
```jsx | ||
// 30px logo from base64 string with transparent background | ||
@@ -59,6 +74,5 @@ render() { | ||
}; | ||
``` | ||
``` | ||
```jsx | ||
// 20% (default) sized logo from local file string with white logo backdrop | ||
@@ -74,6 +88,5 @@ render() { | ||
}; | ||
``` | ||
``` | ||
```jsx | ||
// get base64 string encode of the qrcode (currently logo is not included) | ||
@@ -83,5 +96,7 @@ getDataURL() { | ||
} | ||
callback(dataURL) { | ||
console.log(dataURL); | ||
} | ||
render() { | ||
@@ -97,3 +112,2 @@ return ( | ||
## Props | ||
@@ -127,3 +141,4 @@ | ||
### Example for Android: | ||
``` | ||
```js | ||
import { CameraRoll , ToastAndroid } from "react-native" | ||
@@ -130,0 +145,0 @@ import RNFS from "react-native-fs" |
@@ -9,3 +9,3 @@ export default (matrix, size) => { | ||
if (!needDraw) { | ||
path += `M${cellSize * j} ${cellSize / 2 + cellSize * i} ` | ||
path += `M${cellSize * (j + 1)} ${cellSize / 2 + cellSize * i} ` | ||
needDraw = true | ||
@@ -12,0 +12,0 @@ } |
Sorry, the diff of this file is not supported yet
143821
170