Added QR component
This commit is contained in:
parent
30b159ce7c
commit
ca1024c343
2 changed files with 20 additions and 0 deletions
19
src/components/QR/QR.tsx
Normal file
19
src/components/QR/QR.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// @ts-ignore
|
||||
import { useQRCode } from '@solidjs-use/integrations/useQRCode'
|
||||
|
||||
interface Props {
|
||||
value: string
|
||||
width?: number
|
||||
}
|
||||
|
||||
export default (props: Props) => {
|
||||
const qrcode = useQRCode(props.value)
|
||||
|
||||
return (
|
||||
<>
|
||||
<section>
|
||||
<img src={qrcode()} alt="QR Code" style={`width: ${props.width || 'auto' }rem`}/>
|
||||
</section>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@ export { default as Modal } from './Modal/Modal'
|
|||
export { default as Table } from './Table/Table'
|
||||
export { default as Combobox } from './Combobox/Combobox'
|
||||
export { default as File } from './File/File'
|
||||
export { default as QR } from './QR/QR'
|
||||
|
||||
// export { default as OptimizeBackground } from './Optimizers/OptimizeBackground'
|
||||
// export { default as OptimizeImage } from './Optimizers/OptimizeImage'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue