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