Add faq tab placeholder

This commit is contained in:
hunicus 2022-03-24 08:55:20 -04:00
parent 77df0c524c
commit 37e2786c5e
No known key found for this signature in database
GPG Key ID: 24837C51B6D81FD9
3 changed files with 27 additions and 5 deletions

View File

@ -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'

View File

@ -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>

View File

@ -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;
}
}