commit
d631b34d6b
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
name: QRCode
|
||||||
|
---
|
||||||
|
|
||||||
|
import { Playground, PropsTable } from 'docz'
|
||||||
|
|
||||||
|
import { QRCode } from './qrcode.js'
|
||||||
|
|
||||||
|
# QRCode
|
||||||
|
|
||||||
|
<PropsTable of={QRCode} />
|
||||||
|
|
||||||
|
## Basic usage
|
||||||
|
|
||||||
|
<Playground>
|
||||||
|
<QRCode value="https://astrocoders.com" />
|
||||||
|
</Playground>
|
||||||
|
|
||||||
|
## Custom size
|
||||||
|
|
||||||
|
<Playground>
|
||||||
|
<QRCode value="https://astrocoders.com" size={500} />
|
||||||
|
</Playground>
|
|
@ -0,0 +1,15 @@
|
||||||
|
// @flow
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import QR from 'qrcode.react';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
value: string,
|
||||||
|
size?: number,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const QRCode = ({ value, size }: Props) => <QR value={value} size={size} />;
|
||||||
|
|
||||||
|
QRCode.defaultProps = {
|
||||||
|
size: 128,
|
||||||
|
};
|
|
@ -87,6 +87,7 @@
|
||||||
"autoprefixer": "^9.3.1",
|
"autoprefixer": "^9.3.1",
|
||||||
"connected-react-router": "^5.0.1",
|
"connected-react-router": "^5.0.1",
|
||||||
"history": "^4.7.2",
|
"history": "^4.7.2",
|
||||||
|
"qrcode.react": "^0.8.0",
|
||||||
"react": "^16.6.0",
|
"react": "^16.6.0",
|
||||||
"react-dom": "^16.6.0",
|
"react-dom": "^16.6.0",
|
||||||
"react-redux": "^5.0.7",
|
"react-redux": "^5.0.7",
|
||||||
|
|
13
yarn.lock
13
yarn.lock
|
@ -11121,6 +11121,19 @@ q@~0.9.6:
|
||||||
resolved "https://registry.yarnpkg.com/q/-/q-0.9.7.tgz#4de2e6cb3b29088c9e4cbc03bf9d42fb96ce2f75"
|
resolved "https://registry.yarnpkg.com/q/-/q-0.9.7.tgz#4de2e6cb3b29088c9e4cbc03bf9d42fb96ce2f75"
|
||||||
integrity sha1-TeLmyzspCIyeTLwDv51C+5bOL3U=
|
integrity sha1-TeLmyzspCIyeTLwDv51C+5bOL3U=
|
||||||
|
|
||||||
|
qr.js@0.0.0:
|
||||||
|
version "0.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/qr.js/-/qr.js-0.0.0.tgz#cace86386f59a0db8050fa90d9b6b0e88a1e364f"
|
||||||
|
integrity sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8=
|
||||||
|
|
||||||
|
qrcode.react@^0.8.0:
|
||||||
|
version "0.8.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/qrcode.react/-/qrcode.react-0.8.0.tgz#413b31cc3b62910e39513f7bead945e01c4c34fb"
|
||||||
|
integrity sha512-16wKpuFvLwciIq2YAsfmPUCnSR8GrYPsXRK5KVdcIuX0+W/MKZbBkFhl44ttRx4TWZHqRjfztoWOxdPF0Hb9JA==
|
||||||
|
dependencies:
|
||||||
|
prop-types "^15.6.0"
|
||||||
|
qr.js "0.0.0"
|
||||||
|
|
||||||
qs@6.5.2, qs@~6.5.2:
|
qs@6.5.2, qs@~6.5.2:
|
||||||
version "6.5.2"
|
version "6.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
||||||
|
|
Loading…
Reference in New Issue