Add FAQ link to empty blocks

This commit is contained in:
Mononaut 2022-12-28 09:42:27 -06:00
parent 5905eebaa6
commit 6d95cfadac
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
2 changed files with 45 additions and 6 deletions

View File

@ -112,6 +112,7 @@
[flip]="false"
(txClickEvent)="onTxClick($event)"
></app-block-overview-graph>
<ng-container *ngTemplateOutlet="emptyBlockInfo"></ng-container>
</div>
</div>
</div>
@ -213,15 +214,21 @@
<div class="row">
<div class="col-sm">
<h3 class="block-subtitle" *ngIf="!isMobile" i18n="block.projected-block">Projected Block</h3>
<app-block-overview-graph #blockGraphProjected [isLoading]="isLoadingOverview" [resolution]="75"
[blockLimit]="stateService.blockVSize" [orientation]="'top'" [flip]="false" [mirrorTxid]="hoverTx"
(txClickEvent)="onTxClick($event)" (txHoverEvent)="onTxHover($event)" [unavailable]="!isMobile && !auditEnabled"></app-block-overview-graph>
<div class="block-graph-wrapper">
<app-block-overview-graph #blockGraphProjected [isLoading]="isLoadingOverview" [resolution]="75"
[blockLimit]="stateService.blockVSize" [orientation]="'top'" [flip]="false" [mirrorTxid]="hoverTx"
(txClickEvent)="onTxClick($event)" (txHoverEvent)="onTxHover($event)" [unavailable]="!isMobile && !auditEnabled"></app-block-overview-graph>
<ng-container *ngIf="!isMobile || mode !== 'actual'; else emptyBlockInfo"></ng-container>
</div>
</div>
<div class="col-sm" *ngIf="!isMobile">
<h3 class="block-subtitle" *ngIf="!isMobile" i18n="block.actual-block">Actual Block</h3>
<app-block-overview-graph #blockGraphActual [isLoading]="isLoadingOverview" [resolution]="75"
[blockLimit]="stateService.blockVSize" [orientation]="'top'" [flip]="false" [mirrorTxid]="hoverTx" mode="mined"
(txClickEvent)="onTxClick($event)" (txHoverEvent)="onTxHover($event)" [unavailable]="isMobile && !auditEnabled"></app-block-overview-graph>
<div class="block-graph-wrapper">
<app-block-overview-graph #blockGraphActual [isLoading]="isLoadingOverview" [resolution]="75"
[blockLimit]="stateService.blockVSize" [orientation]="'top'" [flip]="false" [mirrorTxid]="hoverTx" mode="mined"
(txClickEvent)="onTxClick($event)" (txHoverEvent)="onTxHover($event)" [unavailable]="isMobile && !auditEnabled"></app-block-overview-graph>
<ng-container *ngTemplateOutlet="emptyBlockInfo"></ng-container>
</div>
</div>
</div>
</div>
@ -343,5 +350,17 @@
</div>
<ng-template #emptyBlockInfo>
<a
*ngIf="network === '' && block && block.height > 100000 && block.tx_count <= 1"
class="info-bubble-link badge badge-primary"
[routerLink]="['/docs/faq/' | relativeUrl]"
fragment="why-empty-blocks"
>
<fa-icon [icon]="['fas', 'info-circle']" [fixedWidth]="true"></fa-icon>
<span i18n="block.empty-block-explanation">Why is this block empty?</span>
</a>
</ng-template>
<br>
<br>

View File

@ -203,3 +203,23 @@ h1 {
border-color: white;
}
}
.block-graph-wrapper {
position: relative;
}
.info-bubble-link {
position: absolute;
display: block;
top: 2em;
left: 50%;
margin: auto;
text-align: center;
padding: 0.5em 1em;
font-size: 80%;
transform: translateX(-50%);
.ng-fa-icon {
margin-right: 1em;
}
}