mirror of
https://github.com/mempool/mempool.git
synced 2024-12-27 08:44:26 +01:00
Add faq tab placeholder
This commit is contained in:
parent
77df0c524c
commit
37e2786c5e
@ -127,6 +127,10 @@ let routes: Routes = [
|
||||
path: 'docs/api/:type',
|
||||
component: DocsComponent
|
||||
},
|
||||
{
|
||||
path: 'docs/faq',
|
||||
component: DocsComponent
|
||||
},
|
||||
{
|
||||
path: 'docs/api',
|
||||
redirectTo: 'docs/api/rest'
|
||||
|
@ -4,9 +4,18 @@
|
||||
<h2 i18n="documentation.title">Documentation</h2>
|
||||
|
||||
<ul ngbNav #nav="ngbNav" [(activeId)]="activeTab" class="nav-tabs">
|
||||
|
||||
<li [ngbNavItem]="0" *ngIf="showFaqTab">
|
||||
<a ngbNavLink routerLink="/docs/faq">FAQ</a>
|
||||
<ng-template ngbNavContent>
|
||||
|
||||
<li [ngbNavItem]="0">
|
||||
<a ngbNavLink routerLink="../rest">API - REST</a>
|
||||
<p>FAQ placeholder</p>
|
||||
|
||||
</ng-template>
|
||||
</li>
|
||||
|
||||
<li [ngbNavItem]="1">
|
||||
<a ngbNavLink routerLink="/docs/api/rest">API - REST</a>
|
||||
<ng-template ngbNavContent>
|
||||
|
||||
<app-api-docs [restTabActivated]="true"></app-api-docs>
|
||||
@ -14,8 +23,8 @@
|
||||
</ng-template>
|
||||
</li>
|
||||
|
||||
<li [ngbNavItem]="1" *ngIf="showWebSocketTab">
|
||||
<a ngbNavLink routerLink="../websocket">API - WebSocket</a>
|
||||
<li [ngbNavItem]="2" *ngIf="showWebSocketTab">
|
||||
<a ngbNavLink routerLink="/docs/api/websocket">API - WebSocket</a>
|
||||
<ng-template ngbNavContent>
|
||||
|
||||
<app-api-docs [restTabActivated]="false"></app-api-docs>
|
||||
|
@ -12,6 +12,7 @@ export class DocsComponent implements OnInit {
|
||||
activeTab = 0;
|
||||
env: Env;
|
||||
showWebSocketTab = true;
|
||||
showFaqTab = true;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
@ -20,8 +21,16 @@ export class DocsComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
const url = this.route.snapshot.url;
|
||||
this.activeTab = ( url[2].path === "rest" ) ? 0 : 1;
|
||||
if( url[1].path === "faq" ) {
|
||||
this.activeTab = 0;
|
||||
} else if( url[2].path === "rest" ) {
|
||||
this.activeTab = 1;
|
||||
} else {
|
||||
this.activeTab = 2;
|
||||
}
|
||||
|
||||
this.env = this.stateService.env;
|
||||
this.showWebSocketTab = ( ! ( ( this.env.BASE_MODULE === "bisq" ) || ( this.stateService.network === "bisq" ) || ( this.stateService.network === "liquidtestnet" ) ) );
|
||||
this.showFaqTab = ( ( this.stateService.network === "" ) || ( this.stateService.network === "signet" ) || ( this.stateService.network === "testnet" ) ) ? true : false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user