diff options
author | Chocobozzz <me@florianbigard.com> | 2022-06-10 15:14:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-10 15:14:49 +0200 |
commit | 073367bb651776648792046895b73c2f37e9f532 (patch) | |
tree | ea88ab8904dc6765e65c4519b8c9e51ae7e14e02 /client/src/app/app.component.ts | |
parent | a14c176472614874586cbc64cf25e82bbdc52868 (diff) | |
download | PeerTube-073367bb651776648792046895b73c2f37e9f532.tar.gz PeerTube-073367bb651776648792046895b73c2f37e9f532.tar.zst PeerTube-073367bb651776648792046895b73c2f37e9f532.zip |
Prefer using our icons for notifications
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r-- | client/src/app/app.component.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index a60138af9..8fdab0c40 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts | |||
@@ -31,6 +31,7 @@ import { BroadcastMessageLevel, HTMLServerConfig, UserRole } from '@shared/model | |||
31 | import { MenuService } from './core/menu/menu.service' | 31 | import { MenuService } from './core/menu/menu.service' |
32 | import { POP_STATE_MODAL_DISMISS } from './helpers' | 32 | import { POP_STATE_MODAL_DISMISS } from './helpers' |
33 | import { InstanceService } from './shared/shared-instance' | 33 | import { InstanceService } from './shared/shared-instance' |
34 | import { GlobalIconName } from './shared/shared-icons' | ||
34 | 35 | ||
35 | @Component({ | 36 | @Component({ |
36 | selector: 'my-app', | 37 | selector: 'my-app', |
@@ -150,6 +151,17 @@ export class AppComponent implements OnInit, AfterViewInit { | |||
150 | this.screenService.isBroadcastMessageDisplayed = false | 151 | this.screenService.isBroadcastMessageDisplayed = false |
151 | } | 152 | } |
152 | 153 | ||
154 | getNotificationIcon (message: { severity: 'success' | 'error' | 'info' }): GlobalIconName { | ||
155 | switch (message.severity) { | ||
156 | case 'error': | ||
157 | return 'cross' | ||
158 | case 'success': | ||
159 | return 'tick' | ||
160 | case 'info': | ||
161 | return 'help' | ||
162 | } | ||
163 | } | ||
164 | |||
153 | private initRouteEvents () { | 165 | private initRouteEvents () { |
154 | const eventsObs = this.router.events | 166 | const eventsObs = this.router.events |
155 | 167 | ||