Add links in desktop menu and dropdown menu in mobile (wip)

This commit is contained in:
2022-09-08 17:04:48 +02:00
parent d0c485c0e9
commit 0889c101aa
4 changed files with 79 additions and 11964 deletions
+15 -1
View File
@@ -1,6 +1,7 @@
import {Component, OnInit} from '@angular/core';
import {User} from '../../models/user';
import {StorageService} from '../../services/storage.service';
import {Router} from "@angular/router";
@Component({
selector: 'app-header',
@@ -12,7 +13,7 @@ export class HeaderComponent implements OnInit {
showProfilePopOver: boolean = false;
user?: User;
constructor() {
constructor(private router:Router) {
this.user = StorageService.getUserInfo();
}
@@ -30,4 +31,17 @@ export class HeaderComponent implements OnInit {
getUserName(): string {
return this.user ? this.user.firstName : 'Logged out';
}
navigate(path:String) : void {
this.router.navigate([path]);
}
openMobileDropdown() : void {
const dropdownContentStyle = document.getElementById("menu-mobile-dropdown-content")!.style;
if(dropdownContentStyle.display == "block")
dropdownContentStyle.display = "none";
else {
dropdownContentStyle.display = "block";
}
}
}