Commit 0ea4784f authored by Roopashree L's avatar Roopashree L
Browse files

removed profile dropdown if user is not logged in

Showing with 14 additions and 1 deletion
+14 -1
......@@ -3,7 +3,7 @@
<div class="flex flex-column">
<img style="width: 17rem;" src="../../assets/images/sunbird_logo.png" alt="UPSMF logo">
</div>
<div class="flex flex-column">
<div class="flex flex-column" *ngIf="showProfileNavBar">
<button class="action-btn" [matMenuTriggerFor]="menu">GJ</button>
<mat-menu #menu="matMenu">
<button mat-menu-item claas="profile-cls" (click)="navigateToProfilePage()">
......
......@@ -8,10 +8,23 @@ import { AuthService } from 'src/app/core';
styleUrls: ['./header.component.css']
})
export class HeaderComponent {
private readonly TOKEN_KEY = 'access_token';
showProfileNavBar = false;
constructor(private router: Router, private authService: AuthService){
}
ngOnInit() {
const token = this.getToken();
if(token) {
this.showProfileNavBar = true;
}
}
getToken(): string | null {
return localStorage.getItem(this.TOKEN_KEY);
}
navigateToProfilePage(){
this.router.navigate(['/user-profile']);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment