mirror of
https://github.com/mempool/mempool.git
synced 2025-02-21 22:11:51 +01:00
Refactor preview routes into separate module
This commit is contained in:
parent
9a87b357fc
commit
9a5844bbdc
5 changed files with 76 additions and 90 deletions
|
@ -3,14 +3,10 @@ import { Routes, RouterModule } from '@angular/router';
|
||||||
import { AppPreloadingStrategy } from './app.preloading-strategy'
|
import { AppPreloadingStrategy } from './app.preloading-strategy'
|
||||||
import { StartComponent } from './components/start/start.component';
|
import { StartComponent } from './components/start/start.component';
|
||||||
import { TransactionComponent } from './components/transaction/transaction.component';
|
import { TransactionComponent } from './components/transaction/transaction.component';
|
||||||
import { TransactionPreviewComponent } from './components/transaction/transaction-preview.component';
|
|
||||||
import { BlockComponent } from './components/block/block.component';
|
import { BlockComponent } from './components/block/block.component';
|
||||||
import { BlockAuditComponent } from './components/block-audit/block-audit.component';
|
import { BlockAuditComponent } from './components/block-audit/block-audit.component';
|
||||||
import { BlockPreviewComponent } from './components/block/block-preview.component';
|
|
||||||
import { AddressComponent } from './components/address/address.component';
|
import { AddressComponent } from './components/address/address.component';
|
||||||
import { AddressPreviewComponent } from './components/address/address-preview.component';
|
|
||||||
import { MasterPageComponent } from './components/master-page/master-page.component';
|
import { MasterPageComponent } from './components/master-page/master-page.component';
|
||||||
import { MasterPagePreviewComponent } from './components/master-page-preview/master-page-preview.component';
|
|
||||||
import { AboutComponent } from './components/about/about.component';
|
import { AboutComponent } from './components/about/about.component';
|
||||||
import { StatusViewComponent } from './components/status-view/status-view.component';
|
import { StatusViewComponent } from './components/status-view/status-view.component';
|
||||||
import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component';
|
import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component';
|
||||||
|
@ -346,61 +342,18 @@ let routes: Routes = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'preview',
|
path: 'preview',
|
||||||
component: MasterPagePreviewComponent,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'block/:id',
|
path: '',
|
||||||
component: BlockPreviewComponent
|
loadChildren: () => import('./previews.module').then(m => m.PreviewsModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'testnet/block/:id',
|
path: 'testnet',
|
||||||
component: BlockPreviewComponent
|
loadChildren: () => import('./previews.module').then(m => m.PreviewsModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'signet/block/:id',
|
path: 'signet',
|
||||||
component: BlockPreviewComponent
|
loadChildren: () => import('./previews.module').then(m => m.PreviewsModule)
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'address/:id',
|
|
||||||
children: [],
|
|
||||||
component: AddressPreviewComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'testnet/address/:id',
|
|
||||||
children: [],
|
|
||||||
component: AddressPreviewComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'signet/address/:id',
|
|
||||||
children: [],
|
|
||||||
component: AddressPreviewComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'tx/:id',
|
|
||||||
children: [],
|
|
||||||
component: TransactionPreviewComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'testnet/tx/:id',
|
|
||||||
children: [],
|
|
||||||
component: TransactionPreviewComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'signet/tx/:id',
|
|
||||||
children: [],
|
|
||||||
component: TransactionPreviewComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'lightning',
|
|
||||||
loadChildren: () => import('./lightning/lightning-previews.module').then(m => m.LightningPreviewsModule)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'testnet/lightning',
|
|
||||||
loadChildren: () => import('./lightning/lightning-previews.module').then(m => m.LightningPreviewsModule)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'signet/lightning',
|
|
||||||
loadChildren: () => import('./lightning/lightning-previews.module').then(m => m.LightningPreviewsModule)
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -643,35 +596,14 @@ if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'liquid') {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'preview',
|
path: 'preview',
|
||||||
component: MasterPagePreviewComponent,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'block/:id',
|
path: '',
|
||||||
component: BlockPreviewComponent
|
loadChildren: () => import('./previews.module').then(m => m.PreviewsModule)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'testnet/block/:id',
|
path: 'testnet',
|
||||||
component: BlockPreviewComponent
|
loadChildren: () => import('./previews.module').then(m => m.PreviewsModule)
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'address/:id',
|
|
||||||
children: [],
|
|
||||||
component: AddressPreviewComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'testnet/address/:id',
|
|
||||||
children: [],
|
|
||||||
component: AddressPreviewComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'tx/:id',
|
|
||||||
children: [],
|
|
||||||
component: TransactionPreviewComponent
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'testnet/tx/:id',
|
|
||||||
children: [],
|
|
||||||
component: TransactionPreviewComponent
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,7 +42,7 @@ export class NodePreviewComponent implements OnInit {
|
||||||
this.node$ = this.activatedRoute.paramMap
|
this.node$ = this.activatedRoute.paramMap
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap((params: ParamMap) => {
|
switchMap((params: ParamMap) => {
|
||||||
this.publicKey = params.get('public_key');
|
this.publicKey = params.get('public_key');
|
||||||
this.openGraphService.waitFor('node-map-' + this.publicKey);
|
this.openGraphService.waitFor('node-map-' + this.publicKey);
|
||||||
this.openGraphService.waitFor('node-data-' + this.publicKey);
|
this.openGraphService.waitFor('node-data-' + this.publicKey);
|
||||||
return this.lightningApiService.getNode$(params.get('public_key'));
|
return this.lightningApiService.getNode$(params.get('public_key'));
|
||||||
|
|
26
frontend/src/app/previews.module.ts
Normal file
26
frontend/src/app/previews.module.ts
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { SharedModule } from './shared/shared.module';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { GraphsModule } from './graphs/graphs.module';
|
||||||
|
import { PreviewsRoutingModule } from './previews.routing.module';
|
||||||
|
import { TransactionPreviewComponent } from './components/transaction/transaction-preview.component';
|
||||||
|
import { BlockPreviewComponent } from './components/block/block-preview.component';
|
||||||
|
import { AddressPreviewComponent } from './components/address/address-preview.component';
|
||||||
|
import { MasterPagePreviewComponent } from './components/master-page-preview/master-page-preview.component';
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
TransactionPreviewComponent,
|
||||||
|
BlockPreviewComponent,
|
||||||
|
AddressPreviewComponent,
|
||||||
|
MasterPagePreviewComponent,
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
SharedModule,
|
||||||
|
RouterModule,
|
||||||
|
GraphsModule,
|
||||||
|
PreviewsRoutingModule,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class PreviewsModule { }
|
39
frontend/src/app/previews.routing.module.ts
Normal file
39
frontend/src/app/previews.routing.module.ts
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
import { TransactionPreviewComponent } from './components/transaction/transaction-preview.component';
|
||||||
|
import { BlockPreviewComponent } from './components/block/block-preview.component';
|
||||||
|
import { AddressPreviewComponent } from './components/address/address-preview.component';
|
||||||
|
import { MasterPagePreviewComponent } from './components/master-page-preview/master-page-preview.component';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: MasterPagePreviewComponent,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'block/:id',
|
||||||
|
component: BlockPreviewComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'address/:id',
|
||||||
|
children: [],
|
||||||
|
component: AddressPreviewComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'tx/:id',
|
||||||
|
children: [],
|
||||||
|
component: TransactionPreviewComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'lightning',
|
||||||
|
loadChildren: () => import('./lightning/lightning-previews.module').then(m => m.LightningPreviewsModule)
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class PreviewsRoutingModule { }
|
|
@ -7,7 +7,6 @@ import { faFilter, faAngleDown, faAngleUp, faAngleRight, faAngleLeft, faBolt, fa
|
||||||
faFileAlt, faRedoAlt, faArrowAltCircleRight, faExternalLinkAlt, faBook, faListUl, faDownload, faQrcode, faArrowRightArrowLeft } from '@fortawesome/free-solid-svg-icons';
|
faFileAlt, faRedoAlt, faArrowAltCircleRight, faExternalLinkAlt, faBook, faListUl, faDownload, faQrcode, faArrowRightArrowLeft } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
||||||
import { MasterPageComponent } from '../components/master-page/master-page.component';
|
import { MasterPageComponent } from '../components/master-page/master-page.component';
|
||||||
import { MasterPagePreviewComponent } from '../components/master-page-preview/master-page-preview.component';
|
|
||||||
import { PreviewTitleComponent } from '../components/master-page-preview/preview-title.component';
|
import { PreviewTitleComponent } from '../components/master-page-preview/preview-title.component';
|
||||||
import { BisqMasterPageComponent } from '../components/bisq-master-page/bisq-master-page.component';
|
import { BisqMasterPageComponent } from '../components/bisq-master-page/bisq-master-page.component';
|
||||||
import { LiquidMasterPageComponent } from '../components/liquid-master-page/liquid-master-page.component';
|
import { LiquidMasterPageComponent } from '../components/liquid-master-page/liquid-master-page.component';
|
||||||
|
@ -44,15 +43,12 @@ import { RouterModule } from '@angular/router';
|
||||||
import { CapAddressPipe } from './pipes/cap-address-pipe/cap-address-pipe';
|
import { CapAddressPipe } from './pipes/cap-address-pipe/cap-address-pipe';
|
||||||
import { StartComponent } from '../components/start/start.component';
|
import { StartComponent } from '../components/start/start.component';
|
||||||
import { TransactionComponent } from '../components/transaction/transaction.component';
|
import { TransactionComponent } from '../components/transaction/transaction.component';
|
||||||
import { TransactionPreviewComponent } from '../components/transaction/transaction-preview.component';
|
|
||||||
import { TransactionsListComponent } from '../components/transactions-list/transactions-list.component';
|
import { TransactionsListComponent } from '../components/transactions-list/transactions-list.component';
|
||||||
import { BlockComponent } from '../components/block/block.component';
|
import { BlockComponent } from '../components/block/block.component';
|
||||||
import { BlockPreviewComponent } from '../components/block/block-preview.component';
|
|
||||||
import { BlockAuditComponent } from '../components/block-audit/block-audit.component';
|
import { BlockAuditComponent } from '../components/block-audit/block-audit.component';
|
||||||
import { BlockOverviewGraphComponent } from '../components/block-overview-graph/block-overview-graph.component';
|
import { BlockOverviewGraphComponent } from '../components/block-overview-graph/block-overview-graph.component';
|
||||||
import { BlockOverviewTooltipComponent } from '../components/block-overview-tooltip/block-overview-tooltip.component';
|
import { BlockOverviewTooltipComponent } from '../components/block-overview-tooltip/block-overview-tooltip.component';
|
||||||
import { AddressComponent } from '../components/address/address.component';
|
import { AddressComponent } from '../components/address/address.component';
|
||||||
import { AddressPreviewComponent } from '../components/address/address-preview.component';
|
|
||||||
import { SearchFormComponent } from '../components/search-form/search-form.component';
|
import { SearchFormComponent } from '../components/search-form/search-form.component';
|
||||||
import { AddressLabelsComponent } from '../components/address-labels/address-labels.component';
|
import { AddressLabelsComponent } from '../components/address-labels/address-labels.component';
|
||||||
import { FooterComponent } from '../components/footer/footer.component';
|
import { FooterComponent } from '../components/footer/footer.component';
|
||||||
|
@ -117,21 +113,17 @@ import { GeolocationComponent } from '../shared/components/geolocation/geolocati
|
||||||
AmountComponent,
|
AmountComponent,
|
||||||
AboutComponent,
|
AboutComponent,
|
||||||
MasterPageComponent,
|
MasterPageComponent,
|
||||||
MasterPagePreviewComponent,
|
|
||||||
PreviewTitleComponent,
|
PreviewTitleComponent,
|
||||||
BisqMasterPageComponent,
|
BisqMasterPageComponent,
|
||||||
LiquidMasterPageComponent,
|
LiquidMasterPageComponent,
|
||||||
StartComponent,
|
StartComponent,
|
||||||
TransactionComponent,
|
TransactionComponent,
|
||||||
TransactionPreviewComponent,
|
|
||||||
BlockComponent,
|
BlockComponent,
|
||||||
BlockPreviewComponent,
|
|
||||||
BlockAuditComponent,
|
BlockAuditComponent,
|
||||||
BlockOverviewGraphComponent,
|
BlockOverviewGraphComponent,
|
||||||
BlockOverviewTooltipComponent,
|
BlockOverviewTooltipComponent,
|
||||||
TransactionsListComponent,
|
TransactionsListComponent,
|
||||||
AddressComponent,
|
AddressComponent,
|
||||||
AddressPreviewComponent,
|
|
||||||
SearchFormComponent,
|
SearchFormComponent,
|
||||||
TimeSpanComponent,
|
TimeSpanComponent,
|
||||||
AddressLabelsComponent,
|
AddressLabelsComponent,
|
||||||
|
@ -228,15 +220,12 @@ import { GeolocationComponent } from '../shared/components/geolocation/geolocati
|
||||||
AmountComponent,
|
AmountComponent,
|
||||||
StartComponent,
|
StartComponent,
|
||||||
TransactionComponent,
|
TransactionComponent,
|
||||||
TransactionPreviewComponent,
|
|
||||||
BlockComponent,
|
BlockComponent,
|
||||||
BlockPreviewComponent,
|
|
||||||
BlockAuditComponent,
|
BlockAuditComponent,
|
||||||
BlockOverviewGraphComponent,
|
BlockOverviewGraphComponent,
|
||||||
BlockOverviewTooltipComponent,
|
BlockOverviewTooltipComponent,
|
||||||
TransactionsListComponent,
|
TransactionsListComponent,
|
||||||
AddressComponent,
|
AddressComponent,
|
||||||
AddressPreviewComponent,
|
|
||||||
SearchFormComponent,
|
SearchFormComponent,
|
||||||
TimeSpanComponent,
|
TimeSpanComponent,
|
||||||
AddressLabelsComponent,
|
AddressLabelsComponent,
|
||||||
|
|
Loading…
Add table
Reference in a new issue