2019-07-16 08:38:11 +03:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Akveo. All Rights Reserved.
|
|
|
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
|
|
|
*/
|
|
|
|
|
|
2020-03-24 16:06:05 +03:00
|
|
|
import { Component, OnDestroy, Input } from '@angular/core';
|
2019-07-16 08:38:11 +03:00
|
|
|
import { NbMediaBreakpoint, NbMediaBreakpointsService, NbThemeService } from '@nebular/theme';
|
|
|
|
|
import { takeWhile } from 'rxjs/operators';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'ngx-landing-main-info',
|
|
|
|
|
templateUrl: './main-info-section.component.html',
|
|
|
|
|
styleUrls: ['./main-info-section.component.scss'],
|
|
|
|
|
})
|
|
|
|
|
export class MainInfoSectionComponent implements OnDestroy {
|
2020-07-10 13:34:49 +03:00
|
|
|
constructor(themeService: NbThemeService,
|
|
|
|
|
breakpointService: NbMediaBreakpointsService) {
|
2020-03-12 15:27:41 +03:00
|
|
|
this.breakpoints = breakpointService.getBreakpointsMap();
|
|
|
|
|
themeService.onMediaQueryChange()
|
2019-07-16 08:38:11 +03:00
|
|
|
.pipe(takeWhile(() => this.alive))
|
|
|
|
|
.subscribe(([oldValue, newValue]) => {
|
|
|
|
|
this.breakpoint = newValue;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-12 15:27:41 +03:00
|
|
|
private alive = true;
|
2020-03-25 22:10:12 +03:00
|
|
|
public forMaterialTheme: boolean = false;
|
2020-03-12 15:27:41 +03:00
|
|
|
public readonly breakpoints: any;
|
|
|
|
|
public breakpoint: NbMediaBreakpoint;
|
|
|
|
|
|
|
|
|
|
@Input() public set material(value: any) {
|
2020-03-23 15:29:27 +03:00
|
|
|
this.forMaterialTheme = (value);
|
2020-03-12 15:27:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public get imageUrl(): string {
|
2020-03-24 16:06:05 +03:00
|
|
|
return this.forMaterialTheme !== false
|
2020-04-02 11:41:41 +03:00
|
|
|
? 'assets/img/ngx-admin-material.jpg'
|
2020-03-26 13:21:49 +03:00
|
|
|
: 'assets/img/ngx-admin.png';
|
2020-03-12 15:27:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ngOnDestroy() {
|
2019-07-16 08:38:11 +03:00
|
|
|
this.alive = false;
|
|
|
|
|
}
|
|
|
|
|
}
|