Skip to content

Commit

Permalink
Add color separation between profile A/B
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Lebo committed Feb 15, 2024
1 parent d128e2f commit 695e6eb
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,26 @@ import {ProfileComparatorService} from '../../../shared/profileComparatorService
})
export class DiffTabsButtonComponent implements OnInit {
@Input({required: true}) index = 0;
buttonFill = 'btn-outline-primary';
buttonFill = 'btn-outline-secondary';
private enabled = false;

constructor(private profileComparatorService: ProfileComparatorService) {
}

public ngOnInit() {
this.profileComparatorService.profileAIndex.subscribe((value) => {
if (value === this.index){
this.enablePrimaryProfile();
}

if(this.enabled && value !== this.index){
this.disableProfile();
}
});

this.profileComparatorService.profileBIndex.subscribe((value) => {
if (value === this.index) {
this.enableProfile();
this.enableSecondaryProfile();
}
});
}
Expand All @@ -32,13 +36,18 @@ export class DiffTabsButtonComponent implements OnInit {
this.profileComparatorService.appendProfileToProfileComparison(this.index);
}

private enableProfile() {
private enablePrimaryProfile() {
this.buttonFill = 'btn-primary';
this.enabled = true;
}

private enableSecondaryProfile() {
this.buttonFill = 'btn-secondary';
this.enabled = true;
}

private disableProfile() {
this.buttonFill = 'btn-outline-primary';
this.buttonFill = 'btn-outline-secondary';
this.enabled = false;
}
}

0 comments on commit 695e6eb

Please sign in to comment.