Update title to - "<network> Explorer"
This commit is contained in:
		
							parent
							
								
									17fc486a60
								
							
						
					
					
						commit
						4e97ab44ac
					
				@ -36,7 +36,7 @@ export class BisqAddressComponent implements OnInit, OnDestroy {
 | 
			
		||||
          this.transactions = null;
 | 
			
		||||
          document.body.scrollTo(0, 0);
 | 
			
		||||
          this.addressString = params.get('id') || '';
 | 
			
		||||
          this.seoService.setTitle('Address: ' + this.addressString, true);
 | 
			
		||||
          this.seoService.setTitle('Address: ' + this.addressString);
 | 
			
		||||
 | 
			
		||||
          return this.bisqApiService.getAddress$(this.addressString)
 | 
			
		||||
            .pipe(
 | 
			
		||||
 | 
			
		||||
@ -82,7 +82,7 @@ export class BisqBlockComponent implements OnInit, OnDestroy {
 | 
			
		||||
        }
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
        this.blockHeight = block.height;
 | 
			
		||||
        this.seoService.setTitle('Block: #' + block.height + ': ' + block.hash, true);
 | 
			
		||||
        this.seoService.setTitle('Block: #' + block.height + ': ' + block.hash);
 | 
			
		||||
        this.block = block;
 | 
			
		||||
      });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -33,7 +33,7 @@ export class BisqBlocksComponent implements OnInit {
 | 
			
		||||
  ) { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.seoService.setTitle('Blocks', true);
 | 
			
		||||
    this.seoService.setTitle('Blocks');
 | 
			
		||||
    this.itemsPerPage = Math.max(Math.round(this.contentSpace / this.fiveItemsPxSize) * 5, 10);
 | 
			
		||||
    this.loadingItems = Array(this.itemsPerPage);
 | 
			
		||||
    if (document.body.clientWidth < 768) {
 | 
			
		||||
 | 
			
		||||
@ -21,7 +21,7 @@ export class BisqStatsComponent implements OnInit {
 | 
			
		||||
  ) { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
    this.seoService.setTitle('BSQ Statistics', false);
 | 
			
		||||
    this.seoService.setTitle('BSQ Statistics');
 | 
			
		||||
 | 
			
		||||
    this.stateService.bsqPrice$
 | 
			
		||||
      .subscribe((bsqPrice) => {
 | 
			
		||||
 | 
			
		||||
@ -43,7 +43,7 @@ export class BisqTransactionComponent implements OnInit, OnDestroy {
 | 
			
		||||
        this.error = null;
 | 
			
		||||
        document.body.scrollTo(0, 0);
 | 
			
		||||
        this.txId = params.get('id') || '';
 | 
			
		||||
        this.seoService.setTitle('Transaction: ' + this.txId, true);
 | 
			
		||||
        this.seoService.setTitle('Transaction: ' + this.txId);
 | 
			
		||||
        if (history.state.data) {
 | 
			
		||||
          return of(history.state.data);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -72,7 +72,7 @@ export class BisqTransactionsComponent implements OnInit {
 | 
			
		||||
  ) { }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.seoService.setTitle('Transactions', true);
 | 
			
		||||
    this.seoService.setTitle('Transactions');
 | 
			
		||||
 | 
			
		||||
    this.radioGroupForm = this.formBuilder.group({
 | 
			
		||||
      txTypes: [this.txTypesDefaultChecked],
 | 
			
		||||
 | 
			
		||||
@ -61,7 +61,7 @@ export class AddressComponent implements OnInit, OnDestroy {
 | 
			
		||||
          this.transactions = null;
 | 
			
		||||
          document.body.scrollTo(0, 0);
 | 
			
		||||
          this.addressString = params.get('id') || '';
 | 
			
		||||
          this.seoService.setTitle('Address: ' + this.addressString, true);
 | 
			
		||||
          this.seoService.setTitle('Address: ' + this.addressString);
 | 
			
		||||
 | 
			
		||||
          return merge(
 | 
			
		||||
            of(true),
 | 
			
		||||
 | 
			
		||||
@ -68,7 +68,7 @@ export class AssetComponent implements OnInit, OnDestroy {
 | 
			
		||||
          this.transactions = null;
 | 
			
		||||
          document.body.scrollTo(0, 0);
 | 
			
		||||
          this.assetString = params.get('id') || '';
 | 
			
		||||
          this.seoService.setTitle('Asset: ' + this.assetString, true);
 | 
			
		||||
          this.seoService.setTitle('Asset: ' + this.assetString);
 | 
			
		||||
 | 
			
		||||
          return merge(
 | 
			
		||||
            of(true),
 | 
			
		||||
 | 
			
		||||
@ -92,7 +92,7 @@ export class BlockComponent implements OnInit, OnDestroy {
 | 
			
		||||
      tap((block: Block) => {
 | 
			
		||||
        this.block = block;
 | 
			
		||||
        this.blockHeight = block.height;
 | 
			
		||||
        this.seoService.setTitle('Block: #' + block.height + ': ' + block.id, true);
 | 
			
		||||
        this.seoService.setTitle('Block: #' + block.height + ': ' + block.id);
 | 
			
		||||
        this.isLoadingBlock = false;
 | 
			
		||||
        if (block.coinbaseTx) {
 | 
			
		||||
          this.coinbaseTx = block.coinbaseTx;
 | 
			
		||||
 | 
			
		||||
@ -44,7 +44,7 @@ export class TransactionComponent implements OnInit, OnDestroy {
 | 
			
		||||
    this.subscription = this.route.paramMap.pipe(
 | 
			
		||||
      switchMap((params: ParamMap) => {
 | 
			
		||||
        this.txId = params.get('id') || '';
 | 
			
		||||
        this.seoService.setTitle('Transaction: ' + this.txId, true);
 | 
			
		||||
        this.seoService.setTitle('Transaction: ' + this.txId);
 | 
			
		||||
        this.resetTransaction();
 | 
			
		||||
        return merge(
 | 
			
		||||
          of(true),
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,6 @@ import { StateService } from './state.service';
 | 
			
		||||
})
 | 
			
		||||
export class SeoService {
 | 
			
		||||
  network = '';
 | 
			
		||||
  defaultTitle = 'mempool - Bitcoin Explorer';
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    private titleService: Title,
 | 
			
		||||
@ -16,15 +15,19 @@ export class SeoService {
 | 
			
		||||
    this.stateService.networkChanged$.subscribe((network) => this.network = network);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  setTitle(newTitle: string, prependNetwork = false) {
 | 
			
		||||
    let networkName = '';
 | 
			
		||||
    if (prependNetwork && this.network !== '') {
 | 
			
		||||
      networkName = this.network.substr(0, 1).toUpperCase() + this.network.substr(1) + ' ';
 | 
			
		||||
    }
 | 
			
		||||
    this.titleService.setTitle(networkName + newTitle + ' - ' + this.defaultTitle);
 | 
			
		||||
  setTitle(newTitle: string): void {
 | 
			
		||||
    this.titleService.setTitle(newTitle + ' - ' + this.getTitle());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  resetTitle() {
 | 
			
		||||
    this.titleService.setTitle(this.defaultTitle);
 | 
			
		||||
  resetTitle(): void {
 | 
			
		||||
    this.titleService.setTitle(this.getTitle());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getTitle(): string {
 | 
			
		||||
    return 'mempool - ' + (this.network ? this.ucfirst(this.network) : 'Bitcoin') + ' Explorer';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ucfirst(str: string) {
 | 
			
		||||
    return str.charAt(0).toUpperCase() + str.slice(1);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user