Commit 402229bd authored by dev0tion's avatar dev0tion

Add transaction details component

parent ace1d9cb
...@@ -18,6 +18,7 @@ import { GlobalService } from './shared/services/global.service'; ...@@ -18,6 +18,7 @@ import { GlobalService } from './shared/services/global.service';
import { SendComponent } from './wallet/send/send.component'; import { SendComponent } from './wallet/send/send.component';
import { ReceiveComponent } from './wallet/receive/receive.component'; import { ReceiveComponent } from './wallet/receive/receive.component';
import { TransactionDetailsComponent } from './wallet/transaction-details/transaction-details.component';
@NgModule({ @NgModule({
...@@ -36,11 +37,13 @@ import { ReceiveComponent } from './wallet/receive/receive.component'; ...@@ -36,11 +37,13 @@ import { ReceiveComponent } from './wallet/receive/receive.component';
AppComponent, AppComponent,
LoginComponent, LoginComponent,
SendComponent, SendComponent,
ReceiveComponent ReceiveComponent,
TransactionDetailsComponent
], ],
entryComponents: [ entryComponents: [
SendComponent, SendComponent,
ReceiveComponent ReceiveComponent,
TransactionDetailsComponent
], ],
providers: [ ApiService, GlobalService ], providers: [ ApiService, GlobalService ],
bootstrap: [ AppComponent ] bootstrap: [ AppComponent ]
......
<div id="modalDetail" tabindex="-1" role="dialog" aria-labelledby="modal_detail" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="bubble"><i class="icon-settings"></i></div>
</div>
<div class="modal-body">
<h5 class="modal-title text-uppercase" id="modalDetail">Transaction Details</h5>
<ul class="list-inline row">
<li class="list-inline-item col blockLabel">Type</li>
<li class="list-inline-item col-9 blockText">{{ transaction.type }}</li>
</ul>
<ul class="list-inline row">
<li class="list-inline-item col blockLabel">Amount</li>
<li class="list-inline-item col-9 blockText"><strong class="text-success">{{transaction.amount | coinNotation }}</strong></li>
</ul>
<!--<ul class="list-inline row">
<li class="list-inline-item col blockLabel">From</li>
<li class="list-inline-item col-9 blockText"><code>n4kVJQarwwdmsXDdgNnJHgBSpZ8MhSkNBx</code></li>
</ul>-->
<ul class="list-inline row">
<li class="list-inline-item col blockLabel">Date</li>
<li class="list-inline-item col-9 blockText"><small>{{ transaction.timestamp * 1000 | date:'medium' }}</small></li>
</ul>
<ul class="list-inline row">
<li class="list-inline-item col blockLabel">Block</li>
<li class="list-inline-item col-9 blockText">#{{ transaction.confirmedInBlock }}</li>
</ul>
<ul class="list-inline row">
<li class="list-inline-item col blockLabel">Transaction ID</li>
<li class="list-inline-item col-9 blockText blockID"><code>{{ transaction.id }}</code></li>
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-lg btn-primary" data-dismiss="modal" aria-label="Close" (click)="activeModal.close('Close click')">OK</button>
</div>
</div>
</div>
</div>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TransactionDetailsComponent } from './transaction-details.component';
describe('TransactionDetailsComponent', () => {
let component: TransactionDetailsComponent;
let fixture: ComponentFixture<TransactionDetailsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TransactionDetailsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TransactionDetailsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});
import { Component, Input, OnInit } from '@angular/core';
import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'transaction-details',
templateUrl: './transaction-details.component.html',
styleUrls: ['./transaction-details.component.scss']
})
export class TransactionDetailsComponent implements OnInit {
@Input() transaction;
constructor(public activeModal: NgbActiveModal) {
}
ngOnInit() {
}
}
...@@ -11,6 +11,7 @@ import {SharedModule} from '../shared/shared.module'; ...@@ -11,6 +11,7 @@ import {SharedModule} from '../shared/shared.module';
import { WalletRoutingModule } from './wallet-routing.module'; import { WalletRoutingModule } from './wallet-routing.module';
import { SidebarComponent } from './sidebar/sidebar.component'; import { SidebarComponent } from './sidebar/sidebar.component';
import { StatusBarComponent } from './status-bar/status-bar.component'; import { StatusBarComponent } from './status-bar/status-bar.component';
import { TransactionDetailsComponent } from './transaction-details/transaction-details.component';
@NgModule({ @NgModule({
imports: [ imports: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment