Liquid and Testnet now accessable from the main site

fixes #35
This commit is contained in:
softsimon
2020-05-09 20:37:50 +07:00
parent 20c7ee98e7
commit 1feb985bec
45 changed files with 452 additions and 162 deletions

View File

@@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, HostListener } from '@angular/core';
import { StateService } from '../../services/state.service';
import { environment } from 'src/environments/environment';
@Component({
selector: 'app-master-page',
@@ -8,20 +7,43 @@ import { environment } from 'src/environments/environment';
styleUrls: ['./master-page.component.scss']
})
export class MasterPageComponent implements OnInit {
network = environment.network;
network = '';
tvViewRoute = '/tv';
navCollapsed = false;
connectionState = 2;
networkDropdownHidden = true;
constructor(
private stateService: StateService,
) { }
@HostListener('document:click', ['$event'])
documentClick(event: any): void {
if (!event.target.classList.contains('dropdown-toggle')) {
this.networkDropdownHidden = true;
}
}
ngOnInit() {
this.stateService.connectionState$
.subscribe((state) => {
this.connectionState = state;
});
this.stateService.networkChanged$
.subscribe((network) => {
this.network = network;
if (network === 'testnet') {
this.tvViewRoute = '/testnet-tv';
} else if (network === 'liquid') {
this.tvViewRoute = '/liquid-tv';
} else {
this.tvViewRoute = '/tv';
}
});
}
collapse(): void {