Commit e9cc5ff7 authored by dev0tion's avatar dev0tion

Highlight current active coin

parent b7bc79ba
......@@ -2,11 +2,11 @@
<aside id="sidebar">
<!-- 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">
<span class="bar"></span>
</li>
<li (click)="loadStratisWallet()">
<li (click)="loadStratisWallet()" [class.active]="!bitcoinActive">
<img src="../../../assets/images/ico_stratis.svg" alt="Stratis">
<span class="bar"></span>
</li>
......
......@@ -13,20 +13,32 @@ import { GlobalService } from '../../shared/services/global.service';
export class SidebarComponent implements OnInit {
constructor(private globalService: GlobalService, private router: Router, private modalService: NgbModal) { }
private bitcoinActive: Boolean;
ngOnInit() {
if (this.globalService.getCoinName() === "Bitcoin") {
this.bitcoinActive = true;
} else if (this.globalService.getCoinName() === "Stratis") {
this.bitcoinActive = false;
}
}
private loadBitcoinWallet() {
this.toggleClass();
this.globalService.setCoinName("Bitcoin");
this.router.navigate(['/wallet']);
}
private loadStratisWallet() {
this.toggleClass();
this.globalService.setCoinName("Stratis");
this.router.navigate(['/wallet/stratis-wallet']);
}
private toggleClass(){
this.bitcoinActive = !this.bitcoinActive;
}
private logOut() {
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