Shorten address search with middle ellipsis

This commit is contained in:
softsimon
2022-02-27 18:53:16 +03:00
parent 5f19b6dd07
commit e5b2440b45
4 changed files with 15 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ import { debounceTime, distinctUntilChanged, switchMap, filter, catchError, map
import { ElectrsApiService } from 'src/app/services/electrs-api.service';
import { NgbTypeahead } from '@ng-bootstrap/ng-bootstrap';
import { RelativeUrlPipe } from 'src/app/shared/pipes/relative-url/relative-url.pipe';
import { ShortenStringPipe } from 'src/app/shared/pipes/shorten-string-pipe/shorten-string.pipe';
@Component({
selector: 'app-search-form',
@@ -33,6 +34,8 @@ export class SearchFormComponent implements OnInit {
focus$ = new Subject<string>();
click$ = new Subject<string>();
formatterFn = (address: string) => this.shortenStringPipe.transform(address, 40);
constructor(
private formBuilder: FormBuilder,
private router: Router,
@@ -40,6 +43,7 @@ export class SearchFormComponent implements OnInit {
private stateService: StateService,
private electrsApiService: ElectrsApiService,
private relativeUrlPipe: RelativeUrlPipe,
private shortenStringPipe: ShortenStringPipe,
) { }
ngOnInit() {