diff options
Diffstat (limited to 'webapp/src/app/@theme/components/header/header.component.ts')
-rw-r--r-- | webapp/src/app/@theme/components/header/header.component.ts | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/webapp/src/app/@theme/components/header/header.component.ts b/webapp/src/app/@theme/components/header/header.component.ts new file mode 100644 index 0000000..e2a84cb --- /dev/null +++ b/webapp/src/app/@theme/components/header/header.component.ts @@ -0,0 +1,51 @@ +import { Component, Input, OnInit } from '@angular/core'; + +import { NbMenuService, NbSidebarService } from '@nebular/theme'; +// XDS_MODS +import { UserService } from '../../../@core-xds/services/users.service'; +import { AnalyticsService } from '../../../@core/utils/analytics.service'; + +@Component({ + selector: 'ngx-header', + styleUrls: ['./header.component.scss'], + templateUrl: './header.component.html', +}) +export class HeaderComponent implements OnInit { + + + @Input() position = 'normal'; + + user: any; + + userMenu = [{ title: 'Profile' }, { title: 'Log out' }]; + + constructor(private sidebarService: NbSidebarService, + private menuService: NbMenuService, + private userService: UserService, + private analyticsService: AnalyticsService) { + } + + ngOnInit() { + // XDS_MODS + this.userService.getUsers() + .subscribe((users: any) => this.user = users.anonymous); + } + + toggleSidebar(): boolean { + this.sidebarService.toggle(true, 'menu-sidebar'); + return false; + } + + toggleSettings(): boolean { + this.sidebarService.toggle(false, 'settings-sidebar'); + return false; + } + + goToHome() { + this.menuService.navigateHome(); + } + + startSearch() { + this.analyticsService.trackEvent('startSearch'); + } +} |