File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ const Receive = ({
6363 onQRCodeClick = { ( ) => setShowLargeQRCode ( true ) }
6464 size = { 256 }
6565 exportable
66+ includeMargin
6667 dispatch = { dispatch }
6768 />
6869 </ Stack >
Original file line number Diff line number Diff line change @@ -102,12 +102,18 @@ const QRCode = ({
102102 qrcode . make ( )
103103
104104 const cells = qrcode . modules || [ ]
105- const margin = includeMargin ? 4 : 0
105+ const margin = includeMargin ? 1 : 0
106106 const fgPath = generatePath ( cells , margin )
107107 const numCells = cells . length + margin * 2
108108
109- const svgStr = `<svg shapeRendering="crispEdges" height="${ scale * size } " width="${ scale *
110- size } " viewBox="0 0 ${ numCells } ${ numCells } " ><path fill="${ bgColor } " d="M0, 0 h${ numCells } v${ numCells } H0z" /><path fill="${ fgColor } " d="${ fgPath } " /></svg>`
109+ const svgStr = `<svg shapeRendering="crispEdges"
110+ width="${ scale * size } "
111+ height="${ scale * size } "
112+ viewBox="0 0 ${ numCells } ${ numCells } "
113+ >
114+ <path fill="${ bgColor } " d="M0, 0 h${ numCells } v${ numCells } H0z" />
115+ <path fill="${ fgColor } " d="${ fgPath } " />
116+ </svg>`
111117
112118 const onDownload = useCallback ( ( ) => {
113119 if ( canvasRef . current === null ) {
@@ -147,7 +153,7 @@ const QRCode = ({
147153 } , [ svgStr , size ] )
148154
149155 return (
150- < Stack tokens = { { childrenGap : 15 } } >
156+ < Stack tokens = { { childrenGap : 15 } } horizontalAlign = "center" verticalAlign = "center" >
151157 < Stack . Item >
152158 < canvas ref = { canvasRef } width = { size } height = { size } onClick = { onQRCodeClick } />
153159 </ Stack . Item >
You can’t perform that action at this time.
0 commit comments