next-helios-fe 1.1.0 → 1.1.2
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/package.json
CHANGED
package/src/components/index.ts
CHANGED
|
@@ -27,4 +27,4 @@ export { BigCalendar } from "./calendar/big-calendar";
|
|
|
27
27
|
export { Timeline } from "./timeline";
|
|
28
28
|
export { DataTree } from "./data-tree";
|
|
29
29
|
export { SyntaxHighlighter } from "./syntax-highlighter";
|
|
30
|
-
export {
|
|
30
|
+
export { QRCode } from "./qr-code";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import React, { useState, useEffect } from "react";
|
|
3
3
|
import Image from "next/image";
|
|
4
|
-
import
|
|
4
|
+
import QR from "qrcode";
|
|
5
5
|
|
|
6
6
|
interface QRProps {
|
|
7
7
|
value: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const QRCode: React.FC<QRProps> = ({ value }) => {
|
|
11
11
|
const [qr, setQr] = useState<string>("");
|
|
12
12
|
const options = {
|
|
13
13
|
scale: 10,
|
|
@@ -16,7 +16,7 @@ export const QR: React.FC<QRProps> = ({ value }) => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
useEffect(() => {
|
|
19
|
-
|
|
19
|
+
QR.toDataURL(value || "", options, (err: any, data: any) => {
|
|
20
20
|
if (err) {
|
|
21
21
|
console.log(err);
|
|
22
22
|
}
|