ISH-Gruppe / screenario

Screenario - The screen for every scenario
https://screenar.io
GNU General Public License v3.0
2 stars 2 forks source link

Responsify qrcode-generator #28

Closed s-gbz closed 2 years ago

s-gbz commented 2 years ago

Problem: All the react libs available only offer a single size prop in pixels. No percentages allowed.

So, to make the QR code responsive we need to update the size prop as the window changes

function handleWindowSizeChange() {
    const qrcodeSize = document.getElementsByClassName("window window-qrcode-generator")[0].getBoundingClientRect()
}

return (
    <QRCode value={qrcodeValue} size={availableSpace} />
)

Problem: How can we be notified when the window's size changes?