Compare commits
No commits in common. "146514d38621cb79e64d4a30cdd2b44d81663eec" and "45272762546eb7848108f4cbda7378be24486fc2" have entirely different histories.
146514d386
...
4527276254
@ -1,11 +1,3 @@
|
||||
<div *ngIf="user">
|
||||
<div (click)="toggle($event)" class="rounded-circle menu-button" [title]="user.name">
|
||||
<span>{{getLetter()}}</span>
|
||||
<div *ngIf="showMenu" class="card">
|
||||
<div class="card-body">
|
||||
<div class="username">{{user.name}}</div>
|
||||
<div><a href="#" (click)="logout($event)" i18n>logout</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="rounded-circle menu-button" [title]="user.name">{{getLetter()}}</span>
|
||||
</div>
|
||||
|
@ -1,34 +1,10 @@
|
||||
.menu-button {
|
||||
background-color: purple;
|
||||
background-color: purple;
|
||||
color:white;
|
||||
display: inline-block;
|
||||
width: 2.5em;
|
||||
height: 2.5em;
|
||||
line-height: 2.5em;
|
||||
text-align: center;
|
||||
font-size: 1rem;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
div.menu-button > span {
|
||||
color:white;
|
||||
}
|
||||
|
||||
.card {
|
||||
position: absolute;
|
||||
top: 3rem;
|
||||
right:0;
|
||||
padding:0.5rem;
|
||||
min-width: 10rem;
|
||||
}
|
||||
|
||||
.username {
|
||||
white-space: nowrap;
|
||||
font-weight: 500;
|
||||
font-size: 1.2rem;
|
||||
line-height: 1.2rem;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
text-align: left;
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
import { Component, OnInit,Input } from '@angular/core';
|
||||
import { OAuthService} from 'angular-oauth2-oidc'
|
||||
import { IUser } from '../../models/user';
|
||||
|
||||
@Component({
|
||||
@ -10,9 +9,8 @@ import { IUser } from '../../models/user';
|
||||
export class UserMenuComponent implements OnInit {
|
||||
|
||||
@Input() user:IUser;
|
||||
public showMenu:boolean = false
|
||||
|
||||
constructor(private oauthService:OAuthService) { }
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
@ -20,21 +18,4 @@ export class UserMenuComponent implements OnInit {
|
||||
getLetter():string {
|
||||
return this.user.name ? this.user.name.substr(0,1).toUpperCase():"";
|
||||
}
|
||||
|
||||
logout(event:MouseEvent) {
|
||||
event.preventDefault();
|
||||
this.oauthService.logOut();
|
||||
}
|
||||
|
||||
hide(event:MouseEvent) {
|
||||
this.showMenu = false;
|
||||
}
|
||||
|
||||
show(event:MouseEvent) {
|
||||
this.showMenu=true;
|
||||
}
|
||||
|
||||
toggle(event:MouseEvent) {
|
||||
this.showMenu=!this.showMenu;
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ export interface State {
|
||||
fullScreen: boolean,
|
||||
routeLoading:boolean,
|
||||
menuVisible: boolean,
|
||||
userPackages: IPackages,
|
||||
userPackages: IPackages
|
||||
}
|
||||
|
||||
export const initialState: State = {
|
||||
|
Loading…
Reference in New Issue
Block a user