Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing qr-code scanner layout #305

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src-admin/src/components/QrCodeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,22 @@ export default class QrCodeDialog extends Component<QrCodeDialogProps, QrCodeDia
id="video-container"
style={{ width: 250, height: 250 }}
>
<style>
{`
.qrscan {
svg {
height: 100%;
width: 100%;
}
}
`}
</style>
<Scanner
formats={['qr_code', 'rm_qr_code', 'micro_qr_code']}
classNames={{
container: 'qrscan',
video: 'aspect-square w-full h-full object-cover',
}}
onScan={result => this.setState({ qrCode: result[0].rawValue, qrError: '' })}
onError={(error: unknown): void => {
if ((error as Error)?.message.includes('secure context')) {
Expand Down
Loading