feat(qr-modal): implement QR modal component and integrate with tickets page

This commit is contained in:
2026-07-21 14:55:46 -03:00
parent 472dead0ff
commit 3cefaf85d9
10 changed files with 274 additions and 110 deletions

View File

@@ -0,0 +1,16 @@
<article class="qr-modal">
<header class="qr-modal__header">
<p class="qr-modal__id">ID: {{ data.id }}</p>
@if (data.date) {
<time class="qr-modal__date">{{ data.date }}</time>
}
</header>
<qrcode
class="qr-modal__code"
[qrdata]="data.ticket"
[width]="320"
errorCorrectionLevel="M"
[ariaLabel]="'Código QR del ticket ' + data.id"
/>
</article>

View File

@@ -0,0 +1,44 @@
.qr-modal {
display: grid;
justify-items: center;
gap: 0.65rem;
width: 100%;
text-align: center;
}
.qr-modal__header {
display: grid;
justify-items: center;
gap: 0.25rem;
}
.qr-modal__id {
margin: 0;
}
.qr-modal__id {
color: #4f4f4f;
font-size: 0.68rem;
line-height: 1.2;
}
.qr-modal__date {
margin-top: 0.35rem;
color: #8a8a8a;
font-size: 0.62rem;
line-height: 1.2;
}
.qr-modal__code {
display: block;
width: 100%;
max-width: 11rem;
overflow: hidden;
background: #ffffff;
}
:host ::ng-deep .qr-modal__code canvas {
display: block;
width: 100% !important;
height: auto !important;
}

View File

@@ -0,0 +1,15 @@
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { MODAL_DATA, QrModalData } from '../../../core/services/modal.service';
import { QRCodeComponent } from '../qrcode/qrcode.component';
@Component({
selector: 'app-qr-modal',
imports: [QRCodeComponent],
templateUrl: './qr-modal.component.html',
styleUrl: './qr-modal.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class QrModalComponent {
protected readonly data = inject<QrModalData>(MODAL_DATA);
}