This repository was archived by the owner on Feb 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
packages/lightning-components/QRCode Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -5,17 +5,23 @@ import qrImage from 'qr-image'
55export const QRCode = {
66 bitcoin : ( { address } ) => {
77 const bitcoinURL = format ( { protocol : 'bitcoin:' , host : address } )
8- const svg = qrImage . imageSync ( bitcoinURL , { type : 'svg' } )
8+ const svg = qrImage . svgObject ( bitcoinURL , { type : 'svg' } )
99
10- // eslint-disable-next-line react/no-danger
11- return < div dangerouslySetInnerHTML = { { __html : svg } } />
10+ return (
11+ < svg viewBox = { "0 0 " + svg . size + " " + svg . size } shapeRendering = "crispEdges" >
12+ < path d = { svg . path } />
13+ </ svg >
14+ )
1215 } ,
1316 lightning : ( { paymentRequest } ) => {
1417 paymentRequest = paymentRequest . replace ( 'lightning://' , 'lightning:' )
15- const svg = qrImage . imageSync ( paymentRequest , { type : 'svg' } )
18+ const svg = qrImage . svgObject ( paymentRequest , { type : 'svg' } )
1619
17- // eslint-disable-next-line react/no-danger
18- return < div dangerouslySetInnerHTML = { { __html : svg } } />
20+ return (
21+ < svg viewBox = { "0 0 " + svg . size + " " + svg . size } shapeRendering = "crispEdges" >
22+ < path d = { svg . path } />
23+ </ svg >
24+ )
1925 }
2026}
2127
You can’t perform that action at this time.
0 commit comments