Commit 55bf8c24 authored by Pieterjan Vanhoof's avatar Pieterjan Vanhoof Committed by GitHub

Merge pull request #156 from stratisproject/ui

Add context menu, add logout confirmation
parents f7e763d8 cd4b1d46
...@@ -19,6 +19,10 @@ if (serve) { ...@@ -19,6 +19,10 @@ if (serve) {
}); });
} }
require('electron-context-menu')({
showInspectElement: serve
});
// Keep a global reference of the window object, if you don't, the window will // Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected. // be closed automatically when the JavaScript object is garbage collected.
let mainWindow = null; let mainWindow = null;
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.27", "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.27",
"angular2-material-datepicker": "^0.5.0", "angular2-material-datepicker": "^0.5.0",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"electron-context-menu": "^0.9.1",
"ngx-clipboard": "^8.0.3", "ngx-clipboard": "^8.0.3",
"rxjs": "5.4.1", "rxjs": "5.4.1",
"zone.js": "^0.8.12" "zone.js": "^0.8.12"
......
...@@ -19,6 +19,7 @@ import { GlobalService } from './shared/services/global.service'; ...@@ -19,6 +19,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'; import { TransactionDetailsComponent } from './wallet/transaction-details/transaction-details.component';
import { LogoutConfirmationComponent } from './wallet/logout-confirmation/logout-confirmation.component';
@NgModule({ @NgModule({
...@@ -36,6 +37,7 @@ import { TransactionDetailsComponent } from './wallet/transaction-details/transa ...@@ -36,6 +37,7 @@ import { TransactionDetailsComponent } from './wallet/transaction-details/transa
declarations: [ declarations: [
AppComponent, AppComponent,
LoginComponent, LoginComponent,
LogoutConfirmationComponent,
SendComponent, SendComponent,
ReceiveComponent, ReceiveComponent,
TransactionDetailsComponent TransactionDetailsComponent
...@@ -43,7 +45,8 @@ import { TransactionDetailsComponent } from './wallet/transaction-details/transa ...@@ -43,7 +45,8 @@ import { TransactionDetailsComponent } from './wallet/transaction-details/transa
entryComponents: [ entryComponents: [
SendComponent, SendComponent,
ReceiveComponent, ReceiveComponent,
TransactionDetailsComponent TransactionDetailsComponent,
LogoutConfirmationComponent
], ],
providers: [ ApiService, GlobalService ], providers: [ ApiService, GlobalService ],
bootstrap: [ AppComponent ] bootstrap: [ AppComponent ]
......
<div id="modalLogout" tabindex="-1" role="dialog" aria-labelledby="modal_logout" aria-hidden="true">
<div class="modal-dialog" role="document">
<div>
<div class="modal-header">
<div class="bubble"><i class="icon-download"></i></div>
</div>
<div class="modal-body">
<h5 class="modal-title text-uppercase" id="modalReceive">Logout</h5>
<form>
<div class="form-group clearfix">
<label class="float-left">Are you sure you want to logout?</label>
</div>
<div>
<button type="button" class="btn btn-lg btn-primary float-left" data-dismiss="modal" aria-label="Logout" (click)="onLogout()">Yes</button>
<button type="button" class="btn btn-lg btn-primary float-right" data-dismiss="modal" aria-label="Close" (click)="activeModal.close('Close click')">Cancel</button>
</div>
<br>
</form>
</div>
<div class="modal-footer">
<p></p>
</div>
</div>
</div>
</div>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LogoutConfirmationComponent } from './logout-confirmation.component';
describe('LogoutConfirmationComponent', () => {
let component: LogoutConfirmationComponent;
let fixture: ComponentFixture<LogoutConfirmationComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LogoutConfirmationComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LogoutConfirmationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import {NgbModal, NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-logout-confirmation',
templateUrl: './logout-confirmation.component.html',
styleUrls: ['./logout-confirmation.component.css']
})
export class LogoutConfirmationComponent implements OnInit {
constructor(private activeModal: NgbActiveModal, private router: Router) { }
ngOnInit() {
}
private onLogout() {
this.activeModal.close();
this.router.navigate(['/login']);
}
}
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { LogoutConfirmationComponent } from '../logout-confirmation/logout-confirmation.component';
@Component({ @Component({
selector: 'app-menu', selector: 'app-menu',
...@@ -7,9 +10,9 @@ import { Router } from '@angular/router'; ...@@ -7,9 +10,9 @@ import { Router } from '@angular/router';
styleUrls: ['./menu.component.css'], styleUrls: ['./menu.component.css'],
}) })
export class MenuComponent { export class MenuComponent {
constructor(private router: Router) {} constructor(private modalService: NgbModal) {}
private logOut() { private logOut() {
this.router.navigate(['/login']); const modalRef = this.modalService.open(LogoutConfirmationComponent);
} }
} }
...@@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core'; ...@@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core';
@Component({ @Component({
selector: 'sidebar', selector: 'sidebar',
templateUrl: './sidebar.component.html', templateUrl: './sidebar.component.html',
styleUrls: ['./sidebar.component.scss'] styleUrls: ['./sidebar.component.css']
}) })
export class SidebarComponent implements OnInit { export class SidebarComponent implements OnInit {
......
...@@ -10,7 +10,7 @@ import { Subscription } from 'rxjs/Subscription'; ...@@ -10,7 +10,7 @@ import { Subscription } from 'rxjs/Subscription';
@Component({ @Component({
selector: 'status-bar', selector: 'status-bar',
templateUrl: './status-bar.component.html', templateUrl: './status-bar.component.html',
styleUrls: ['./status-bar.component.scss'] styleUrls: ['./status-bar.component.css']
}) })
export class StatusBarComponent implements OnInit { export class StatusBarComponent implements OnInit {
......
...@@ -5,7 +5,7 @@ import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; ...@@ -5,7 +5,7 @@ import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
@Component({ @Component({
selector: 'transaction-details', selector: 'transaction-details',
templateUrl: './transaction-details.component.html', templateUrl: './transaction-details.component.html',
styleUrls: ['./transaction-details.component.scss'] styleUrls: ['./transaction-details.component.css']
}) })
export class TransactionDetailsComponent implements OnInit { export class TransactionDetailsComponent implements OnInit {
......
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