|
|
|
@ -15,7 +15,6 @@ |
|
|
|
///
|
|
|
|
|
|
|
|
import { Component, Input, OnInit } from '@angular/core'; |
|
|
|
import { coerceBoolean } from '@shared/decorators/coercion'; |
|
|
|
import { AuthService } from '@core/auth/auth.service'; |
|
|
|
import { AppState } from '@core/core.state'; |
|
|
|
import { Store } from '@ngrx/store'; |
|
|
|
@ -30,24 +29,28 @@ import { UrlHolder } from '@shared/pipe/image.pipe'; |
|
|
|
}) |
|
|
|
export class LogoComponent implements OnInit { |
|
|
|
|
|
|
|
@Input() |
|
|
|
@coerceBoolean() |
|
|
|
isLogin: boolean = false; |
|
|
|
|
|
|
|
@Input() |
|
|
|
src: string | UrlHolder = 'assets/logo_title_white.svg'; |
|
|
|
|
|
|
|
@Input() |
|
|
|
link: string | UrlTree; |
|
|
|
|
|
|
|
@Input() |
|
|
|
target: string = null; |
|
|
|
|
|
|
|
isExternal = false; |
|
|
|
|
|
|
|
constructor(private authService: AuthService, |
|
|
|
private store: Store<AppState>) { |
|
|
|
} |
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
if (!this.isLogin && !this.link) { |
|
|
|
if (!this.link) { |
|
|
|
const authState = getCurrentAuthState(this.store); |
|
|
|
this.link = this.authService.defaultUrl(true, authState); |
|
|
|
} |
|
|
|
if (typeof this.link === 'string' && this.link.startsWith('http')) { |
|
|
|
this.isExternal = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|