1+ import { BreakpointObserver } from '@angular/cdk/layout' ;
12import {
23 AsyncPipe ,
34 NgComponentOutlet ,
@@ -17,13 +18,16 @@ import { faBars } from '@fortawesome/free-solid-svg-icons';
1718import {
1819 Observable ,
1920 map ,
21+ startWith ,
2022} from 'rxjs' ;
2123
2224import { DaffLogoModule } from '@daffodil/branding' ;
25+ import { DaffBreakpoints } from '@daffodil/design' ;
2326import { DaffIconButtonComponent } from '@daffodil/design/button' ;
2427import { DaffRouterDataService } from '@daffodil/router' ;
2528import { DaffSfThemeToggleComponent } from '@daffodil/storefront/theme-toggle' ;
2629
30+ import { DaffioDocsSearchButtonComponent } from '../../../docs//search/components/search-button/search-button.component' ;
2731import { DaffioHeaderComponent } from '../../header/components/header/header.component' ;
2832import { DaffioHeaderItemDirective } from '../../header/components/header-item/header-item.directive' ;
2933import { DaffioRoute } from '../../router/route.type' ;
@@ -32,6 +36,7 @@ import { isComponent } from '../../utils/is-component';
3236import { DAFFIO_NAV_SIDEBAR_ID } from '../header/sidebar-id' ;
3337import { DaffioNavLink } from '../link/type' ;
3438
39+
3540@Component ( {
3641 selector : 'daffio-docs-nav-container' ,
3742 templateUrl : './docs.component.html' ,
@@ -47,23 +52,30 @@ import { DaffioNavLink } from '../link/type';
4752 NgComponentOutlet ,
4853 RouterLinkActive ,
4954 DaffSfThemeToggleComponent ,
55+ DaffioDocsSearchButtonComponent ,
5056 ] ,
5157} )
5258export class DaffioDocsNavContainer implements OnInit {
5359 readonly isComponent = isComponent ;
5460 faBars = faBars ;
5561
5662 links$ : Observable < Array < DaffioNavLink | Type < unknown > > > ;
63+ isBigTablet$ : Observable < boolean > ;
5764
5865 constructor (
5966 private routerData : DaffRouterDataService < DaffioRoute [ 'data' ] > ,
6067 private sidebarService : DaffioSidebarService ,
68+ private breakpointObserver : BreakpointObserver ,
6169 ) { }
6270
6371 ngOnInit ( ) : void {
6472 this . links$ = this . routerData . data$ . pipe (
6573 map ( ( data ) => data . daffioNavLinks ) ,
6674 ) ;
75+ this . isBigTablet$ = this . breakpointObserver . observe ( DaffBreakpoints . BIG_TABLET ) . pipe (
76+ startWith ( { matches : true } ) ,
77+ map ( ( result ) => result ?. matches ) ,
78+ ) ;
6779 }
6880
6981 openSidebar ( ) {
0 commit comments