]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Prefer using our icons for notifications
authorChocobozzz <me@florianbigard.com>
Fri, 10 Jun 2022 13:14:49 +0000 (15:14 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 10 Jun 2022 13:14:49 +0000 (15:14 +0200)
client/src/app/app.component.html
client/src/app/app.component.ts
client/src/sass/primeng-custom.scss

index 6969329e8c1273902cda475a5c3fba55d0809ef4..629c04e6b07c7d53c97a82bd5d9a1e99c398023f 100644 (file)
@@ -53,9 +53,7 @@
         <p>{{ message.detail }}</p>
       </div>
 
-      <span *ngIf="message.severity === 'success'" class="glyphicon glyphicon-ok"></span>
-      <span *ngIf="message.severity === 'info'" class="glyphicon glyphicon-info-sign"></span>
-      <span *ngIf="message.severity === 'error'" class="glyphicon glyphicon-remove"></span>
+      <my-global-icon [iconName]="getNotificationIcon(message)"></my-global-icon>
     </div>
   </ng-template>
 </p-toast>
index a60138af9fc22f8d0edb4458376abe54de53f983..8fdab0c409478d62469444eb7ac76e55dccbc952 100644 (file)
@@ -31,6 +31,7 @@ import { BroadcastMessageLevel, HTMLServerConfig, UserRole } from '@shared/model
 import { MenuService } from './core/menu/menu.service'
 import { POP_STATE_MODAL_DISMISS } from './helpers'
 import { InstanceService } from './shared/shared-instance'
+import { GlobalIconName } from './shared/shared-icons'
 
 @Component({
   selector: 'my-app',
@@ -150,6 +151,17 @@ export class AppComponent implements OnInit, AfterViewInit {
     this.screenService.isBroadcastMessageDisplayed = false
   }
 
+  getNotificationIcon (message: { severity: 'success' | 'error' | 'info' }): GlobalIconName {
+    switch (message.severity) {
+      case 'error':
+        return 'cross'
+      case 'success':
+        return 'tick'
+      case 'info':
+        return 'help'
+    }
+  }
+
   private initRouteEvents () {
     const eventsObs = this.router.events
 
index a66e4485b6285518e4ae50191dbf6e14cfbfa91c..ef117ae34ad72763494ba7b7bd4f56e4c3eb4b54 100644 (file)
@@ -927,19 +927,19 @@ p-toast {
     box-shadow: 0 2px 12px 0 rgba(0, 0 , 0, .1);
     overflow: hidden;
 
-    &.p-toast-message-success .glyphicon {
+    &.p-toast-message-success my-global-icon {
       color: #8BC34A !important;
     }
 
-    &.p-toast-message-error .glyphicon {
+    &.p-toast-message-error my-global-icon {
       color: #F44336 !important;
     }
 
-    &.p-toast-message-warn .glyphicon {
+    &.p-toast-message-warn my-global-icon {
       color: #F1680D !important;
     }
 
-    &.p-toast-message-info .glyphicon {
+    &.p-toast-message-info my-global-icon {
       color: #03A9F4 !important;
     }