dev #14537 Добавить кнопку подписки на уведомления CL
This commit is contained in:
parent
0ca219c7fa
commit
d66f72dc2e
@ -2,5 +2,15 @@
|
|||||||
<mat-icon style="cursor: pointer;" aria-hidden="false" aria-label="Назад" fontIcon="arrow_back_ios" class="back-arrow" (click)="back()"></mat-icon>
|
<mat-icon style="cursor: pointer;" aria-hidden="false" aria-label="Назад" fontIcon="arrow_back_ios" class="back-arrow" (click)="back()"></mat-icon>
|
||||||
<h1 class="title">{{title}}</h1>
|
<h1 class="title">{{title}}</h1>
|
||||||
<!-- <div class="plug"></div> -->
|
<!-- <div class="plug"></div> -->
|
||||||
<button mat-stroked-button appDownloadApp>Установить</button>
|
<div class="wrapper">
|
||||||
|
<button
|
||||||
|
mat-button
|
||||||
|
*ngIf="!messagingService.checkRequestPermission()"
|
||||||
|
(click)="messagingService.requestPermission()"
|
||||||
|
class="notification"
|
||||||
|
>
|
||||||
|
<img src="./assets/notification.svg" alt="notification" />
|
||||||
|
</button>
|
||||||
|
<button mat-stroked-button appDownloadApp>Установить</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,12 @@
|
|||||||
:host {
|
:host {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
.notification {
|
||||||
|
img {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
@ -31,4 +38,9 @@
|
|||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
.wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
|
import { MessagingService } from 'src/app/services/messaging.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navbar[title]',
|
selector: 'app-navbar[title]',
|
||||||
@ -9,7 +10,7 @@ export class NavbarComponent implements OnInit {
|
|||||||
@Input() title: string = 'Название не задано'
|
@Input() title: string = 'Название не задано'
|
||||||
@Output() backEvent = new EventEmitter<null>();
|
@Output() backEvent = new EventEmitter<null>();
|
||||||
|
|
||||||
constructor() { }
|
constructor(public messagingService: MessagingService) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
@ -18,4 +19,5 @@ export class NavbarComponent implements OnInit {
|
|||||||
this.backEvent.emit(null)
|
this.backEvent.emit(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,7 +76,6 @@ export class GuestCardComponent implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
//FIREBASE HERE
|
//FIREBASE HERE
|
||||||
this.messagingService.requestPermission();
|
this.messagingService.requestPermission();
|
||||||
this.messagingService.receiveMessage();
|
|
||||||
// this.message = this.messagingService.currentMessage;
|
// this.message = this.messagingService.currentMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,6 +78,7 @@ export class MessagingService {
|
|||||||
this.angularFireMessaging.requestToken.subscribe({
|
this.angularFireMessaging.requestToken.subscribe({
|
||||||
next: (token) => {
|
next: (token) => {
|
||||||
this.updateToken(token);
|
this.updateToken(token);
|
||||||
|
this.receiveMessage();
|
||||||
},
|
},
|
||||||
error: (e) => console.error(e),
|
error: (e) => console.error(e),
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user