mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
[DURACOM-195] Base components
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { Component, Injector } from '@angular/core';
|
||||
import { Component, Injector, OnInit } from '@angular/core';
|
||||
import { slideMobileNav } from '../shared/animations/slide';
|
||||
import { MenuComponent } from '../shared/menu/menu.component';
|
||||
import { MenuService } from '../shared/menu/menu.service';
|
||||
import { HostWindowService } from '../shared/host-window.service';
|
||||
import { HostWindowService, WidthCategory } from '../shared/host-window.service';
|
||||
import { BrowseService } from '../core/browse/browse.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service';
|
||||
@@ -22,12 +22,13 @@ import { isAuthenticated } from '../core/auth/selectors';
|
||||
templateUrl: './navbar.component.html',
|
||||
animations: [slideMobileNav]
|
||||
})
|
||||
export class NavbarComponent extends MenuComponent {
|
||||
export class NavbarComponent extends MenuComponent implements OnInit {
|
||||
/**
|
||||
* The menu ID of the Navbar is PUBLIC
|
||||
* @type {MenuID.PUBLIC}
|
||||
*/
|
||||
menuID = MenuID.PUBLIC;
|
||||
maxMobileWidth = WidthCategory.SM;
|
||||
|
||||
/**
|
||||
* Whether user is authenticated.
|
||||
@@ -35,7 +36,7 @@ export class NavbarComponent extends MenuComponent {
|
||||
*/
|
||||
public isAuthenticated$: Observable<boolean>;
|
||||
|
||||
public isXsOrSm$: Observable<boolean>;
|
||||
public isMobile$: Observable<boolean>;
|
||||
|
||||
constructor(protected menuService: MenuService,
|
||||
protected injector: Injector,
|
||||
@@ -51,7 +52,7 @@ export class NavbarComponent extends MenuComponent {
|
||||
|
||||
ngOnInit(): void {
|
||||
super.ngOnInit();
|
||||
this.isXsOrSm$ = this.windowService.isXsOrSm();
|
||||
this.isMobile$ = this.windowService.isUpTo(this.maxMobileWidth);
|
||||
this.isAuthenticated$ = this.store.pipe(select(isAuthenticated));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user