2021-12-01 17:01:50 -05:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { ActivatedRoute } from '@angular/router';
|
2021-12-09 07:44:49 -05:00
|
|
|
import { Env, StateService } from 'src/app/services/state.service';
|
2021-12-01 17:01:50 -05:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-docs',
|
|
|
|
templateUrl: './docs.component.html',
|
|
|
|
styleUrls: ['./docs.component.scss']
|
|
|
|
})
|
|
|
|
export class DocsComponent implements OnInit {
|
|
|
|
|
|
|
|
activeTab = 0;
|
2021-12-09 07:44:49 -05:00
|
|
|
env: Env;
|
|
|
|
showWebSocketTab = true;
|
2022-03-24 08:55:20 -04:00
|
|
|
showFaqTab = true;
|
2021-12-01 17:01:50 -05:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
private route: ActivatedRoute,
|
2021-12-09 07:44:49 -05:00
|
|
|
private stateService: StateService,
|
2021-12-01 17:01:50 -05:00
|
|
|
) { }
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
const url = this.route.snapshot.url;
|
2022-03-24 08:55:20 -04:00
|
|
|
if( url[1].path === "faq" ) {
|
|
|
|
this.activeTab = 0;
|
|
|
|
} else if( url[2].path === "rest" ) {
|
2022-03-24 10:38:32 -04:00
|
|
|
this.activeTab = 1;
|
2022-03-24 08:55:20 -04:00
|
|
|
} else {
|
|
|
|
this.activeTab = 2;
|
|
|
|
}
|
2022-03-24 10:38:32 -04:00
|
|
|
|
2021-12-09 07:44:49 -05:00
|
|
|
this.env = this.stateService.env;
|
2022-03-24 10:38:32 -04:00
|
|
|
this.showWebSocketTab = ( ! ( ( this.stateService.network === "bisq" ) || ( this.stateService.network === "liquidtestnet" ) ) );
|
|
|
|
this.showFaqTab = ( this.env.BASE_MODULE === 'mempool' ) ? true : false;
|
2021-12-01 17:01:50 -05:00
|
|
|
}
|
|
|
|
}
|