commit e0e4fb390f6dbf5267169d7a993c7c21f200dea2 parent 3c286023d3ed9fac995b4a5149a31f10a15a4728 Author: Nullptrderef <nullptrderef@proton.me> Date: Sun, 11 Aug 2024 19:33:19 +0200 fix: use QR images Diffstat:
| M | packages/merchant-backoffice-ui/src/components/exception/QR.tsx | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/packages/merchant-backoffice-ui/src/components/exception/QR.tsx b/packages/merchant-backoffice-ui/src/components/exception/QR.tsx @@ -25,9 +25,13 @@ export function QR({ text }: { text: string }): VNode { qr.addData(text); qr.make(); if (divRef.current) { - divRef.current.innerHTML = qr.createSvgTag({ + const image = qr.createSvgTag({ scalable: true, }); + const imageURL = `data:image/svg+xml,${encodeURIComponent(image)}`; + divRef.current.innerHTML = `<img src=${JSON.stringify( + imageURL, + )} alt=${JSON.stringify(`QR Code containing the data ${text}`)} />`; } });