avatar in nav dropdown
This commit is contained in:
parent
b8921713eb
commit
1228010488
|
@ -22,10 +22,13 @@
|
||||||
<i class="fa fa-user fa-lg"></i>
|
<i class="fa fa-user fa-lg"></i>
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="nav-profile">
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="nav-profile">
|
||||||
<span class="dropdown-item-text">
|
<div class="dropdown-item-text d-flex align-items-center" *ngIf="name" appStopProp>
|
||||||
|
<app-avatar [data]="name" width="25" height="25" fontSize="14" [circle]="true"></app-avatar>
|
||||||
|
<div class="ml-2">
|
||||||
{{'loggedInAs' | i18n}}
|
{{'loggedInAs' | i18n}}
|
||||||
<small class="text-muted">{{email}}</small>
|
<small class="text-muted">{{name}}</small>
|
||||||
</span>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" href="https://help.bitwarden.com" target="_blank" rel="noopener">
|
<a class="dropdown-item" href="https://help.bitwarden.com" target="_blank" rel="noopener">
|
||||||
<i class="fa fa-fw fa-question-circle"></i>
|
<i class="fa fa-fw fa-question-circle"></i>
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
|
|
||||||
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||||
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||||
import { UserService } from 'jslib/abstractions/user.service';
|
import { TokenService } from 'jslib/abstractions/token.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navbar',
|
selector: 'app-navbar',
|
||||||
|
@ -13,15 +13,18 @@ import { UserService } from 'jslib/abstractions/user.service';
|
||||||
})
|
})
|
||||||
export class NavbarComponent implements OnInit {
|
export class NavbarComponent implements OnInit {
|
||||||
selfHosted = false;
|
selfHosted = false;
|
||||||
email: string;
|
name: string;
|
||||||
|
|
||||||
constructor(private messagingService: MessagingService, private platformUtilsService: PlatformUtilsService,
|
constructor(private messagingService: MessagingService, private platformUtilsService: PlatformUtilsService,
|
||||||
private userService: UserService) {
|
private tokenService: TokenService) {
|
||||||
this.selfHosted = this.platformUtilsService.isSelfHost();
|
this.selfHosted = this.platformUtilsService.isSelfHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.email = await this.userService.getEmail();
|
this.name = await this.tokenService.getName();
|
||||||
|
if (this.name == null || this.name.trim() === '') {
|
||||||
|
this.name = await this.tokenService.getEmail();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lock() {
|
lock() {
|
||||||
|
|
Loading…
Reference in New Issue