diff --git a/src/UI/Components/QRCode.js b/src/UI/Components/QRCode.js new file mode 100644 index 00000000..41f19233 --- /dev/null +++ b/src/UI/Components/QRCode.js @@ -0,0 +1,47 @@ +import { Component } from "../../util/Component.js"; + +export default class QRCodeView extends Component { + static PROPERTIES = { + value: { + description: 'The text to encode in the QR code', + } + } + + static CSS = /*css*/` + .qr-code { + width: 100%; + display: flex; + justify-content: center; + flex-direction: column; + align-items: center; + } + ` + + create_template ({ template }) { + // TODO: The way we handle loading assets doesn't work well + // with web components, so for now it goes in the template. + $(template).html(` +
${ + html_encode(options.text_alternative) + }
`; + h += `