Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit fa77543

Browse files
authored
Merge pull request #30 from abstraction-hq/24-change-qr-code-value-to-walletsenderaddress
fix QR code address
2 parents 10f6634 + 0b8e0c4 commit fa77543

4 files changed

Lines changed: 56 additions & 35 deletions

File tree

components/QRCode/index.tsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// components/QRCode.tsx
2+
import React from 'react';
3+
import { QRCodeSVG } from 'qrcode.react';
4+
5+
interface QRCodeProps {
6+
value: string;
7+
size?: number;
8+
bgColor?: string;
9+
fgColor?: string;
10+
level?: 'L' | 'M' | 'Q' | 'H';
11+
}
12+
13+
const QRCode: React.FC<QRCodeProps> = ({
14+
value,
15+
size = 180,
16+
bgColor = '#ffffff',
17+
fgColor = '#000000',
18+
level = 'L',
19+
}) => {
20+
return (
21+
<div className="flex justify-center items-center">
22+
<div className="p-1 bg-gray-100 rounded-lg shadow-md">
23+
<div className="bg-white p-2">
24+
<QRCodeSVG
25+
value={value}
26+
size={size}
27+
bgColor={bgColor}
28+
fgColor={fgColor}
29+
level={level}
30+
/>
31+
</div>
32+
</div>
33+
</div>
34+
);
35+
};
36+
37+
export default QRCode;

components/SendAndReceive/Receive/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Image from "@/components/Image";
22
import Icon from "@/components/Icon";
33
import Option from "@/components/Option";
4+
import QRCode from "@/components/QRCode";
45
import { useWalletStore } from "@/stores/walletStore";
56

67
type ReceiveProps = {};
@@ -18,13 +19,7 @@ const Receive = ({}: ReceiveProps) => {
1819
return (
1920
<>
2021
<div className="mb-6 p-6 text-center md:py-0">
21-
<Image
22-
className="max-w-full opacity-100"
23-
src="/images/qr-code.png"
24-
width={180}
25-
height={180}
26-
alt=""
27-
/>
22+
<QRCode value={wallet?.senderAddress} />
2823
</div>
2924
<div className="space-y-1">
3025
<Option classTitle="2xl:mr-3" title="Network" stroke>

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
"@passwordless-id/webauthn": "^1.6.1",
2020
"@peculiar/asn1-ecc": "^2.3.8",
2121
"@peculiar/asn1-schema": "^2.3.8",
22+
"@types/qrcode.react": "^1.0.5",
2223
"add": "^2.0.6",
2324
"axios": "^1.7.2",
2425
"base64url": "^3.0.1",
2526
"dotenv": "^16.4.5",
2627
"elliptic": "^6.5.5",
2728
"framer-motion": "^11.2.12",
2829
"next": "14.2.4",
30+
"qrcode.react": "^3.1.0",
2931
"react": "^18",
3032
"react-codes-input": "^2.2.3",
3133
"react-currency-input-field": "^3.8.0",

yarn.lock

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,13 @@
16301630
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6"
16311631
integrity sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==
16321632

1633+
"@types/qrcode.react@^1.0.5":
1634+
version "1.0.5"
1635+
resolved "https://registry.npmjs.org/@types/qrcode.react/-/qrcode.react-1.0.5.tgz#d4ddcacee8f34d22a663029a230c5f0ab908cfb7"
1636+
integrity sha512-BghPtnlwvrvq8QkGa1H25YnN+5OIgCKFuQruncGWLGJYOzeSKiix/4+B9BtfKF2wf5ja8yfyWYA3OXju995G8w==
1637+
dependencies:
1638+
"@types/react" "*"
1639+
16331640
"@types/react-dom@^18.3.0":
16341641
version "18.3.0"
16351642
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.0.tgz#0cbc818755d87066ab6ca74fbedb2547d74a82b0"
@@ -4264,6 +4271,11 @@ pvutils@^1.1.3:
42644271
resolved "https://registry.yarnpkg.com/pvutils/-/pvutils-1.1.3.tgz#f35fc1d27e7cd3dfbd39c0826d173e806a03f5a3"
42654272
integrity sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==
42664273

4274+
qrcode.react@^3.1.0:
4275+
version "3.1.0"
4276+
resolved "https://registry.npmjs.org/qrcode.react/-/qrcode.react-3.1.0.tgz#5c91ddc0340f768316fbdb8fff2765134c2aecd8"
4277+
integrity sha512-oyF+Urr3oAMUG/OiOuONL3HXM+53wvuH3mtIWQrYmsXoAq0DkvZp2RYUWFSMFtbdOpuS++9v+WAkzNVkMlNW6Q==
4278+
42674279
queue-microtask@^1.2.2:
42684280
version "1.2.3"
42694281
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
@@ -4668,16 +4680,7 @@ streamsearch@^1.1.0:
46684680
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
46694681
integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==
46704682

4671-
"string-width-cjs@npm:string-width@^4.2.0":
4672-
version "4.2.3"
4673-
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
4674-
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
4675-
dependencies:
4676-
emoji-regex "^8.0.0"
4677-
is-fullwidth-code-point "^3.0.0"
4678-
strip-ansi "^6.0.1"
4679-
4680-
string-width@^4.1.0, string-width@^4.2.0:
4683+
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0:
46814684
version "4.2.3"
46824685
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
46834686
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -4749,14 +4752,7 @@ string.prototype.trimstart@^1.0.8:
47494752
define-properties "^1.2.1"
47504753
es-object-atoms "^1.0.0"
47514754

4752-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
4753-
version "6.0.1"
4754-
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
4755-
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
4756-
dependencies:
4757-
ansi-regex "^5.0.1"
4758-
4759-
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
4755+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
47604756
version "6.0.1"
47614757
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
47624758
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -5244,16 +5240,7 @@ workerpool@^6.5.1:
52445240
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544"
52455241
integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==
52465242

5247-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
5248-
version "7.0.0"
5249-
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
5250-
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
5251-
dependencies:
5252-
ansi-styles "^4.0.0"
5253-
string-width "^4.1.0"
5254-
strip-ansi "^6.0.0"
5255-
5256-
wrap-ansi@^7.0.0:
5243+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
52575244
version "7.0.0"
52585245
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
52595246
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==

0 commit comments

Comments
 (0)