Newer
Older
Website / src / app / toolbar / toolbar.component.html
<mat-toolbar>
    <mat-toolbar-row>
        <a class="accent" routerLink="/">Lukas Eisenhauer</a>
        <a *ngIf="account.username.length == 0; else userPanel" class="accent" routerLink="login">Log In</a>
    </mat-toolbar-row>
</mat-toolbar>

<ng-template #userPanel>
    <button mat-stroked-button color="accent" [matMenuTriggerFor]="userActions">
        <h1>{{account.username}}</h1>
    </button>
    <mat-menu #userActions="matMenu">
        <button routerLink="/admin" mat-menu-item>Go to the admin panel</button>
        <button routerLink="/" (click)="account.logout()" mat-menu-item>Log Out</button>
    </mat-menu>
</ng-template>