From abd04b4ccf7763d423a820a381f2c947def8d6a9 Mon Sep 17 00:00:00 2001 From: horsefacts Date: Fri, 10 May 2024 19:36:10 -0400 Subject: [PATCH 1/2] feat: improve QR code legibility Co-authored-by: Vladyslav Dalechyn --- .../auth-kit/src/components/FarcasterLogo.tsx | 1 + packages/auth-kit/src/components/QRCode.tsx | 23 ++++++++++--------- .../components/QRCodeDialog/QRCodeDialog.tsx | 4 +++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/packages/auth-kit/src/components/FarcasterLogo.tsx b/packages/auth-kit/src/components/FarcasterLogo.tsx index 650305f..40b916b 100644 --- a/packages/auth-kit/src/components/FarcasterLogo.tsx +++ b/packages/auth-kit/src/components/FarcasterLogo.tsx @@ -12,6 +12,7 @@ export function FarcasterLogo({ xmlns="http://www.w3.org/2000/svg" width={width} height={height} + viewBox="0 0 22 20" fill="none" > Farcaster logo diff --git a/packages/auth-kit/src/components/QRCode.tsx b/packages/auth-kit/src/components/QRCode.tsx index c129e2a..14d49cf 100644 --- a/packages/auth-kit/src/components/QRCode.tsx +++ b/packages/auth-kit/src/components/QRCode.tsx @@ -40,8 +40,8 @@ export function QRCode({ const padding = "20"; const size = sizeProp - parseInt(padding, 10) * 2; - const dots = useMemo(() => { - const dots: ReactElement[] = []; + const squares = useMemo(() => { + const squares: ReactElement[] = []; const matrix = generateMatrix(uri, ecl); const cellSize = size / matrix.length; const qrList = [ @@ -54,7 +54,7 @@ export function QRCode({ const x1 = (matrix.length - 7) * cellSize * x; const y1 = (matrix.length - 7) * cellSize * y; for (let i = 0; i < 3; i++) { - dots.push( + squares.push( ); } @@ -106,7 +107,7 @@ export function QRCode({ }); }); - return dots; + return squares; }, [ecl, logoSize, logoMargin, size, uri]); const logoPosition = size / 2 - logoSize / 2; @@ -135,7 +136,7 @@ export function QRCode({ - {dots} + {squares} diff --git a/packages/auth-kit/src/components/QRCodeDialog/QRCodeDialog.tsx b/packages/auth-kit/src/components/QRCodeDialog/QRCodeDialog.tsx index 31bc4e5..a61d3b1 100644 --- a/packages/auth-kit/src/components/QRCodeDialog/QRCodeDialog.tsx +++ b/packages/auth-kit/src/components/QRCodeDialog/QRCodeDialog.tsx @@ -32,6 +32,7 @@ export function QRCodeDialog({ height={18} fill="none" > + Sign in With Farcaster - +