Fix routing for faq tab

Make API links relative + add routing for signet and
testnet.
This commit is contained in:
hunicus 2022-03-24 10:38:32 -04:00
parent 37e2786c5e
commit 61faf31644
No known key found for this signature in database
GPG Key ID: 24837C51B6D81FD9
3 changed files with 16 additions and 8 deletions

View File

@ -274,6 +274,10 @@ let routes: Routes = [
path: 'docs/api/:type',
component: DocsComponent
},
{
path: 'docs/faq',
component: DocsComponent
},
{
path: 'docs/api',
redirectTo: 'docs/api/rest'
@ -410,6 +414,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,9 @@
<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>
<a ngbNavLink [routerLink]="['/docs/faq' | relativeUrl]">FAQ</a>
<ng-template ngbNavContent>
<p>FAQ placeholder</p>
@ -15,7 +15,7 @@
</li>
<li [ngbNavItem]="1">
<a ngbNavLink routerLink="/docs/api/rest">API - REST</a>
<a ngbNavLink [routerLink]="['/docs/api/rest' | relativeUrl]">API - REST</a>
<ng-template ngbNavContent>
<app-api-docs [restTabActivated]="true"></app-api-docs>
@ -24,7 +24,7 @@
</li>
<li [ngbNavItem]="2" *ngIf="showWebSocketTab">
<a ngbNavLink routerLink="/docs/api/websocket">API - WebSocket</a>
<a ngbNavLink [routerLink]="['/docs/api/websocket' | relativeUrl]">API - WebSocket</a>
<ng-template ngbNavContent>
<app-api-docs [restTabActivated]="false"></app-api-docs>

View File

@ -24,13 +24,13 @@ export class DocsComponent implements OnInit {
if( url[1].path === "faq" ) {
this.activeTab = 0;
} else if( url[2].path === "rest" ) {
this.activeTab = 1;
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;
this.showWebSocketTab = ( ! ( ( this.stateService.network === "bisq" ) || ( this.stateService.network === "liquidtestnet" ) ) );
this.showFaqTab = ( this.env.BASE_MODULE === 'mempool' ) ? true : false;
}
}