Merge pull request #5027 from mempool/mononaut/tracker-logos
Add enterprise logos to pizza tracker header
This commit is contained in:
		
						commit
						54289368b1
					
				| @ -1,9 +1,26 @@ | ||||
| <div class="mobile-wrapper"> | ||||
|   <div class="mobile-container"> | ||||
|     <div class="panel"> | ||||
|       <div class="field nav-header"> | ||||
|           <app-svg-images name="officialMempoolSpace" style="width: 144px; height: 36px" width="500" height="126" viewBox="0 0 500 126"></app-svg-images> | ||||
|           <div [ngSwitch]="network" class="network-label"> | ||||
|       <div class="nav-header"> | ||||
|         @if (enterpriseInfo?.header_img) { | ||||
|           <a class="d-flex" [routerLink]="['/' | relativeUrl]"> | ||||
|             <img *ngIf="enterpriseInfo.header_img" [src]="enterpriseInfo?.header_img" alt="enterpriseInfo.title" height="42px"> | ||||
|           </a> | ||||
|         } @else if (enterpriseInfo?.img || enterpriseInfo?.imageMd5) { | ||||
|           <a [routerLink]="['/' | relativeUrl]"> | ||||
|             <img [src]="enterpriseInfo.img || '/api/v1/services/enterprise/images/' + enterpriseInfo.name + '/logo?imageMd5=' + enterpriseInfo.imageMd5" class="subdomain_logo" [class]="{'rounded': enterpriseInfo.rounded_corner}"> | ||||
|           </a> | ||||
|           <div class="vertical-line"></div> | ||||
|         } | ||||
|         @if (!enterpriseInfo?.header_img) { | ||||
|           <a [routerLink]="['/' | relativeUrl]"> | ||||
|             <app-svg-images *ngIf="!officialMempoolSpace" name="mempoolSpace" style="width: 144px; height: 36px" viewBox="0 0 500 126" width="500" height="126" class="mempool-logo"></app-svg-images> | ||||
|             <app-svg-images *ngIf="officialMempoolSpace" name="officialMempoolSpace" style="width: 144px; height: 36px" width="500" height="126" viewBox="0 0 500 126"></app-svg-images> | ||||
|           </a> | ||||
|         } | ||||
| 
 | ||||
|         @if (enterpriseInfo?.header_img || (!enterpriseInfo?.img && !enterpriseInfo?.imageMd5)) { | ||||
|           <div [ngSwitch]="network" class="network-label" [class.hide-name]="enterpriseInfo?.header_img"> | ||||
|             <span *ngSwitchCase="'signet'" class="network signet"><span class="name">Bitcoin Signet</span><app-svg-images name="signet" width="35" height="35" viewBox="0 0 65 65" style="display: inline-block" class="mainnet ml-2"></app-svg-images></span> | ||||
|             <span *ngSwitchCase="'testnet'" class="network testnet"><span class="name">Bitcoin Testnet3</span><app-svg-images name="testnet" width="35" height="35" viewBox="0 0 65 65" style="display: inline-block" class="mainnet ml-2"></app-svg-images></span> | ||||
|             <span *ngSwitchCase="'testnet4'" class="network testnet"><span class="name">Bitcoin Testnet4</span><app-svg-images name="testnet4" width="35" height="35" viewBox="0 0 65 65" style="display: inline-block" class="mainnet ml-2"></app-svg-images></span> | ||||
| @ -11,6 +28,7 @@ | ||||
|             <span *ngSwitchCase="'liquidtestnet'" class="network liquidtestnet"><span class="name">Liquid Testnet</span><app-svg-images name="liquidtestnet" width="35" height="35" viewBox="0 0 125 125" style="display: inline-block" class="mainnet ml-2"></app-svg-images></span> | ||||
|             <span *ngSwitchDefault class="network mainnet"><span class="name">Bitcoin</span><app-svg-images name="bitcoin" width="35" height="35" viewBox="0 0 65 65" style="display: inline-block" class="mainnet ml-2"></app-svg-images></span> | ||||
|           </div> | ||||
|         } | ||||
|       </div> | ||||
|       <div class="field"> | ||||
|         <div class="label" i18n="shared.transaction">Transaction</div> | ||||
|  | ||||
| @ -40,7 +40,14 @@ | ||||
| } | ||||
| 
 | ||||
| .nav-header { | ||||
|   display: flex; | ||||
|   flex-direction: row; | ||||
|   flex-wrap: nowrap; | ||||
|   width: 100%; | ||||
|   max-width: 100%; | ||||
|   padding: 1em; | ||||
|   position: relative; | ||||
|   background: var(--nav-bg); | ||||
|   box-shadow: 0 -5px 15px #000; | ||||
|   z-index: 100; | ||||
|   align-items: center; | ||||
| @ -53,6 +60,40 @@ | ||||
|       flex-direction: row; | ||||
|       align-items: center; | ||||
|     } | ||||
| 
 | ||||
|     &.hide-name .name { | ||||
|       display: none; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   .subdomain_logo { | ||||
|     height: 35px; | ||||
|     overflow: clip; | ||||
|     max-width: 140px; | ||||
|     margin: auto; | ||||
|     align-self: center; | ||||
|     .rounded { | ||||
|       border-radius: 5px; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   .subdomain_container { | ||||
|     max-width: 140px; | ||||
|     text-align: center; | ||||
|     align-self: center; | ||||
|   } | ||||
| 
 | ||||
|   .vertical-line { | ||||
|     border-left: 1px solid #444; | ||||
|     height: 30px; | ||||
|     margin-left: 10px; | ||||
|     margin-right: 10px; | ||||
|     margin-top: 3px; | ||||
|   } | ||||
| 
 | ||||
|   .logo-holder { | ||||
|     display: flex; | ||||
|     flex-direction: row; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -113,6 +113,10 @@ export class TrackerComponent implements OnInit, OnDestroy { | ||||
|   scrollIntoAccelPreview = false; | ||||
|   auditEnabled: boolean = this.stateService.env.AUDIT && this.stateService.env.BASE_MODULE === 'mempool' && this.stateService.env.MINING_DASHBOARD === true; | ||||
| 
 | ||||
|   enterpriseInfo: any; | ||||
|   enterpriseInfo$: Subscription; | ||||
|   officialMempoolSpace = this.stateService.env.OFFICIAL_MEMPOOL_SPACE; | ||||
| 
 | ||||
|   constructor( | ||||
|     private route: ActivatedRoute, | ||||
|     private electrsApiService: ElectrsApiService, | ||||
| @ -152,6 +156,10 @@ export class TrackerComponent implements OnInit, OnDestroy { | ||||
| 
 | ||||
|     this.enterpriseService.page(); | ||||
| 
 | ||||
|     this.enterpriseInfo$ = this.enterpriseService.info$.subscribe(info => { | ||||
|       this.enterpriseInfo = info; | ||||
|     }); | ||||
| 
 | ||||
|     this.websocketService.want(['blocks', 'mempool-blocks']); | ||||
|     this.stateService.networkChanged$.subscribe( | ||||
|       (network) => { | ||||
| @ -702,6 +710,7 @@ export class TrackerComponent implements OnInit, OnDestroy { | ||||
|     this.blocksSubscription.unsubscribe(); | ||||
|     this.miningSubscription?.unsubscribe(); | ||||
|     this.currencyChangeSubscription?.unsubscribe(); | ||||
|     this.enterpriseInfo$?.unsubscribe(); | ||||
|     this.leaveTransaction(); | ||||
|   } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user