mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +01:00
fix(dashboard): improve dropdowns for electricity and traffic charts
This commit is contained in:
parent
f7a61ee809
commit
479ca11ede
2 changed files with 12 additions and 2 deletions
|
|
@ -42,7 +42,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ngbDropdown [ngClass]="{'ghost-dropdown': currentTheme == 'default'}">
|
<div ngbDropdown [ngClass]="{'ghost-dropdown': currentTheme == 'default'}">
|
||||||
<button type="button" class="btn btn-primary" ngbDropdownToggle>
|
<button type="button" ngbDropdownToggle class="btn"
|
||||||
|
[ngClass]="{ 'btn-success': currentTheme == 'default', 'btn-primary': currentTheme != 'default'}">
|
||||||
{{ type }}
|
{{ type }}
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { NbThemeService } from '@nebular/theme';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ngx-traffic',
|
selector: 'ngx-traffic',
|
||||||
|
|
@ -8,7 +9,8 @@ import { Component } from '@angular/core';
|
||||||
<nb-card-header>
|
<nb-card-header>
|
||||||
<span>Traffic Consumption</span>
|
<span>Traffic Consumption</span>
|
||||||
<div class="ghost-dropdown" ngbDropdown>
|
<div class="ghost-dropdown" ngbDropdown>
|
||||||
<button type="button" class="btn btn-sm btn-primary" ngbDropdownToggle>
|
<button type="button" class="btn btn-sm" ngbDropdownToggle
|
||||||
|
[ngClass]="{ 'btn-success': currentTheme == 'default', 'btn-primary': currentTheme != 'default'}">
|
||||||
{{ type }}
|
{{ type }}
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
|
|
@ -25,4 +27,11 @@ import { Component } from '@angular/core';
|
||||||
export class TrafficComponent {
|
export class TrafficComponent {
|
||||||
type: string = 'month';
|
type: string = 'month';
|
||||||
types = ['week', 'month', 'year'];
|
types = ['week', 'month', 'year'];
|
||||||
|
currentTheme: string;
|
||||||
|
|
||||||
|
constructor(private themeService: NbThemeService) {
|
||||||
|
this.themeService.getJsTheme().subscribe(theme => {
|
||||||
|
this.currentTheme = theme.name;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue