mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-17 07:50:12 +01:00
Configure material theme, add material button and input examples
This commit is contained in:
parent
70ac56b28a
commit
eaf4143731
17 changed files with 198 additions and 40 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { NbComponentShape, NbComponentSize, NbComponentStatus } from '@nebular/theme';
|
||||
import { NbComponentShape, NbComponentSize, NbComponentStatus, NbThemeService } from '@nebular/theme';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-buttons',
|
||||
|
|
@ -7,7 +8,23 @@ import { NbComponentShape, NbComponentSize, NbComponentStatus } from '@nebular/t
|
|||
templateUrl: './buttons.component.html',
|
||||
})
|
||||
export class ButtonsComponent {
|
||||
statuses: NbComponentStatus[] = [ 'primary', 'success', 'info', 'warning', 'danger' ];
|
||||
shapes: NbComponentShape[] = [ 'rectangle', 'semi-round', 'round' ];
|
||||
sizes: NbComponentSize[] = [ 'tiny', 'small', 'medium', 'large', 'giant' ];
|
||||
public constructor(private readonly themeService: NbThemeService) {}
|
||||
|
||||
private readonly subscription: Subscription = new Subscription();
|
||||
|
||||
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' ];
|
||||
public materialThemeActivated: boolean = false;
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.subscription.add(this.themeService.onThemeChange().subscribe(theme => {
|
||||
const themeName: string = theme?.name || '';
|
||||
this.materialThemeActivated = themeName.startsWith('material');
|
||||
}));
|
||||
}
|
||||
|
||||
public ngOnDestroy(): void {
|
||||
this.subscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue