Show alert banner on stale blocks
This commit is contained in:
		
							parent
							
								
									385cb087d3
								
							
						
					
					
						commit
						6942a6fd6a
					
				| @ -227,6 +227,7 @@ export interface BlockExtension { | ||||
|  */ | ||||
| export interface BlockExtended extends IEsploraApi.Block { | ||||
|   extras: BlockExtension; | ||||
|   canonical?: string; | ||||
| } | ||||
| 
 | ||||
| export interface BlockSummary { | ||||
|  | ||||
| @ -1,6 +1,10 @@ | ||||
| <div class="container-xl" (window:resize)="onResize($event)"> | ||||
| 
 | ||||
|   <div class="title-block" [class.time-ltr]="timeLtr" id="block"> | ||||
|     <div *ngIf="block?.stale" class="alert alert-mempool" role="alert"> | ||||
|       <span i18n="block.reorged|Block reorg" class="alert-text">This block does not belong to the main chain, it has been replaced by:</span> | ||||
|       <app-truncate [text]="block.canonical" [lastChars]="12" [link]="['/block/' | relativeUrl, block.canonical]" [maxWidth]="480"></app-truncate> | ||||
|     </div> | ||||
|     <h1> | ||||
|       <ng-container *ngIf="blockHeight == null || blockHeight > 0; else genesis" i18n="shared.block-title">Block</ng-container> | ||||
|       <ng-template #genesis i18n="@@2303359202781425764">Genesis</ng-template> | ||||
| @ -23,6 +27,8 @@ | ||||
| 
 | ||||
|     <div class="grow"></div> | ||||
| 
 | ||||
|     <button *ngIf="block?.stale" type="button" class="btn btn-sm btn-danger container-button" i18n="block.stale|Stale block state">Stale</button> | ||||
| 
 | ||||
|     <button [routerLink]="['/' | relativeUrl]" class="btn btn-sm">✕</button> | ||||
|   </div> | ||||
| 
 | ||||
|  | ||||
| @ -1,3 +1,26 @@ | ||||
| .title-block { | ||||
|   flex-wrap: wrap; | ||||
|   align-items: baseline; | ||||
|   @media (min-width: 650px) { | ||||
|     flex-direction: row; | ||||
|   } | ||||
|   h1 { | ||||
|     margin: 0rem; | ||||
|     margin-right: 15px; | ||||
|     line-height: 1; | ||||
|   } | ||||
| 
 | ||||
|   .alert-mempool { | ||||
|     flex-direction: row; | ||||
|     flex-wrap: wrap; | ||||
|   } | ||||
| 
 | ||||
|   .container-button { | ||||
|     align-self: center; | ||||
|     margin-right: 1em; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| .qr-wrapper { | ||||
|   background-color: #FFF; | ||||
|   padding: 10px; | ||||
|  | ||||
| @ -121,6 +121,7 @@ export interface Block { | ||||
|   weight: number; | ||||
|   previousblockhash: string; | ||||
|   stale?: boolean; | ||||
|   canonical?: string; | ||||
| } | ||||
| 
 | ||||
| export interface Address { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user