- Switched the arrow colors for spent/unspent utxos
- Collapse dropdown on search (mobile)
This commit is contained in:
parent
e02924e8dd
commit
9025d4dd54
@ -25,7 +25,7 @@
|
|||||||
<a class="nav-link" routerLink="/contributors" (click)="collapse()">Contributors</a>
|
<a class="nav-link" routerLink="/contributors" (click)="collapse()">Contributors</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<app-search-form location="top"></app-search-form>
|
<app-search-form location="top" (searchTriggered)="collapse()"></app-search-form>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit, Input, ChangeDetectionStrategy } from '@angular/core';
|
import { Component, OnInit, ChangeDetectionStrategy, EventEmitter, Output } from '@angular/core';
|
||||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
@ -10,6 +10,7 @@ import { Router } from '@angular/router';
|
|||||||
})
|
})
|
||||||
export class SearchFormComponent implements OnInit {
|
export class SearchFormComponent implements OnInit {
|
||||||
searchForm: FormGroup;
|
searchForm: FormGroup;
|
||||||
|
@Output() searchTriggered = new EventEmitter();
|
||||||
|
|
||||||
regexAddress = /^([a-km-zA-HJ-NP-Z1-9]{26,35}|[a-km-zA-HJ-NP-Z1-9]{80}|[a-z]{2,5}1[ac-hj-np-z02-9]{8,87})$/;
|
regexAddress = /^([a-km-zA-HJ-NP-Z1-9]{26,35}|[a-km-zA-HJ-NP-Z1-9]{80}|[a-z]{2,5}1[ac-hj-np-z02-9]{8,87})$/;
|
||||||
regexBlockhash = /^[0]{8}[a-fA-F0-9]{56}$/;
|
regexBlockhash = /^[0]{8}[a-fA-F0-9]{56}$/;
|
||||||
@ -31,10 +32,13 @@ export class SearchFormComponent implements OnInit {
|
|||||||
if (searchText) {
|
if (searchText) {
|
||||||
if (this.regexAddress.test(searchText)) {
|
if (this.regexAddress.test(searchText)) {
|
||||||
this.router.navigate(['/address/', searchText]);
|
this.router.navigate(['/address/', searchText]);
|
||||||
|
this.searchTriggered.emit();
|
||||||
} else if (this.regexBlockhash.test(searchText)) {
|
} else if (this.regexBlockhash.test(searchText)) {
|
||||||
this.router.navigate(['/block/', searchText]);
|
this.router.navigate(['/block/', searchText]);
|
||||||
|
this.searchTriggered.emit();
|
||||||
} else if (this.regexTransaction.test(searchText)) {
|
} else if (this.regexTransaction.test(searchText)) {
|
||||||
this.router.navigate(['/tx/', searchText]);
|
this.router.navigate(['/tx/', searchText]);
|
||||||
|
this.searchTriggered.emit();
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template #hasPrevout>
|
<ng-template #hasPrevout>
|
||||||
<a [routerLink]="['/tx/', vin.txid]">
|
<a [routerLink]="['/tx/', vin.txid]">
|
||||||
<i class="arrow green"></i>
|
<i class="arrow red"></i>
|
||||||
</a>
|
</a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</td>
|
</td>
|
||||||
@ -75,9 +75,9 @@
|
|||||||
<td class="pl-1 arrow-td">
|
<td class="pl-1 arrow-td">
|
||||||
<i *ngIf="!outspends[i]; else outspend" class="arrow grey"></i>
|
<i *ngIf="!outspends[i]; else outspend" class="arrow grey"></i>
|
||||||
<ng-template #outspend>
|
<ng-template #outspend>
|
||||||
<i *ngIf="!outspends[i][vindex] || !outspends[i][vindex].spent; else spent" class="arrow red"></i>
|
<i *ngIf="!outspends[i][vindex] || !outspends[i][vindex].spent; else spent" class="arrow green"></i>
|
||||||
<ng-template #spent>
|
<ng-template #spent>
|
||||||
<a [routerLink]="['/tx/', outspends[i][vindex].txid]"><i class="arrow green"></i></a>
|
<a [routerLink]="['/tx/', outspends[i][vindex].txid]"><i class="arrow red"></i></a>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user