-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/segwit-psbt' into 'develop'
Feat/segwit psbt See merge request papers/airgap/airgap-vault!257
- Loading branch information
Showing
14 changed files
with
334 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/app/components/transaction-warning/transaction-warning.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<ion-row *ngIf="warnings && warnings.length > 0" class="ion-align-items-center ion-padding-top"> | ||
<ion-col *ngFor="let warning of warnings" size="12"> | ||
<ion-item lines="none" [detail]="false" class="ion-margin-vertical" [color]="warning.color"> | ||
<ion-icon *ngIf="warning.icon" [name]="warning.icon" slot="start" color="dark"></ion-icon> | ||
<ion-label color="dark" class="ion-text-wrap"> | ||
<h3> | ||
<strong>{{ warning.title | translate }}</strong> | ||
</h3> | ||
<p>{{ warning.description | translate }}</p> | ||
<!-- <div *ngIf="warning.actions"> | ||
<ion-button color="light" *ngFor="let action of warning.actions" (click)="doAction(action)"> | ||
{{ action.text | translate }} | ||
</ion-button> | ||
</div> --> | ||
</ion-label> | ||
</ion-item> | ||
</ion-col> | ||
</ion-row> |
Empty file.
26 changes: 26 additions & 0 deletions
26
src/app/components/transaction-warning/transaction-warning.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing' | ||
import { IonicModule } from '@ionic/angular' | ||
|
||
import { TransactionWarningComponent } from './transaction-warning.component' | ||
|
||
describe('TransactionWarningComponent', () => { | ||
let component: TransactionWarningComponent | ||
let fixture: ComponentFixture<TransactionWarningComponent> | ||
|
||
beforeEach( | ||
waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [TransactionWarningComponent], | ||
imports: [IonicModule.forRoot()] | ||
}).compileComponents() | ||
|
||
fixture = TestBed.createComponent(TransactionWarningComponent) | ||
component = fixture.componentInstance | ||
fixture.detectChanges() | ||
}) | ||
) | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy() | ||
}) | ||
}) |
58 changes: 58 additions & 0 deletions
58
src/app/components/transaction-warning/transaction-warning.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { IAirGapTransaction } from '@airgap/coinlib-core' | ||
import { AirGapTransactionWarning, AirGapTransactionWarningType } from '@airgap/coinlib-core/interfaces/IAirGapTransaction' | ||
import { Component, Input } from '@angular/core' | ||
|
||
@Component({ | ||
selector: 'airgap-transaction-warning', | ||
templateUrl: './transaction-warning.component.html', | ||
styleUrls: ['./transaction-warning.component.scss'] | ||
}) | ||
export class TransactionWarningComponent { | ||
@Input() | ||
public set transaction(value: IAirGapTransaction | undefined) { | ||
this._transaction = value | ||
if (value) { | ||
this.warnings = value.warnings.map((warning) => { | ||
return { | ||
...warning, | ||
color: | ||
warning.type === AirGapTransactionWarningType.SUCCESS | ||
? 'success' | ||
: warning.type === AirGapTransactionWarningType.NOTE | ||
? 'light' | ||
: warning.type === AirGapTransactionWarningType.WARNING | ||
? 'warning' | ||
: warning.type === AirGapTransactionWarningType.ERROR | ||
? 'danger' | ||
: 'primary', | ||
icon: warning.icon | ||
? warning.icon | ||
: warning.type === AirGapTransactionWarningType.SUCCESS | ||
? 'checkmark-circle-outline' | ||
: warning.type === AirGapTransactionWarningType.NOTE | ||
? 'information-circle-outline' | ||
: warning.type === AirGapTransactionWarningType.WARNING | ||
? 'warning' | ||
: warning.type === AirGapTransactionWarningType.ERROR | ||
? 'warning' | ||
: 'warning' | ||
} | ||
}) | ||
} | ||
} | ||
|
||
public get transaction(): IAirGapTransaction | undefined { | ||
return this._transaction | ||
} | ||
|
||
public _transaction: IAirGapTransaction | undefined | ||
|
||
public warnings: (AirGapTransactionWarning & { color: string })[] | undefined | ||
|
||
constructor() {} | ||
|
||
// doAction(warning: AirGapTransactionWarning) { | ||
// // TODO: Use link page | ||
// console.log(warning) | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.