feat: receive screen qr code

This commit is contained in:
eneller
2026-03-05 22:19:58 +01:00
parent 9444145bf5
commit 427064a24c
4 changed files with 46 additions and 20 deletions

View File

@@ -1,28 +1,28 @@
import { Component } from '@angular/core';
import { Component, inject, TemplateRef } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { QrCodeComponent } from 'ng-qrcode';
@Component({
selector: 'app-screen-receive',
imports: [FormsModule],
imports: [FormsModule, QrCodeComponent],
templateUrl: './screen-receive.html',
styleUrl: './screen-receive.less',
})
export class ScreenReceive {
me = 'DemoUser';
private modalService = inject(NgbModal);
user = 'DemoUser';
amount: number = 0;
shareableLink: string = 'https://yourapp.com/receive?amount=0';
get shareableLink(): string {
const currentDomain = window.location.origin;
return `${currentDomain}/send/${this.user}?amount=${this.amount}`;
}
copyLink() {
navigator.clipboard.writeText(this.shareableLink);
alert('Link copied to clipboard!');
}
shareViaEmail() {
const email = `mailto:?subject=Request Money&body=Please send me $${this.amount} via ${this.shareableLink}`;
window.location.href = email;
}
shareViaLink() {
this.copyLink();
open(content: TemplateRef<any>) {
this.modalService.open(content)
}
}