Commit 25a84858 authored by Pieterjan Vanhoof's avatar Pieterjan Vanhoof Committed by GitHub

Merge pull request #327 from stratisproject/ui

Various fixes
parents f57f8005 2a53a909
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
const app = electron.app; const app = electron.app;
// Module to create native browser window. // Module to create native browser window.
const BrowserWindow = electron.BrowserWindow; const BrowserWindow = electron.BrowserWindow;
const nativeImage = require('electron').nativeImage
const path = require('path'); const path = require('path');
const url = require('url'); const url = require('url');
...@@ -28,6 +29,12 @@ require('electron-context-menu')({ ...@@ -28,6 +29,12 @@ require('electron-context-menu')({
let mainWindow = null; let mainWindow = null;
function createWindow() { function createWindow() {
let applicationIcon
if (serve) {
applicationIcon = nativeImage.createFromPath("./src/assets/images/breeze-logo.png")
} else {
applicationIcon = nativeImage.createFromPath(path.join(__dirname + '/assets/images/breeze-logo.png'))
}
// Create the browser window. // Create the browser window.
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
...@@ -36,10 +43,13 @@ function createWindow() { ...@@ -36,10 +43,13 @@ function createWindow() {
frame: true, frame: true,
minWidth: 1200, minWidth: 1200,
minHeight: 650, minHeight: 650,
icon: __dirname + "/assets/images/breeze-logo.png",
title: "Breeze Wallet" title: "Breeze Wallet"
}); });
if (os.platform() === "win32"){
mainWindow.setIcon(applicationIcon);
}
// and load the index.html of the app. // and load the index.html of the app.
mainWindow.loadURL(url.format({ mainWindow.loadURL(url.format({
pathname: path.join(__dirname, '/index.html'), pathname: path.join(__dirname, '/index.html'),
...@@ -82,7 +92,7 @@ app.on('ready', function () { ...@@ -82,7 +92,7 @@ app.on('ready', function () {
} }
}); });
app.on('will-quit', function () { app.on('before-quit', function () {
closeBitcoinApi(), closeBitcoinApi(),
closeStratisApi(); closeStratisApi();
}); });
...@@ -181,36 +191,42 @@ function createTray() { ...@@ -181,36 +191,42 @@ function createTray() {
const Menu = electron.Menu; const Menu = electron.Menu;
const Tray = electron.Tray; const Tray = electron.Tray;
let appIcon = null; let trayIcon;
var iconPath
if (os.platform() === 'win32') {
if (serve) {
iconPath = '.\\src\\assets\\images\\breeze-logo-tray.ico';
} else {
iconPath = path.join(__dirname + '\\assets\\images\\breeze-logo-tray.png');
}
} else {
if (serve) { if (serve) {
iconPath = './src/assets/images/breeze-logo-tray.png'; trayIcon = nativeImage.createFromPath('./src/assets/images/breeze-logo-tray.png');
} else { } else {
iconPath = path.join(__dirname + '//assets//images//breeze-logo-tray.png'); trayIcon = nativeImage.createFromPath(path.join(__dirname + '/assets/images/breeze-logo-tray.png'));
} }
}
appIcon = new Tray(iconPath); let systemTray = new Tray(trayIcon);
const contextMenu = Menu.buildFromTemplate([{ const contextMenu = Menu.buildFromTemplate([
{
label: 'Hide/Show', label: 'Hide/Show',
click: function () { click: function() {
mainWindow.isVisible() ? mainWindow.hide() : mainWindow.show(); mainWindow.isVisible() ? mainWindow.hide() : mainWindow.show();
} }
}]); },
appIcon.setToolTip('Breeze Wallet'); {
appIcon.setContextMenu(contextMenu); label: 'Exit',
click: function() {
app.quit();
}
}
]);
systemTray.setToolTip('Breeze Wallet');
systemTray.setContextMenu(contextMenu);
systemTray.on('click', function() {
if (!mainWindow.isVisible()) {
mainWindow.show();
}
if (!mainWindow.isFocused()) {
mainWindow.focus();
}
});
app.on('window-all-closed', function () { app.on('window-all-closed', function () {
if (appIcon) appIcon.destroy(); if (systemTray) systemTray.destroy();
}); });
}; };
......
...@@ -14,7 +14,7 @@ const path = argv.path || 'app-builds'; ...@@ -14,7 +14,7 @@ const path = argv.path || 'app-builds';
const DEFAULT_OPTS = { const DEFAULT_OPTS = {
dir: './dist', dir: './dist',
name: appName, name: "Breeze",
asar: shouldUseAsar, asar: shouldUseAsar,
buildVersion: buildVersion buildVersion: buildVersion
}; };
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
"description": "Graphical User Interface for Breeze Wallet.", "description": "Graphical User Interface for Breeze Wallet.",
"version": "0.2.0", "version": "0.2.0",
"author": { "author": {
"name": "Pieterjan Vanhoof", "name": "Stratis Group",
"email": "pieterjan.vanhoof@stratisplatform.com" "email": "info@stratisplatform.com"
}, },
"license": "MIT", "license": "MIT",
"homepage": "https://github.com/stratisproject/breeze", "homepage": "https://github.com/stratisproject/breeze",
......
...@@ -174,7 +174,7 @@ export class CreateComponent implements OnInit { ...@@ -174,7 +174,7 @@ export class CreateComponent implements OnInit {
.subscribe( .subscribe(
response => { response => {
if (response.status >= 200 && response.status < 400){ if (response.status >= 200 && response.status < 400){
let walletBody = "Your wallet has been created.<br><br>Please write down your 12 word passphrase: <br>" + this.mnemonic + "<br><br>You can recover your wallet on any computer with:<br>- your passphrase AND<br>- your password AND<br>- the wallet creation time<br><br>Unlike most other wallets if an attacker acquires your passphrase, it will not be able to hack your wallet without knowing your password. On the contrary, unlike other wallets, you will not be able to recover your wallet only with your passphrase if you lose your password."; let walletBody = "Your wallet has been created.<br><br>Please write down your 12 word passphrase: <br>" + this.mnemonic + "<br><br>You can recover your wallet on any computer with:<br>- your passphrase<br>- your password<br>- In addition, knowing the approximate date at which you created your wallet will speed up recovery.<br><br>Unlike most other wallets if an attacker acquires your passphrase, he will not be able to hack your wallet without knowing your password. On the contrary, unlike other wallets, you will not be able to recover your wallet only with your passphrase if you lose your password.";
this.genericModalService.openModal("Wallet Info", walletBody); this.genericModalService.openModal("Wallet Info", walletBody);
this.router.navigate(['']); this.router.navigate(['']);
} }
......
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
<div class="modal-body"> <div class="modal-body">
<svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52"><circle class="checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/></svg> <svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52"><circle class="checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/></svg>
<p class="lead text-success text-center"> <p class="lead text-success text-center">
<strong>Your transaction has been sent with success !</strong> <strong>Your transaction has completed successfully!</strong>
</p> </p>
<small class="text-center d-block"> <!-- <small class="text-center d-block">
<a class="btn btn-link" (click)="toggleDetails()">Show details</a> <a class="btn btn-link" (click)="toggleDetails()">Show details</a>
</small> </small>
<div *ngIf="showDetails" id="collapseExample"> <div *ngIf="showDetails" id="collapseExample"> -->
<div>
<div class="card card-block"> <div class="card card-block">
<ul class="list-inline row"> <ul class="list-inline row">
<li class="list-inline-item col blockLabel">Type</li> <li class="list-inline-item col blockLabel">Type</li>
......
...@@ -40,6 +40,7 @@ export class SendComponent implements OnInit { ...@@ -40,6 +40,7 @@ export class SendComponent implements OnInit {
this.sendForm = this.fb.group({ this.sendForm = this.fb.group({
"address": ["", Validators.required], "address": ["", Validators.required],
"amount": ["", Validators.compose([Validators.required, Validators.pattern(/^[0-9]+(\.[0-9]{0,8})?$/)])], "amount": ["", Validators.compose([Validators.required, Validators.pattern(/^[0-9]+(\.[0-9]{0,8})?$/)])],
//"amount": ["", Validators.compose([Validators.required, Validators.pattern(/^([0-9]+)?(\.[0-9]{0,8})?$/)])],
"fee": ["medium", Validators.required], "fee": ["medium", Validators.required],
"password": ["", Validators.required] "password": ["", Validators.required]
}); });
...@@ -206,5 +207,6 @@ export class SendComponent implements OnInit { ...@@ -206,5 +207,6 @@ export class SendComponent implements OnInit {
private openConfirmationModal() { private openConfirmationModal() {
const modalRef = this.modalService.open(SendConfirmationComponent); const modalRef = this.modalService.open(SendConfirmationComponent);
modalRef.componentInstance.transaction = this.transaction; modalRef.componentInstance.transaction = this.transaction;
modalRef.componentInstance.transactionFee = this.estimatedFee;
} }
} }
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