Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
drawQRCode() {
const { data, size, errorCorrectionLevel } = this.props
const { current } = this.canvas
if (!current) return
qrcode.toCanvas(
current,
data,
{
width: current.width,
margin: 0,
errorCorrectionLevel,
},
() => {
// fix again the CSS because lib changes it –_–
current.style.width = `${size}px`
current.style.height = `${size}px`
},
)
}
export function generateQR() {
const qrOptions = {
width: 600,
margin: 0,
};
const url = micboard.localURL + location.pathname + location.search;
document.getElementById('largelink').href = url;
document.getElementById('largelink').innerHTML = url;
QRCode.toCanvas(document.getElementById('qrcode'), url, qrOptions, (error) => {
if (error) console.error(error)
console.log('success!');
});
document.getElementById('micboard-version').innerHTML = 'Micboard version: ' + VERSION;
}
sharePaper(id) {
let canvas = document.getElementById('qrcode-canvas')
this.shareLink = `${window.location.origin}/questionnaire/#/fill?id=${id}`
QRCode.toCanvas(canvas, this.shareLink, {
width: 250
}, function (error) {
if (error) console.error(error)
})
this.isShowSharePrompt = true
},
drawQRCode = () => {
const el = document.getElementById('qr-code');
qrcode.toCanvas(el, this.props.address, { width: 220 }, (err) => {
if (err) {
console.log(err);
}
});
};
drawQRCode() {
const { data, size, errorCorrectionLevel } = this.props;
qrcode.toCanvas(this._canvas, data, {
width: size,
margin: 0,
errorCorrectionLevel,
color: {
light: "#ffffff"
}
});
}
const makeQR = (cvs, str) => {
QRCode.toCanvas(cvs, str, { version: 5 }, (err) => {
if (err) alert(err)
})
}
export function renderEpcrQr(canvas_element, amount, reference, light_color = null) {
QRCode.toCanvas(canvas_element, epcrData(amount, reference), {
errorCorrectionLevel: 'M',
width: 256,
height: 256,
color: { light: light_color || '#f7fafc' }
});
}
drawQRCode() {
const { data, size, errorCorrectionLevel } = this.props;
qrcode.toCanvas(this._canvas, data, {
width: size,
margin: 0,
errorCorrectionLevel,
color: {
light: "#ffffff"
}
});
}
drawQRCode() {
const { data, size, errorCorrectionLevel } = this.props;
qrcode.toCanvas(this._canvas, data, {
width: size,
margin: 0,
errorCorrectionLevel,
color: {
light: "#ffffff"
}
});
}