Commit e9cc5ff7 authored by dev0tion's avatar dev0tion

Highlight current active coin

parent b7bc79ba
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<aside id="sidebar"> <aside id="sidebar">
<!-- menu--> <!-- menu-->
<ul class="list-unstyled menu"> <ul class="list-unstyled menu">
<li class="active" (click)="loadBitcoinWallet()"> <li (click)="loadBitcoinWallet()" [class.active]="bitcoinActive">
<img src="../../../assets/images/ico_bitcoin.svg" alt="Bitcoin"> <img src="../../../assets/images/ico_bitcoin.svg" alt="Bitcoin">
<span class="bar"></span> <span class="bar"></span>
</li> </li>
<li (click)="loadStratisWallet()"> <li (click)="loadStratisWallet()" [class.active]="!bitcoinActive">
<img src="../../../assets/images/ico_stratis.svg" alt="Stratis"> <img src="../../../assets/images/ico_stratis.svg" alt="Stratis">
<span class="bar"></span> <span class="bar"></span>
</li> </li>
......
...@@ -13,20 +13,32 @@ import { GlobalService } from '../../shared/services/global.service'; ...@@ -13,20 +13,32 @@ import { GlobalService } from '../../shared/services/global.service';
export class SidebarComponent implements OnInit { export class SidebarComponent implements OnInit {
constructor(private globalService: GlobalService, private router: Router, private modalService: NgbModal) { } constructor(private globalService: GlobalService, private router: Router, private modalService: NgbModal) { }
private bitcoinActive: Boolean;
ngOnInit() { ngOnInit() {
if (this.globalService.getCoinName() === "Bitcoin") {
this.bitcoinActive = true;
} else if (this.globalService.getCoinName() === "Stratis") {
this.bitcoinActive = false;
}
} }
private loadBitcoinWallet() { private loadBitcoinWallet() {
this.toggleClass();
this.globalService.setCoinName("Bitcoin"); this.globalService.setCoinName("Bitcoin");
this.router.navigate(['/wallet']); this.router.navigate(['/wallet']);
} }
private loadStratisWallet() { private loadStratisWallet() {
this.toggleClass();
this.globalService.setCoinName("Stratis"); this.globalService.setCoinName("Stratis");
this.router.navigate(['/wallet/stratis-wallet']); this.router.navigate(['/wallet/stratis-wallet']);
} }
private toggleClass(){
this.bitcoinActive = !this.bitcoinActive;
}
private logOut() { private logOut() {
const modalRef = this.modalService.open(LogoutConfirmationComponent); const modalRef = this.modalService.open(LogoutConfirmationComponent);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment