Allow CTRL F an address on the transaction list component
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({ name: 'capAddress' })
|
||||
export class CapAddressPipe implements PipeTransform {
|
||||
transform(str: string, cap: number, leftover: number) {
|
||||
if (!str) { return; }
|
||||
if (str.length <= cap) {
|
||||
return str;
|
||||
}
|
||||
return str.slice(-Math.max(cap - str.length, leftover));
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import { MempoolBlocksComponent } from '../components/mempool-blocks/mempool-blo
|
||||
import { BlockchainBlocksComponent } from '../components/blockchain-blocks/blockchain-blocks.component';
|
||||
import { AmountComponent } from '../components/amount/amount.component';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { CapAddressPipe } from './pipes/cap-address-pipe/cap-address-pipe';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@@ -51,6 +52,7 @@ import { RouterModule } from '@angular/router';
|
||||
WuBytesPipe,
|
||||
CeilPipe,
|
||||
ShortenStringPipe,
|
||||
CapAddressPipe,
|
||||
Decimal2HexPipe,
|
||||
FeeRoundingPipe,
|
||||
ColoredPriceDirective,
|
||||
@@ -103,6 +105,7 @@ import { RouterModule } from '@angular/router';
|
||||
WuBytesPipe,
|
||||
CeilPipe,
|
||||
ShortenStringPipe,
|
||||
CapAddressPipe,
|
||||
Decimal2HexPipe,
|
||||
FeeRoundingPipe,
|
||||
ColoredPriceDirective,
|
||||
|
||||
Reference in New Issue
Block a user