New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-qr-code

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-qr-code - npm Package Compare versions

Comparing version 0.0.1-rc.7 to 0.1.0

25

lib/components/QRCode/index.js

@@ -82,8 +82,8 @@ 'use strict';

value: function renderQRCode() {
var _props = this.props;
var bgColor = _props.bgColor;
var fgColor = _props.fgColor;
var level = _props.level;
var size = _props.size;
var value = _props.value;
var _props = this.props,
bgColor = _props.bgColor,
fgColor = _props.fgColor,
level = _props.level,
size = _props.size,
value = _props.value;
// We'll use type === -1 to force QRCode to automatically pick the best type

@@ -95,12 +95,11 @@

var cells = qrcode.modules;
var tileW = size / cells.length;
var tileH = size / cells.length;
var tileSize = size / cells.length;
return cells.map(function (row, rowIndex) {
return row.map(function (cell, cellIndex) {
var fill = cell ? fgColor : bgColor;
var qrItemWidth = Math.ceil((cellIndex + 1) * tileW) - Math.floor(cellIndex * tileW);
var qrItemHeight = Math.ceil((rowIndex + 1) * tileH) - Math.floor(rowIndex * tileH);
var d = 'M 0 0 L ' + qrItemWidth + ' 0 L ' + qrItemWidth + ' -' + qrItemHeight + ' L 0 -' + qrItemHeight + ' Z';
var transformX = Math.round(cellIndex * tileW);
var transformY = Math.round(rowIndex * tileH);
var qrItemWidth = Math.ceil((cellIndex + 1) * tileSize) - Math.floor(cellIndex * tileSize);
var qrItemHeight = Math.ceil((rowIndex + 1) * tileSize) - Math.floor(rowIndex * tileSize);
var d = 'M 0 0 L ' + qrItemWidth + ' 0 L ' + qrItemWidth + ' ' + qrItemHeight + ' L 0 ' + qrItemHeight + ' Z';
var transformX = Math.round(cellIndex * tileSize);
var transformY = Math.round(rowIndex * tileSize);
return _react2.default.createElement(_QRCodeSurfaceCell2.default, {

@@ -107,0 +106,0 @@ key: 'rectangle-' + rowIndex + '-' + cellIndex,

@@ -23,5 +23,5 @@ 'use strict';

var QRCodeSurface = function QRCodeSurface(_ref) {
var children = _ref.children;
var size = _ref.size;
var style = _ref.style;
var children = _ref.children,
size = _ref.size,
style = _ref.style;
return _react2.default.createElement(

@@ -28,0 +28,0 @@ Surface,

@@ -24,6 +24,6 @@ 'use strict';

var QRCodeSurfaceCell = function QRCodeSurfaceCell(_ref) {
var d = _ref.d;
var fill = _ref.fill;
var transformX = _ref.transformX;
var transformY = _ref.transformY;
var d = _ref.d,
fill = _ref.fill,
transformX = _ref.transformX,
transformY = _ref.transformY;

@@ -30,0 +30,0 @@ var transform = new Transform().translate(transformX, transformY);

{
"name": "react-qr-code",
"version": "0.0.1-rc.7",
"version": "0.1.0",
"description": "A <QRCode /> component for React.",

@@ -22,4 +22,4 @@ "keywords": [

"build": "npm run lint && npm run clean && babel src --out-dir lib",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
"build-storybook": "build-storybook -o docs",
"storybook": "start-storybook -p 6006"
},

@@ -37,9 +37,11 @@ "license": "MIT",

"qr.js": "0.0.0",
"react-addons-shallow-compare": "^15.2.1"
"react": "^15.0.0",
"react-addons-shallow-compare": "^15.2.1",
"react-dom": "^15.0.0"
},
"peerDependencies": {
"react": "^15.0.0",
"react-art": "^0.15.1"
},
"devDependencies": {
"@kadira/storybook": "^2.21.0",
"babel": "^6.3.26",

@@ -61,5 +63,4 @@ "babel-cli": "^6.16.0",

"webpack": "^1.13.2",
"webpack-dev-server": "^1.16.1",
"@kadira/storybook": "^2.21.0"
"webpack-dev-server": "^1.16.1"
}
}
# react-qr-code
[![Build Status](https://travis-ci.org/opensource-cards/react-qr-code.svg?branch=master)](https://travis-ci.org/opensource-cards/react-qr-code)
[![npm package](https://badge.fury.io/js/react-qr-code.svg)](https://www.npmjs.org/package/react-qr-code)

@@ -43,3 +44,3 @@ [![Dependency Status](https://david-dm.org/opensource-cards/react-qr-code.svg)](https://david-dm.org/opensource-cards/react-qr-code)

* Main ([source](https://github.com/opensource-cards/react-qr-code/tree/master/examples/main))
* Storybook ([source](https://github.com/opensource-cards/react-qr-code/tree/master/stories))

@@ -46,0 +47,0 @@ ### License

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc