From 51f65caf1eb1c7d825e953e61945755a6fcb4df7 Mon Sep 17 00:00:00 2001 From: Davide Negretti Date: Thu, 23 Nov 2023 10:36:53 +0100 Subject: [PATCH] [DURACOM-195] Base components --- .../header-navbar-wrapper.component.ts | 8 ++- src/app/header/header.component.html | 2 +- src/app/header/header.component.scss | 48 ++++++------- src/app/header/header.component.ts | 8 ++- src/app/navbar/navbar.component.html | 4 +- src/app/navbar/navbar.component.scss | 67 ++++++++++--------- src/app/navbar/navbar.component.ts | 11 +-- 7 files changed, 81 insertions(+), 67 deletions(-) diff --git a/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts b/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts index a610b2cb026..9786f0ed1d0 100644 --- a/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts +++ b/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts @@ -5,6 +5,7 @@ import { hasValue } from '../shared/empty.util'; import { Observable, Subscription } from 'rxjs'; import { MenuService } from '../shared/menu/menu.service'; import { MenuID } from '../shared/menu/menu-id.model'; +import { HostWindowService, WidthCategory } from '../shared/host-window.service'; /** * This component represents a wrapper for the horizontal navbar and the header @@ -18,15 +19,20 @@ export class HeaderNavbarWrapperComponent implements OnInit, OnDestroy { @HostBinding('class.open') isOpen = false; private sub: Subscription; public isNavBarCollapsed: Observable; + public isMobile$: Observable; + menuID = MenuID.PUBLIC; + maxMobileWidth = WidthCategory.SM; constructor( private store: Store, - private menuService: MenuService + private menuService: MenuService, + protected windowService: HostWindowService, ) { } ngOnInit(): void { + this.isMobile$ = this.windowService.isUpTo(this.maxMobileWidth); this.isNavBarCollapsed = this.menuService.isMenuCollapsed(this.menuID); this.sub = this.isNavBarCollapsed.subscribe((isCollapsed) => this.isOpen = !isCollapsed); } diff --git a/src/app/header/header.component.html b/src/app/header/header.component.html index 32b42dc8a7c..8ff76242cda 100644 --- a/src/app/header/header.component.html +++ b/src/app/header/header.component.html @@ -11,7 +11,7 @@ -
+