ngx-admin/src/app/pages/forms/buttons/buttons.component.ts
2021-10-08 13:50:18 +03:00

26 lines
1,001 B
TypeScript

import { Component } from '@angular/core';
import { NbComponentShape, NbComponentSize, NbComponentStatus, NbThemeService } from '@nebular/theme';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
@Component({
selector: 'ngx-buttons',
styleUrls: ['./buttons.component.scss'],
templateUrl: './buttons.component.html',
})
export class ButtonsComponent {
public constructor(private readonly themeService: NbThemeService) {
this.materialTheme$ = this.themeService.onThemeChange()
.pipe(map(theme => {
const themeName: string = theme?.name || '';
return themeName.startsWith('material');
}));
}
public readonly materialTheme$: Observable<boolean>;
public readonly statuses: NbComponentStatus[] = [ 'primary', 'success', 'info', 'warning', 'danger' ];
public readonly shapes: NbComponentShape[] = [ 'rectangle', 'semi-round', 'round' ];
public readonly sizes: NbComponentSize[] = [ 'tiny', 'small', 'medium', 'large', 'giant' ];
}