diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index 1a658c44b..c9f7e19d4 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -4,8 +4,10 @@ import { StartComponent } from './components/start/start.component'; import { TransactionComponent } from './components/transaction/transaction.component'; import { BlockComponent } from './components/block/block.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 { 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 { StatusViewComponent } from './components/status-view/status-view.component'; import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component'; @@ -23,7 +25,7 @@ import { AssetComponent } from './components/asset/asset.component'; import { AssetsNavComponent } from './components/assets/assets-nav/assets-nav.component'; let routes: Routes = [ - { + { path: 'testnet', children: [ { @@ -315,6 +317,16 @@ let routes: Routes = [ }, ], }, + { + path: 'preview', + component: MasterPagePreviewComponent, + children: [ + { + path: 'block/:id', + component: BlockPreviewComponent + }, + ], + }, { path: 'status', component: StatusViewComponent @@ -576,4 +588,3 @@ if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'liquid') { })], }) export class AppRoutingModule { } - diff --git a/frontend/src/app/components/block/block-preview.component.html b/frontend/src/app/components/block/block-preview.component.html new file mode 100644 index 000000000..5cfc31c70 --- /dev/null +++ b/frontend/src/app/components/block/block-preview.component.html @@ -0,0 +1,92 @@ +
+
+
+

+ Genesis + + {{ blockHeight }} + + + Block + + + {{ blockHeight }} + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Timestamp + {{ block?.timestamp * 1000 | date:'yyyy-MM-dd HH:mm' }} +
Size
Weight
Median fee~{{ block?.extras?.medianFee | number:'1.0-0' }} sat/vB
Total fees + + + +
Subsidy + fees: + +
Miner + + {{ block?.extras.pool.name }} + + + + {{ block?.extras.pool.name }} + +
+
+
+ +
+
+
diff --git a/frontend/src/app/components/block/block-preview.component.scss b/frontend/src/app/components/block/block-preview.component.scss new file mode 100644 index 000000000..fb51413e3 --- /dev/null +++ b/frontend/src/app/components/block/block-preview.component.scss @@ -0,0 +1,7 @@ +.box { + padding: 2rem 6rem; +} + +.block-title { + margin-bottom: 0.5em; +} diff --git a/frontend/src/app/components/block/block-preview.component.ts b/frontend/src/app/components/block/block-preview.component.ts new file mode 100644 index 000000000..bab4e0489 --- /dev/null +++ b/frontend/src/app/components/block/block-preview.component.ts @@ -0,0 +1,11 @@ +import { Component } from '@angular/core'; +import { BlockComponent } from './block.component'; + +@Component({ + selector: 'app-block-preview', + templateUrl: './block-preview.component.html', + styleUrls: ['./block.component.scss', './block-preview.component.scss'] +}) +export class BlockPreviewComponent extends BlockComponent { + +} diff --git a/frontend/src/app/components/master-page-preview/master-page-preview.component.html b/frontend/src/app/components/master-page-preview/master-page-preview.component.html new file mode 100644 index 000000000..6c2e45242 --- /dev/null +++ b/frontend/src/app/components/master-page-preview/master-page-preview.component.html @@ -0,0 +1,21 @@ + +
+ + + +
+
diff --git a/frontend/src/app/components/master-page-preview/master-page-preview.component.scss b/frontend/src/app/components/master-page-preview/master-page-preview.component.scss new file mode 100644 index 000000000..eebb9a75b --- /dev/null +++ b/frontend/src/app/components/master-page-preview/master-page-preview.component.scss @@ -0,0 +1,35 @@ +.preview-wrapper { + position: relative; + display: block; + margin: auto; + max-width: 1024px; + max-height: 512px; + padding-bottom: 64px; + + footer { + position: absolute; + left: 0; + right: 0; + bottom: 0; + z-index: 100; + min-height: 64px; + padding: 0rem 2rem; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + background: #11131f; + text-align: start; + } + + .footer-brand { + width: 60%; + } + + .network { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + } +} diff --git a/frontend/src/app/components/master-page-preview/master-page-preview.component.ts b/frontend/src/app/components/master-page-preview/master-page-preview.component.ts new file mode 100644 index 000000000..9678aa32d --- /dev/null +++ b/frontend/src/app/components/master-page-preview/master-page-preview.component.ts @@ -0,0 +1,25 @@ +import { Component, OnInit } from '@angular/core'; +import { StateService } from '../../services/state.service'; +import { Observable, merge, of } from 'rxjs'; +import { LanguageService } from 'src/app/services/language.service'; + +@Component({ + selector: 'app-master-page-preview', + templateUrl: './master-page-preview.component.html', + styleUrls: ['./master-page-preview.component.scss'], +}) +export class MasterPagePreviewComponent implements OnInit { + network$: Observable; + officialMempoolSpace = this.stateService.env.OFFICIAL_MEMPOOL_SPACE; + urlLanguage: string; + + constructor( + public stateService: StateService, + private languageService: LanguageService, + ) { } + + ngOnInit() { + this.network$ = merge(of(''), this.stateService.networkChanged$); + this.urlLanguage = this.languageService.getLanguageForUrl(); + } +} diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts index cec162ad9..cd087a3c4 100644 --- a/frontend/src/app/shared/shared.module.ts +++ b/frontend/src/app/shared/shared.module.ts @@ -7,6 +7,7 @@ import { faFilter, faAngleDown, faAngleUp, faAngleRight, faAngleLeft, faBolt, fa faFileAlt, faRedoAlt, faArrowAltCircleRight, faExternalLinkAlt, faBook, faListUl, faDownload, faQrcode } from '@fortawesome/free-solid-svg-icons'; import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { MasterPageComponent } from '../components/master-page/master-page.component'; +import { MasterPagePreviewComponent } from '../components/master-page-preview/master-page-preview.component'; import { BisqMasterPageComponent } from '../components/bisq-master-page/bisq-master-page.component'; import { LiquidMasterPageComponent } from '../components/liquid-master-page/liquid-master-page.component'; import { AboutComponent } from '../components/about/about.component'; @@ -44,6 +45,7 @@ import { StartComponent } from '../components/start/start.component'; import { TransactionComponent } from '../components/transaction/transaction.component'; import { TransactionsListComponent } from '../components/transactions-list/transactions-list.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 { BlockOverviewGraphComponent } from '../components/block-overview-graph/block-overview-graph.component'; import { BlockOverviewTooltipComponent } from '../components/block-overview-tooltip/block-overview-tooltip.component'; @@ -110,11 +112,13 @@ import { TimestampComponent } from './components/timestamp/timestamp.component'; AmountComponent, AboutComponent, MasterPageComponent, + MasterPagePreviewComponent, BisqMasterPageComponent, LiquidMasterPageComponent, StartComponent, TransactionComponent, BlockComponent, + BlockPreviewComponent, BlockAuditComponent, BlockOverviewGraphComponent, BlockOverviewTooltipComponent, @@ -215,6 +219,7 @@ import { TimestampComponent } from './components/timestamp/timestamp.component'; StartComponent, TransactionComponent, BlockComponent, + BlockPreviewComponent, BlockAuditComponent, BlockOverviewGraphComponent, BlockOverviewTooltipComponent,