File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export class NavbarComponent implements OnInit {
13
13
@Output ( ) toggleChatEvent : EventEmitter < any > = new EventEmitter ( ) ;
14
14
$el : any ;
15
15
config : any ;
16
+ user : any = JSON . parse ( localStorage . getItem ( 'user' ) ) || { } ;
16
17
17
18
constructor (
18
19
el : ElementRef ,
@@ -40,6 +41,10 @@ export class NavbarComponent implements OnInit {
40
41
this . loginService . logoutUser ( ) ;
41
42
}
42
43
44
+ firstUserLetter ( ) {
45
+ return ( this . user . name || this . user . email || 'P' ) [ 0 ] . toUpperCase ( ) ;
46
+ }
47
+
43
48
ngOnInit ( ) : void {
44
49
setTimeout ( ( ) => {
45
50
const $chatNotification = jQuery ( '#chat-notification' ) ;
Original file line number Diff line number Diff line change 52
52
< li class ="nav-item dropdown " dropdown placement ="bottom right " [autoClose] ="false ">
53
53
< a href ="# " dropdownToggle class ="nav-link dropdown-toggle dropdown-toggle-notifications "
54
54
id ="notifications-dropdown-toggle ">
55
- < span class ="avatar thumb-sm float-left mr-2 ">
56
- < img class ="rounded-circle " src ="assets/img/people/a5.jpg " alt ="... " />
57
- </ span >
58
- < span class ="small "> Philip < span class ="fw-semi-bold "> Smith</ span > </ span >
59
- < span class ="ml-1 circle bg-warning text-white fw-bold "> 13</ span >
55
+ < span class ="avatar rounded-circle thumb-sm float-left mr-2 ">
56
+ < img
57
+ *ngIf ="user.avatar || user.email === 'admin@flatlogic.com'; else firstLetter "
58
+ class ="rounded-circle "
59
+ [src] ="user.avatar || 'assets/img/people/a5.jpg' "
60
+ alt ="... "
61
+ />
62
+ < ng-template #firstLetter > {{firstUserLetter}}</ ng-template >
63
+ </ span >
64
+ < span class ="small "> {{user.name || user.email || "Philip smith"}}</ span >
65
+ < span class ="ml-1 circle bg-warning text-white fw-bold "> 13</ span >
60
66
</ a >
61
67
<!-- ready to use notifications dropdown. inspired by smartadmin template.
62
68
consists of three components:
Original file line number Diff line number Diff line change @@ -94,7 +94,15 @@ app, .app {
94
94
}
95
95
96
96
.avatar {
97
- width : 30px ;
97
+ display : flex ;
98
+ align-items : center ;
99
+ justify-content : center ;
100
+ overflow : hidden ;
101
+ height : 40px ;
102
+ width : 40px ;
103
+ background : #ffc247 ;
104
+ font-weight : 600 ;
105
+ font-size : 18px ;
98
106
}
99
107
100
108
.navbar-nav {
You can’t perform that action at this time.
0 commit comments