@oguzhnatly/react-native-custom-qr-codes 2.0.0
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/.github/workflows/build.yml +32 -0
- package/.github/workflows/publish.yml +69 -0
- package/CONTRIBUTING.md +14 -0
- package/LICENSE +21 -0
- package/README.md +181 -0
- package/index.d.ts +32 -0
- package/index.js +1 -0
- package/lib/QRCode.js +529 -0
- package/lib/QRCodeGenerator.js +1862 -0
- package/lib/styles/codeStyles/circle.js +31 -0
- package/lib/styles/codeStyles/diamond.js +35 -0
- package/lib/styles/codeStyles/dot.js +31 -0
- package/lib/styles/codeStyles/index.js +36 -0
- package/lib/styles/codeStyles/ninja.js +132 -0
- package/lib/styles/codeStyles/sharp.js +118 -0
- package/lib/styles/codeStyles/square.js +32 -0
- package/lib/styles/index.js +45 -0
- package/lib/styles/innerEyeStyles/circle.js +31 -0
- package/lib/styles/innerEyeStyles/diamond.js +35 -0
- package/lib/styles/innerEyeStyles/index.js +31 -0
- package/lib/styles/innerEyeStyles/none.js +8 -0
- package/lib/styles/innerEyeStyles/square.js +32 -0
- package/lib/styles/outerEyeStyles/circle.js +31 -0
- package/lib/styles/outerEyeStyles/diamond.js +35 -0
- package/lib/styles/outerEyeStyles/index.js +30 -0
- package/lib/styles/outerEyeStyles/none.js +8 -0
- package/lib/styles/outerEyeStyles/square.js +32 -0
- package/package.json +39 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
index.js
|
|
4
|
+
|
|
5
|
+
This file exports a function for drawing the outer eye pieces of a QRCode
|
|
6
|
+
|
|
7
|
+
--Geoff Natin 11/1/18 17:41
|
|
8
|
+
|
|
9
|
+
*/
|
|
10
|
+
import { drawCirclesPiece } from "./circle";
|
|
11
|
+
import { drawDiamondPiece } from "./diamond";
|
|
12
|
+
import { drawNone } from "./none";
|
|
13
|
+
import { drawSquarePiece } from "./square";
|
|
14
|
+
|
|
15
|
+
//Returns an SVG Element for an outer eye piece in the style of the outerEyeStyle
|
|
16
|
+
export function drawOuterEyePiece(x, y, modules, pieceProperties, props) {
|
|
17
|
+
switch (props.outerEyeStyle) {
|
|
18
|
+
case "square":
|
|
19
|
+
return drawSquarePiece(x, y, modules, pieceProperties, props);
|
|
20
|
+
case "circles":
|
|
21
|
+
return drawCirclesPiece(x, y, modules, pieceProperties, props);
|
|
22
|
+
case "diamond":
|
|
23
|
+
return drawDiamondPiece(x, y, modules, pieceProperties, props);
|
|
24
|
+
case "circle":
|
|
25
|
+
case "rounded":
|
|
26
|
+
return drawNone(x, y, modules, pieceProperties, props);
|
|
27
|
+
default:
|
|
28
|
+
return drawSquarePiece(x, y, modules, pieceProperties, props);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
square.js
|
|
4
|
+
|
|
5
|
+
This file exports a function for drawing a square outer eye piece for a QRCode
|
|
6
|
+
|
|
7
|
+
--Geoff Natin 11/1/18 17:41
|
|
8
|
+
|
|
9
|
+
*/
|
|
10
|
+
import React, { Component } from "react";
|
|
11
|
+
import Svg, { Rect } from "react-native-svg";
|
|
12
|
+
|
|
13
|
+
//Returns an SVG Element for a piece of the 'square' outerEyeStyle
|
|
14
|
+
export function drawSquarePiece(x, y, modules, pieceProperties, props) {
|
|
15
|
+
var length = modules.length;
|
|
16
|
+
var width = props.size;
|
|
17
|
+
var height = props.size;
|
|
18
|
+
var xsize = width / length;
|
|
19
|
+
var ysize = height / length;
|
|
20
|
+
var px = x * xsize;
|
|
21
|
+
var py = y * ysize;
|
|
22
|
+
return (
|
|
23
|
+
<Rect
|
|
24
|
+
key={px + ":" + py}
|
|
25
|
+
x={px}
|
|
26
|
+
y={py}
|
|
27
|
+
width={xsize}
|
|
28
|
+
height={ysize}
|
|
29
|
+
fill={props.color}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oguzhnatly/react-native-custom-qr-codes",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"description": "Customizable QR codes for React Native with TypeScript and RTL support",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"react-native",
|
|
8
|
+
"react-native-component",
|
|
9
|
+
"react",
|
|
10
|
+
"mobile",
|
|
11
|
+
"ios",
|
|
12
|
+
"android",
|
|
13
|
+
"qr-code",
|
|
14
|
+
"custom-qr-code"
|
|
15
|
+
],
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Oguzhan Atalay",
|
|
18
|
+
"url": "https://github.com/oguzhnatly"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/oguzhnatly/react-native-custom-qr-codes",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/oguzhnatly/react-native-custom-qr-codes"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/oguzhnatly/react-native-custom-qr-codes/issues"
|
|
27
|
+
},
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"prop-types": "^15.5.10",
|
|
31
|
+
"styled-components": "^5.3.5"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react-native-svg": "^6.2.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/react-native": "^0.67.5"
|
|
38
|
+
}
|
|
39
|
+
}
|