diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.html b/frontend/src/app/components/blocks-list/blocks-list.component.html index 2a4818c4f..d1327653b 100644 --- a/frontend/src/app/components/blocks-list/blocks-list.component.html +++ b/frontend/src/app/components/blocks-list/blocks-list.component.html @@ -1,48 +1,50 @@ -
-

Blocks

-
+
+

Blocks

- - - - - - - - + + + + + + + + - - - - - - - - - - + - - - - - - - @@ -83,8 +86,9 @@
HeightPoolTimestampMinedRewardFeesTxsSizeHeight + PoolTimestampMined + RewardFeesTxsSize
+ {{ block.height }} + - {{ + {{ block.extras.pool.name }} + ‎{{ block.timestamp * 1000 | date:'yyyy-MM-dd HH:mm' }} + + + + {{ block.tx_count | number }} +
@@ -53,29 +55,30 @@
+
+ + + + + + + +
- +
\ No newline at end of file diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.scss b/frontend/src/app/components/blocks-list/blocks-list.component.scss index 71d96323c..ba64fd6ed 100644 --- a/frontend/src/app/components/blocks-list/blocks-list.component.scss +++ b/frontend/src/app/components/blocks-list/blocks-list.component.scss @@ -2,14 +2,21 @@ max-width: 1400px; padding-bottom: 0; } +.container-xl.widget { + padding-left: 0px; +} .container { max-width: 100%; } -.row { - padding-top: 15px; - padding-bottom: 15px; +td { + padding-top: 0.7rem !important; + padding-bottom: 0.7rem !important; +} + +.clear-link { + color: white; } .disabled { @@ -21,6 +28,16 @@ background-color: #2d3348; } +.pool { + width: 17%; +} +.pool.widget { + width: 40%; + @media (max-width: 576px) { + padding-left: 30px; + width: 60%; + } +} .pool-name { display: inline-block; vertical-align: text-top; @@ -33,6 +50,12 @@ width: 10%; } } +.height.widget { + width: 20%; + @media (max-width: 576px) { + width: 10%; + } +} .timestamp { @media (max-width: 900px) { @@ -52,7 +75,13 @@ @media (max-width: 1100px) { padding-right: 10px; } - @media (max-width: 800px) { + @media (max-width: 875px) { + display: none; + } +} +.txs.widget { + padding-right: 0; + @media (max-width: 650px) { display: none; } } @@ -62,9 +91,8 @@ display: none; } } - -.pool { - width: 17%; +.fees.widget { + width: 20%; } .reward { @@ -73,6 +101,13 @@ padding-right: 30px; } } +.reward.widget { + width: 20%; + @media (max-width: 576px) { + width: 30%; + padding-right: 0; + } +} .size { width: 12%; diff --git a/frontend/src/app/components/blocks-list/blocks-list.component.ts b/frontend/src/app/components/blocks-list/blocks-list.component.ts index 3143b4f61..3606cc122 100644 --- a/frontend/src/app/components/blocks-list/blocks-list.component.ts +++ b/frontend/src/app/components/blocks-list/blocks-list.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; +import { Component, OnInit, ChangeDetectionStrategy, Input } from '@angular/core'; import { BehaviorSubject, Observable, timer } from 'rxjs'; import { delayWhen, map, retryWhen, switchMap, tap } from 'rxjs/operators'; import { BlockExtended } from 'src/app/interfaces/node-api.interface'; @@ -12,6 +12,8 @@ import { StateService } from 'src/app/services/state.service'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class BlocksList implements OnInit { + @Input() widget: boolean = false; + blocks$: Observable = undefined isLoading = true; @@ -20,17 +22,18 @@ export class BlocksList implements OnInit { page = 1; blocksCount: number; fromHeightSubject: BehaviorSubject = new BehaviorSubject(this.fromBlockHeight); + skeletonLines: number[] = []; constructor( private apiService: ApiService, public stateService: StateService, ) { - } ngOnInit(): void { + this.skeletonLines = this.widget === true ? [...Array(5).keys()] : [...Array(15).keys()]; this.paginationMaxSize = window.matchMedia('(max-width: 670px)').matches ? 3 : 5; - + this.blocks$ = this.fromHeightSubject.pipe( switchMap(() => { this.isLoading = true; @@ -48,6 +51,9 @@ export class BlocksList implements OnInit { block.extras.pool.logo = `./resources/mining-pools/` + block.extras.pool.name.toLowerCase().replace(' ', '').replace('.', '') + '.svg'; } + if (this.widget) { + return blocks.slice(0, 5); + } return blocks; }), retryWhen(errors => errors.pipe(delayWhen(() => timer(1000)))) diff --git a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html index 68209fed0..1c8fb2c9d 100644 --- a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html +++ b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html @@ -95,7 +95,7 @@
-
+ + + +
+
+
+
+ Latest blocks +
+ +
View + more »
+
+
@@ -115,7 +129,7 @@ Adjustments -