mirror of
https://github.com/mempool/mempool.git
synced 2024-12-28 01:04:28 +01:00
Fix routing for faq tab
Make API links relative + add routing for signet and testnet.
This commit is contained in:
parent
37e2786c5e
commit
61faf31644
@ -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'
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user