diff options
author | Nullptrderef <nullptrderef@proton.me> | 2024-08-11 19:33:19 +0200 |
---|---|---|
committer | Nullptrderef <nullptrderef@proton.me> | 2024-08-11 19:33:19 +0200 |
commit | e0e4fb390f6dbf5267169d7a993c7c21f200dea2 (patch) | |
tree | 26cf5999101e2519d2a99d21c565ce17da15e2d2 /packages | |
parent | 3c286023d3ed9fac995b4a5149a31f10a15a4728 (diff) |
fix: use QR images
Diffstat (limited to 'packages')
-rw-r--r-- | packages/merchant-backoffice-ui/src/components/exception/QR.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/merchant-backoffice-ui/src/components/exception/QR.tsx b/packages/merchant-backoffice-ui/src/components/exception/QR.tsx index 246ce0229..029a87879 100644 --- 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}`)} />`; } }); |