import {Component} from '@angular/core';
import {Router, NavigationStart, NavigationEnd} from '@angular/router';
import {CartService} from '../cart.service';
import {AppConfig} from '../../config/app.config';

@Component({
    selector: 'app-footer',
    templateUrl: './footer.component.html',
    styleUrls: ['./footer.component.scss']
})

export class FooterComponent {
    auth: boolean;
    progressBarMode: string;
    cartItems: number;
    cartPrice: number;

    constructor(private router: Router,
                private cartService: CartService) {
        /*this.auth = false;
        this.cartService.cartCount.subscribe(res => this.cartItems = res);
        this.cartService.cartSum.subscribe(res => this.cartPrice = res);

        this.router.events.filter(event => event instanceof NavigationEnd).subscribe((event: NavigationEnd) => {
            this.auth = event.url !== '/';
        });*/

    }

    openCart() {
        this.router.navigate([AppConfig.routes.cart]);
    }
}
