1- import { Component , ElementRef , HostListener , OnDestroy , OnInit , ViewChild } from '@angular/core' ;
1+ import { Component ,
2+ ElementRef ,
3+ HostListener ,
4+ OnDestroy ,
5+ OnInit ,
6+ ViewChild
7+ } from '@angular/core' ;
8+
29import { Subscription } from 'rxjs' ;
310
411import { AuthService } from '@services/auth.service' ;
12+
513import { IModalAuth } from '@interfaces/modal.interface' ;
614
715@Component ( {
@@ -15,9 +23,9 @@ export class AuthComponent implements OnInit, OnDestroy {
1523 @ViewChild ( 'modalAuth' ) modalAuth : ElementRef ;
1624 private bodyElement = document . body as HTMLBodyElement ;
1725
18- public showLogin : boolean = false ;
19- public showMore : boolean = true ;
20- private modalOpen : boolean = false ;
26+ public showLogin = false ;
27+ public showMore = true ;
28+ private modalOpen = false ;
2129
2230 constructor ( private authService : AuthService ) { }
2331
@@ -26,7 +34,9 @@ export class AuthComponent implements OnInit, OnDestroy {
2634 }
2735
2836 ngOnInit ( ) : void {
29- this . authSubscription = this . authService . isAuthenticatedEmitter . subscribe ( ( { to, isAuth } ) => ! isAuth && to !== 'hide' ? this . openModal ( { to, isAuth} ) : '' ) ;
37+ this . authSubscription = this . authService . isAuthenticatedEmitter
38+ . subscribe ( ( { to, isAuth } ) =>
39+ ! isAuth && to !== 'hide' ? this . openModal ( { to, isAuth} ) : '' ) ;
3040 }
3141
3242 openModal ( options : IModalAuth ) : void {
@@ -57,7 +67,7 @@ export class AuthComponent implements OnInit, OnDestroy {
5767 }
5868
5969 @HostListener ( 'window:keyup.esc' , [ '$event' ] )
60- onKeyup ( event : any ) {
70+ onKeyup ( ) {
6171 if ( this . modalOpen ) {
6272 this . closeModal ( ) ;
6373 }
0 commit comments