Merge pull request #52 from Pear-Trading/finn/sectorColours

added varying colors based on sector
This commit is contained in:
Finn 2017-12-20 13:45:22 +00:00 committed by GitHub
commit 4f6edf9470
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View file

@ -85,7 +85,7 @@
<ul class="icons-list"> <ul class="icons-list">
<!-- New loop --> <!-- New loop -->
<li *ngFor="let sector of sectorLetters | slice:0:sectorLimit; let i=index"> <li *ngFor="let sector of sectorLetters | slice:0:sectorLimit; let i=index">
<i [ngClass]="sectorIcons [sector] || 'icon-question'" class="bg-primary"></i> <i [ngClass]="[sectorIcons [sector] || 'icon-question', sectorClasses [sector] || 'bg-info']"></i>
<div class="desc"> <div class="desc">
<div class="title">{{ sectorNames [sector] || 'N/A' }}</div> <div class="title">{{ sectorNames [sector] || 'N/A' }}</div>
</div> </div>

View file

@ -78,6 +78,30 @@ export class DashboardCustomerComponent implements OnInit {
U: 'icon-globe', U: 'icon-globe',
} }
sectorClasses = {
A: 'bg-primary',
B: 'bg-success',
C: 'bg-danger',
D: 'bg-warning',
E: 'bg-info',
F: 'bg-primary',
G: 'bg-success',
H: 'bg-danger',
I: 'bg-warning',
J: 'bg-info',
K: 'bg-primary',
L: 'bg-success',
M: 'bg-danger',
N: 'bg-warning',
O: 'bg-info',
P: 'bg-primary',
Q: 'bg-success',
R: 'bg-danger',
S: 'bg-warning',
T: 'bg-info',
U: 'bg-primary',
}
sectorLetters: string[] = []; sectorLetters: string[] = [];
sectorPurchases: number[] = []; sectorPurchases: number[] = [];
sectorLimit: number = 10; sectorLimit: number = 10;