aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2019-12-19 14:51:35 +0100
committerRigel Kent <sendmemail@rigelk.eu>2019-12-19 14:53:01 +0100
commit10475dea7d2343c13014134b33bc75f7c59ac992 (patch)
tree2dd02dd49997e83b14d732b4fdcdd3def06c5d4d /client/src/app/+my-account
parentdddc8b1fe0c875f41c88f395b0d55cfea69add2c (diff)
downloadPeerTube-10475dea7d2343c13014134b33bc75f7c59ac992.tar.gz
PeerTube-10475dea7d2343c13014134b33bc75f7c59ac992.tar.zst
PeerTube-10475dea7d2343c13014134b33bc75f7c59ac992.zip
improve notification popup interactivity: read all, layout, position
fixes #1730
Diffstat (limited to 'client/src/app/+my-account')
-rw-r--r--client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html9
-rw-r--r--client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts4
2 files changed, 10 insertions, 3 deletions
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html
index d518b22ec..daf721f03 100644
--- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html
+++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html
@@ -4,9 +4,12 @@
4 Notification preferences 4 Notification preferences
5 </a> 5 </a>
6 6
7 <button (click)="markAllAsRead()" i18n> 7 <button class="btn" [disabled]="!getUnreadNotifications()" (click)="markAllAsRead()">
8 <my-global-icon iconName="circle-tick"></my-global-icon> 8 <my-global-icon *ngIf="getUnreadNotifications()" iconName="inbox-full"></my-global-icon>
9 Mark all as read 9 <span i18n *ngIf="getUnreadNotifications()">Mark all as read</span>
10
11 <my-global-icon *ngIf="!getUnreadNotifications()" iconName="circle-tick"></my-global-icon>
12 <span i18n *ngIf="!getUnreadNotifications()">All read</span>
10 </button> 13 </button>
11</div> 14</div>
12 15
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts
index 9eca13d0f..156e7713d 100644
--- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts
+++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts
@@ -11,4 +11,8 @@ export class MyAccountNotificationsComponent {
11 markAllAsRead () { 11 markAllAsRead () {
12 this.userNotification.markAllAsRead() 12 this.userNotification.markAllAsRead()
13 } 13 }
14
15 getUnreadNotifications () {
16 return this.userNotification.notifications.filter(n => n.read === false).length
17 }
14} 18}