improve notification popup interactivity: read all, layout, position
[oweals/peertube.git] / client / src / app / +my-account / my-account-notifications / my-account-notifications.component.ts
1 import { Component, ViewChild } from '@angular/core'
2 import { UserNotificationsComponent } from '@app/shared'
3
4 @Component({
5   templateUrl: './my-account-notifications.component.html',
6   styleUrls: [ './my-account-notifications.component.scss' ]
7 })
8 export class MyAccountNotificationsComponent {
9   @ViewChild('userNotification', { static: true }) userNotification: UserNotificationsComponent
10
11   markAllAsRead () {
12     this.userNotification.markAllAsRead()
13   }
14
15   getUnreadNotifications () {
16     return this.userNotification.notifications.filter(n => n.read === false).length
17   }
18 }