feat(qr-modal): implement QR modal component and integrate with tickets page
This commit is contained in:
16
src/app/shared/components/qr-modal/qr-modal.component.html
Normal file
16
src/app/shared/components/qr-modal/qr-modal.component.html
Normal 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>
|
||||
44
src/app/shared/components/qr-modal/qr-modal.component.scss
Normal file
44
src/app/shared/components/qr-modal/qr-modal.component.scss
Normal 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;
|
||||
}
|
||||
15
src/app/shared/components/qr-modal/qr-modal.component.ts
Normal file
15
src/app/shared/components/qr-modal/qr-modal.component.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user