Skip to content

Commit

Permalink
test of printability of modified QR-code format
Browse files Browse the repository at this point in the history
  • Loading branch information
Petter Andersson committed Oct 2, 2023
1 parent 2ff7c3a commit 7370f5e
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/adverts/components/details/AdvertQrCodeView.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
import { Typography } from '@mui/material'
import { Advert } from 'adverts'
import { DeepLinkContext } from 'deep-links/DeepLinkContext'
import { FC, useContext } from 'react'
import QRCode from 'react-qr-code'

export const AdvertQrCodeView: FC<{ advert: Advert }> = ({ advert }) => {
const {getAdvertLinkForQrCode} = useContext(DeepLinkContext)
const { getAdvertLinkForQrCode } = useContext(DeepLinkContext)
const link = getAdvertLinkForQrCode(advert)
console.log(link)
return (
<div
style={{
display: 'grid',
placeItems: 'center',
width: '100vw',
height: '100vh',
width: '100%',
height: 'auto',
}}
>
<div>
<QRCode
value={link}
style={{ maxHeight: '10cm', maxWidth: '10cm' }}
/>
<div style={{ textAlign: 'center' }}>
<Typography variant="h3">{advert.title}</Typography>
</div>
<QRCode size={55} value={link} style={{}} />
</div>
</div>
)
}
}

0 comments on commit 7370f5e

Please sign in to comment.