-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wallet): add QR code to receive popup (#2144)
* feat: add qr to popup * feat: update QR
- Loading branch information
1 parent
3b6e380
commit a01d5cc
Showing
5 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { QRCodeSVG } from 'qrcode.react'; | ||
|
||
export enum QRLevel { | ||
L = 'L', | ||
M = 'M', | ||
Q = 'Q', | ||
H = 'H', | ||
} | ||
interface QRProps { | ||
value: string; | ||
size: number; | ||
bgColor?: string; | ||
fgColor?: string; | ||
level?: QRLevel; | ||
marginSize?: number; | ||
title?: string; | ||
} | ||
|
||
export function QR({ | ||
value, | ||
size, | ||
bgColor = '#ffffff', | ||
fgColor = '#000000', | ||
level = QRLevel.L, | ||
marginSize, | ||
title, | ||
}: QRProps) { | ||
return ( | ||
<QRCodeSVG | ||
value={value} | ||
size={size} | ||
bgColor={bgColor} | ||
fgColor={fgColor} | ||
level={level} | ||
marginSize={marginSize} | ||
title={title} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.