Fermain / thermal-rising-pwa

PWA for Thermal Rising
0 stars 0 forks source link

✨ feat: add custom qr code scanner #18

Closed kyrregjerstad closed 1 year ago

kyrregjerstad commented 1 year ago

Overview

This PR introduces the CustomScanner component to the codebase. The purpose of this component is to provide QR code scanning functionality using the html5-qrcode library.

The component accepts all the props defined in the library and and extra debug option for enabling a debug overlay.

Changes

How to Use

You can test the component by importing it into an existing page and providing it with the necessary props. For instance:

<QrCodeScanner
  fps={10}
  onQrCodeScanSuccess={(data) => {
    // callback function goes here
    console.log(data);
  }}
  onQrCodeScanError={(error) => {
    console.log(error);
  }}
/>

Todo

Any other feedback is appreciated!