import {Component} from '@angular/core';
import {Router} from "@angular/router";
import { MenuService} from '@app/_services/menu.service';
import { PagesService } from '@app/_services/pages.service';


@Component({
  selector: 'header',
  templateUrl: 'header.component.html',
  styleUrls: ['header.component.scss']
})
export class HeaderComponent {

  showBottom = false;

  constructor(
      private router: Router,
      private menuService: MenuService,
      private pagesServices: PagesService
  ) {

  }

  ngOnInit() {
    this.menuService.setPagesTree();
  }

  openMobileMenu(){
    this.router.navigate([{outlets: {slider: 'pages-menu'}}], {skipLocationChange: true}).then();
  }

  get mainPage(){
    return this.pagesServices.currentPage.value.link == '/'
  }

}
