Skip to content

Commit

Permalink
fix: qrcode logo margin increase to improve error correction for cb w…
Browse files Browse the repository at this point in the history
…allet
  • Loading branch information
DanielSinclair committed May 6, 2024
1 parent c260407 commit ce9a87b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/rainbowkit/src/components/QRCode/QRCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Props = {
export function QRCode({
ecl = 'M',
logoBackground,
logoMargin = 10,
logoMargin = 13,
logoSize = 50,
logoUrl,
size: sizeProp = 200,
Expand Down Expand Up @@ -74,7 +74,7 @@ export function QRCode({
}
});

const clearArenaSize = Math.floor((logoSize + 25) / cellSize);
const clearArenaSize = Math.floor((logoSize + logoMargin * 2) / cellSize);
const matrixMiddleStart = matrix.length / 2 - clearArenaSize / 2;
const matrixMiddleEnd = matrix.length / 2 + clearArenaSize / 2 - 1;

Expand Down Expand Up @@ -114,7 +114,7 @@ export function QRCode({
});

return dots;
}, [ecl, logoSize, size, uri]);
}, [ecl, logoSize, logoMargin, size, uri]);

const logoPosition = size / 2 - logoSize / 2;
const logoWrapperSize = logoSize + logoMargin * 2;
Expand Down

0 comments on commit ce9a87b

Please sign in to comment.