new send-tab

This commit is contained in:
Sebastiaan Pasma 2018-07-09 18:22:11 +02:00
commit 1ee95cf262
16 changed files with 907 additions and 17 deletions

View file

@ -0,0 +1,301 @@
'use strict';
angular.module('copayApp.controllers').controller('tabSendV2Controller', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService, configService, bitcoinCashJsService, $ionicNavBarDelegate, clipboardService) {
var clipboardHasAddress = false;
$scope.addContact = function() {
$state.go('tabs.settings').then(function() {
$state.go('tabs.addressbook').then(function() {
$state.go('tabs.addressbook.add');
});
});
};
$scope.pasteClipboard = function() {
clipboardService.readFromClipboard(function(text) {
$scope.formData.search = text;
$scope.findContact($scope.formData.search);
});
}
$scope.$on("$ionicView.enter", function(event, data) {
clipboardService.readFromClipboard(function(text) {
$scope.clipboardHasAddress = false;
if ((text.indexOf('bitcoincash:') === 0 || text[0] === 'C' || text[0] === 'H' || text[0] === 'p' || text[0] === 'q') && text.replace('bitcoincash:', '').length === 42) { // CashAddr
$scope.clipboardHasAddress = true;
} else if ((text[0] === "1" || text[0] === "3" || text.substring(0, 3) === "bc1") && text.length >= 26 && text.length <= 35) { // Legacy Addresses
$scope.clipboardHasAddress = true;
}
});
$ionicNavBarDelegate.showBar(true);
if (!$scope.hasWallets) {
$scope.checkingBalance = false;
return;
}
updateHasFunds();
updateWalletsList();
updateContactsList(function() {
updateList();
});
});
var originalList;
var CONTACTS_SHOW_LIMIT;
var currentContactsPage;
$scope.sectionDisplay = {
transferToWallet: false
};
var hasWallets = function() {
$scope.wallets = profileService.getWallets({
onlyComplete: true
});
$scope.hasWallets = lodash.isEmpty($scope.wallets) ? false : true;
};
// THIS is ONLY to show the 'buy bitcoins' message
// does not has any other function.
var updateHasFunds = function() {
if ($rootScope.everHasFunds) {
$scope.hasFunds = true;
return;
}
$scope.hasFunds = false;
var index = 0;
lodash.each($scope.wallets, function(w) {
walletService.getStatus(w, {}, function(err, status) {
++index;
if (err && !status) {
$log.error(err);
// error updating the wallet. Probably a network error, do not show
// the 'buy bitcoins' message.
$scope.hasFunds = true;
} else if (status.availableBalanceSat > 0) {
$scope.hasFunds = true;
$rootScope.everHasFunds = true;
}
if (index == $scope.wallets.length) {
$scope.checkingBalance = false;
$timeout(function() {
$scope.$apply();
});
}
});
});
};
var updateWalletsList = function() {
var config = configService.getSync();
var networkResult = lodash.countBy($scope.wallets, 'network');
$scope.showTransferCard = $scope.hasWallets && (networkResult.livenet > 1 || networkResult.testnet > 1);
if ($scope.showTransferCard) {
var walletsToTransfer = $scope.wallets;
if (!(networkResult.livenet > 1)) {
walletsToTransfer = lodash.filter(walletsToTransfer, function(item) {
return item.network == 'testnet';
});
}
if (!(networkResult.testnet > 1)) {
walletsToTransfer = lodash.filter(walletsToTransfer, function(item) {
return item.network == 'livenet';
});
}
var walletList = [];
lodash.each(walletsToTransfer, function(v) {
var displayBalanceAsFiat =
// BD got v.status as undefined here once during development, just
// after creating a new wallet.
v.status &&
v.status.alternativeBalanceAvailable &&
config.wallet.settings.priceDisplay === 'fiat';
walletList.push({
color: v.color,
name: v.name,
recipientType: 'wallet',
coin: v.coin,
network: v.network,
balanceString: displayBalanceAsFiat ?
v.status.totalBalanceAlternative + ' ' + v.status.alternativeIsoCode :
v.cachedBalance,
getAddress: function(cb) {
walletService.getAddress(v, false, cb);
},
});
});
originalList = originalList.concat(walletList);
}
}
var updateContactsList = function(cb) {
var config = configService.getSync();
var defaults = configService.getDefaults();
addressbookService.list(function(err, ab) {
if (err) $log.error(err);
$scope.hasContacts = lodash.isEmpty(ab) ? false : true;
if (!$scope.hasContacts) return cb();
var completeContacts = [];
lodash.each(ab, function(v, k) {
completeContacts.push({
name: lodash.isObject(v) ? v.name : v,
address: k,
email: lodash.isObject(v) ? v.email : null,
recipientType: 'contact',
coin: v.coin,
displayCoin: (v.coin == 'bch'
? (config.bitcoinCashAlias || defaults.bitcoinCashAlias)
: (config.bitcoinAlias || defaults.bitcoinAlias)).toUpperCase(),
getAddress: function(cb) {
return cb(null, k);
},
});
});
var contacts = completeContacts.slice(0, (currentContactsPage + 1) * CONTACTS_SHOW_LIMIT);
$scope.contactsShowMore = completeContacts.length > contacts.length;
originalList = originalList.concat(contacts);
return cb();
});
};
var updateList = function() {
$scope.list = lodash.clone(originalList);
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
}, 10);
};
$scope.openScanner = function() {
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
if (!isWindowsPhoneApp) {
$state.go('tabs.scan');
return;
}
scannerService.useOldScanner(function(err, contents) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err);
return;
}
incomingData.redir(contents);
});
};
$scope.showMore = function() {
currentContactsPage++;
updateWalletsList();
};
$scope.searchInFocus = function() {
$scope.searchFocus = true;
};
$scope.searchBlurred = function() {
if ($scope.formData.search == null || $scope.formData.search.length == 0) {
$scope.searchFocus = false;
}
};
$scope.findContact = function(search) {
if (incomingData.redir(search)) {
return;
}
if (!search || search.length < 2) {
$scope.list = originalList;
$timeout(function() {
$scope.$apply();
});
return;
}
var result = lodash.filter(originalList, function(item) {
var val = item.name;
return lodash.includes(val.toLowerCase(), search.toLowerCase());
});
$scope.list = result;
};
$scope.goToAmount = function(item) {
$timeout(function() {
item.getAddress(function(err, addr) {
if (err || !addr) {
//Error is already formated
return popupService.showAlert(err);
}
if (item.recipientType && item.recipientType == 'contact') {
if (addr.indexOf('bch') == 0 || addr.indexOf('btc') == 0) {
addr = addr.substring(3);
}
}
$log.debug('Got toAddress:' + addr + ' | ' + item.name);
return $state.transitionTo('tabs.send.amount', {
recipientType: item.recipientType,
displayAddress: item.coin == 'bch' ? bitcoinCashJsService.translateAddresses(addr).cashaddr : addr,
toAddress: addr,
toName: item.name,
toEmail: item.email,
toColor: item.color,
coin: item.coin
});
});
});
};
// This could probably be enhanced refactoring the routes abstract states
$scope.createWallet = function() {
$state.go('tabs.home').then(function() {
$state.go('tabs.add.create-personal');
});
};
$scope.buyBitcoin = function() {
$state.go('tabs.home').then(function() {
$state.go('tabs.buyandsell');
});
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.checkingBalance = true;
$scope.formData = {
search: null
};
originalList = [];
CONTACTS_SHOW_LIMIT = 10;
currentContactsPage = 0;
hasWallets();
});
});

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.directives') angular.module('copayApp.directives')
.directive('gravatar', function(md5) { .directive('gravatar', function(md5, $http) {
return { return {
restrict: 'AE', restrict: 'AE',
replace: true, replace: true,
@ -9,13 +9,24 @@ angular.module('copayApp.directives')
name: '@', name: '@',
height: '@', height: '@',
width: '@', width: '@',
email: '@' email: '@',
url: '@'
}, },
link: function(scope, el, attr) { link: function(scope, el, attr) {
if (typeof scope.email === "string") { if (typeof scope.email === "string") {
scope.emailHash = md5.createHash(scope.email.toLowerCase() || ''); scope.emailHash = md5.createHash(scope.email.toLowerCase() || '');
var req = {
method: 'GET',
url: 'https://secure.gravatar.com/'+scope.emailHash+'.json',
};
scope.url = 'img/contact-placeholder.svg';
$http(req).then(function (response) {
scope.url = 'https://secure.gravatar.com/avatar/'+scope.emailHash+'.jpg?s='+scope.width+'&d=mm';
}, function (error) {
scope.url = 'img/contact-placeholder.svg';
});
} }
}, },
template: '<img class="gravatar" alt="{{ name }}" height="{{ height }}" width="{{ width }}" src="https://secure.gravatar.com/avatar/{{ emailHash }}.jpg?s={{ width }}&d=mm">' template: '<img class="gravatar" alt="{{ name }}" height="{{ height }}" width="{{ width }}" src="{{ url }}">'
}; };
}); });

View file

@ -270,6 +270,15 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
} }
}) })
.state('tabs.send2', {
url: '/send2',
views: {
'tab-send': {
controller: 'tabSendV2Controller',
templateUrl: 'views/tab-send-v2.html',
}
}
})
.state('tabs.settings', { .state('tabs.settings', {
url: '/settings', url: '/settings',
views: { views: {

View file

@ -17,7 +17,27 @@ angular.module('copayApp.services').factory('clipboardService', function ($http,
// No supported // No supported
return; return;
} }
};
root.readFromClipboard = function (cb) {
$log.debug("Read from clipboard");
if (platformInfo.isCordova) {
cordova.plugins.clipboard.paste(function(text) {
cb(text);
})
} else if (platformInfo.isNW) {
cb(nodeWebkitService.readFromClipboard());
} else {
navigator.clipboard.readText()
.then(text => {
cb(text);
})
.catch(err => {
$log.debug("Clipboard reading is not supported in browser..");
});
return;
}
}; };
return root; return root;

View file

@ -16,6 +16,8 @@
&.button-primary, &.button-primary,
&.button-secondary, &.button-secondary,
&.button-light, &.button-light,
&.button-white,
&.button-green,
&.button-assertive { &.button-assertive {
&.button-standard { &.button-standard {
@extend %button-standard; @extend %button-standard;
@ -33,6 +35,10 @@
} }
} }
@mixin button-shadow() {
box-shadow: 0 2px 11px 0 #C1C1C1;;
}
.button { .button {
&.button-secondary { &.button-secondary {
@include button-style($v-button-secondary-bg, $v-button-secondary-border, $v-button-secondary-active-bg, $v-button-secondary-active-border, $v-button-secondary-color); @include button-style($v-button-secondary-bg, $v-button-secondary-border, $v-button-secondary-active-bg, $v-button-secondary-active-border, $v-button-secondary-color);
@ -47,7 +53,24 @@
} }
.button { .button {
border-radius: 6px;
&.button-full { &.button-full {
display: block; display: block;
} }
&-green {
@include button-style(#719561, #FFF, #606060, #FFF, #FFF);
@include button-clear(#FFF);
@include button-outline(#C1C1C1);
border: 0px;
@include button-shadow();
}
&-white {
@include button-style(#FFF, #C1C1C1, #C1C1C1, #FFF, #606060);
@include button-clear(#FFF);
@include button-outline(#C1C1C1);
@include button-shadow();
&.activated {
color: #FFF;
}
}
} }

View file

@ -124,7 +124,6 @@
position: relative; position: relative;
height: 70px; height: 70px;
border-color: $royal; border-color: $royal;
background-color: $royal;
padding-top: 20px; padding-top: 20px;
margin-bottom: 50px; margin-bottom: 50px;
text-align: center; text-align: center;

View file

@ -0,0 +1,228 @@
#tab-send2 {
@extend .deflash-blue;
.input {
width: 100%;
input {
width: 100%;
height: 57px;
background: #FFF;
border: 1px #D9D9D9 solid;
&::placeholder {
color: #DCDCDC;
}
}
i {
&.left {
padding-left: 15px;
}
&.qr {
cursor: pointer;
cursor: hand;
padding-right: 5px;
}
}
}
.send-wrapper {
&:after {
display: block;
position: relative;
height: 1px;
background: #DEDEDE;
bottom: 0;
content: '';
margin: 20px 6px 0px;
}
margin: 18px 0 0;
padding: 9px;
background-color: #f2f2f2;
border-radius: 3px;
border: none;
&.focus {
.search-input {
padding-left: 30px;
&:focus::-webkit-input-placeholder {
opacity: 0;
}
}
}
.buttons {
margin: auto;
margin-top: 18px;
.button {
&-clipboard-paste {
margin-left: 0;
.address {
display: none;
}
.icon {
background: url(../img/icon-clipboard-paste.svg);
width: 15px;
height: 19px;
display: inline-block;
margin-bottom: 4px;
}
&.contains-address {
background: #FAB915;
color: #FFF !important;
border: 0;
@include button-shadow();
.icon {
background: url(../img/icon-clipboard-paste-white.svg);
}
.address {
display: inline;
}
.non-address {
display: none;
}
}
}
span {
font-size: 14px;
}
img {
height: 16px;
width: auto;
margin: 2px 0 4px;
}
height: 60px;
line-height: 16px;
margin-right: 0px;
width: 95%;
max-width: none;
padding: 2px;
&-qr {
font-weight: bold;
max-width: none;
width: 100%;
height: 95px;
margin-top: 20px;
img {
vertical-align: middle;
margin-right: 12px;
width: 43px;
height: 43px;
}
span {
font-size: 19px;
}
}
}
}
}
.search-input {
background-color: transparent;
padding-left: 30px;
}
.sendTip {
padding-top: 5vh;
text-align: center;
.item {
border-style: none;
}
& > .title {
font-size: 20px;
color: $v-dark-gray;
margin: 20px 10px;
}
& > .subtitle {
font-size: 1rem;
line-height: 1.5em;
font-weight: 300;
color: #6F6F70;
margin: 20px 1em 2.5em;
}
.big-icon-svg {
.bg.green {
padding: 0 10px;
box-shadow: none;
}
}
.buttons {
margin-top: 18px;
.button {
font-weight: bold;
font-size: 19px;
}
}
.button-first-contact img {
height: 19px;
width: 19px;
margin-right: 6px;
vertical-align: sub;
}
}
.item-heading {
line-height: 16px;
font-size: 14px;
font-weight: bold;
.subtitle {
color: #B5B2B2;
font-size: 12px;
font-weight: 300;
}
}
.list {
.item {
font-weight: 600;
padding-top: 12px;
padding-bottom: 12px;
p {
font-weight: normal;
}
&.item-icon-left {
padding-left: 64px;
}
color: #444;
//border-top: none;
padding-top: 1.5rem;
padding-bottom: 1.5rem;
.big-icon-svg {
left: 5px;
& > .bg {
width: 30px;
height: 30px;
box-shadow: none;
}
}
&:before {
display: block;
position: absolute;
width: 100%;
height: 1px;
background: rgba(221, 221, 221, 0.3);
top: 0;
right: 0;
content: '';
}
&.item-divider {
color: rgba(74, 74, 74, .8);
}
&.item-heading {
&:before {
top: 99%;
width: 100%;
}
}
&:nth-child(2) {
&:before {
width: 0;
}
}
.item-note {
color: rgb(58, 58, 58);
}
}
}
.scroll {
height: 100%;
}
.card.contacts {
margin: 4px;
border-radius: 6px;
box-shadow: 0px 2px 1px 0 #C1C1C1;
}
}

View file

@ -8,6 +8,7 @@
@import "tab-receive"; @import "tab-receive";
@import "tab-scan"; @import "tab-scan";
@import "tab-send"; @import "tab-send";
@import "tab-send-v2";
@import "tab-settings"; @import "tab-settings";
@import "wallet-colors"; @import "wallet-colors";
@import "walletBalance"; @import "walletBalance";

View file

@ -1,12 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <svg width="42px" height="42px" viewBox="0 0 42 42" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
viewBox="0 0 35 35" style="enable-background:new 0 0 35 35;" xml:space="preserve"> <title>Artboard</title>
<style type="text/css"> <desc>Created with Sketch.</desc>
.st0{opacity:0.1;} <defs></defs>
</style> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path class="st0" d="M17.5,0C7.9,0,0,7.9,0,17.5s7.9,17.5,17.5,17.5S35,27.1,35,17.5S27.1,0,17.5,0L17.5,0z M28.6,26.9 <g id="Artboard">
c-1-2.3-3.2-3.3-5.4-4.1c-1-0.3-1.6-1.3-1.8-2.2c1.9-1.2,3.4-3.5,3.4-6.1v-1.5c0-4.1-3.2-7.3-7.3-7.3s-7.3,3.2-7.3,7.3v1.5 <g id="Group-155">
c0,2.6,1.5,4.9,3.5,6.3C13.4,21.7,13,22.5,12,23c-2.2,0.7-4.4,1.7-5.4,4.1c-2.3-2.6-3.6-6-3.6-9.6c0-8,6.6-14.5,14.6-14.5 <g id="Rectangle_3-2">
s14.6,6.5,14.6,14.5C32.1,21.1,30.8,24.4,28.6,26.9L28.6,26.9z"/> <rect id="Rectangle-path" fill="#FFFFFF" fill-rule="nonzero" x="0" y="0" width="42" height="42" rx="21"></rect>
</svg> <rect id="Rectangle-path" stroke="#DBA00A" stroke-width="2" x="1" y="1" width="40" height="40" rx="20"></rect>
</g>
<path d="M21,1 C9.954305,1 1,9.954305 1,21 C1,32.045695 9.954305,41 21,41 C32.045695,41 41,32.045695 41,21 C40.9694556,9.96698168 32.0330183,1.03054442 21,1 Z M21,6.99980143 C24.3134695,7.00034975 26.9991741,9.68679509 26.9988085,13.0002647 C26.998443,16.3137342 24.3121458,18.9995869 20.9986763,18.9994042 C17.6852067,18.9992215 14.9992058,16.3130724 14.9992057,12.9996029 C15.0101065,9.69014257 17.6905379,7.01015459 21,6.99980143 Z M21,35.8838364 C16.1880514,35.8617029 11.6973613,33.4651324 9.00039714,29.4799444 C9.09968229,25.4797458 17.0007943,23.2776013 21,23.2776013 C24.9992057,23.2776013 32.9032963,25.4797458 32.9996029,29.4799444 C30.2996632,33.4618263 25.8108583,35.8573907 21,35.8838364 Z" id="_ionicons_svg_md-contact" fill="#FAB915" fill-rule="nonzero"></path>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 812 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.642 19.367">
<defs>
<style>
.cls-1, .cls-3 {
fill: none;
}
.cls-1 {
stroke: #fff;
stroke-width: 1.5px;
}
.cls-2 {
stroke: none;
}
</style>
</defs>
<g id="Symbol_2_1" data-name="Symbol 2 1" transform="translate(-73 -156.957)">
<g id="Rectangle_40" data-name="Rectangle 40" class="cls-1" transform="translate(73 160.028)">
<rect class="cls-2" width="12.593" height="16.297"/>
<rect class="cls-3" x="0.75" y="0.75" width="11.093" height="14.797"/>
</g>
<path id="Path_75" data-name="Path 75" class="cls-1" d="M1041.164,499.734h10.757v16.023" transform="translate(-964.029 -342.027)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 764 B

View file

@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.642 19.367">
<defs>
<style>
.cls-1, .cls-3 {
fill: none;
}
.cls-1 {
stroke: #707070;
stroke-width: 1.5px;
}
.cls-2 {
stroke: none;
}
</style>
</defs>
<g id="Group_72" data-name="Group 72" transform="translate(0 0.75)">
<g id="Rectangle_40" data-name="Rectangle 40" class="cls-1" transform="translate(0 2.321)">
<rect class="cls-2" width="12.593" height="16.297"/>
<rect class="cls-3" x="0.75" y="0.75" width="11.093" height="14.797"/>
</g>
<path id="Path_75" data-name="Path 75" class="cls-1" d="M1041.164,499.734h10.757v16.023" transform="translate(-1037.029 -499.734)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 751 B

View file

@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19 19">
<defs>
<style>
.cls-1 {
fill: #030303;
}
</style>
</defs>
<path id="_ionicons_svg_md-contact" class="cls-1" d="M57.5,48A9.5,9.5,0,1,0,67,57.5,9.528,9.528,0,0,0,57.5,48Zm0,2.85a2.85,2.85,0,1,1-2.85,2.85A2.86,2.86,0,0,1,57.5,50.85Zm0,13.72a6.921,6.921,0,0,1-5.7-3.042c.046-1.9,3.8-2.946,5.7-2.946s5.654,1.046,5.7,2.946A6.932,6.932,0,0,1,57.5,64.57Z" transform="translate(-48 -48)"/>
</svg>

After

Width:  |  Height:  |  Size: 483 B

63
www/img/icon-scan-qr.svg Normal file
View file

@ -0,0 +1,63 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 43.659 43.771">
<defs>
<style>
.cls-1 {
fill: #fff;
}
</style>
</defs>
<g id="QR_Scan" data-name="QR Scan" transform="translate(0 0)">
<g id="Group_98" data-name="Group 98">
<g id="Group_95" data-name="Group 95">
<g id="Group_91" data-name="Group 91" transform="translate(0 0.113)">
<path id="Path_77" data-name="Path 77" class="cls-1" d="M2.419,11H0V.2H11.027V2.619H2.419Z" transform="translate(0 -0.2)"/>
</g>
<g id="Group_92" data-name="Group 92" transform="translate(32.857)">
<path id="Path_78" data-name="Path 78" class="cls-1" d="M69.2,11.027H66.783V2.419H58.4V0H69.2Z" transform="translate(-58.4)"/>
</g>
<g id="Group_93" data-name="Group 93" transform="translate(32.688 32.857)">
<path id="Path_79" data-name="Path 79" class="cls-1" d="M69.071,69.2H58.1V66.783h8.552V58.4h2.419Z" transform="translate(-58.1 -58.4)"/>
</g>
<g id="Group_94" data-name="Group 94" transform="translate(0 32.8)">
<path id="Path_80" data-name="Path 80" class="cls-1" d="M10.8,69.271H0V58.3H2.419v8.552H10.8Z" transform="translate(0 -58.3)"/>
</g>
</g>
<g id="GXLLf9.tif_1_" transform="translate(4.501 4.501)">
<g id="Group_96" data-name="Group 96">
<path id="Path_81" data-name="Path 81" class="cls-1" d="M49,37.1h3.319v1.632h3.319v1.632a15.783,15.783,0,0,1-1.632,0v1.632H57.27v1.632H54.007v1.632h3.319v1.632h1.632v3.319H57.327c-.056.563,0,1.125,0,1.688H54.007V50.265h1.632V48.634H54.007V47H50.688V45.37H49.056V40.419h1.632V38.788H49.056C49,38.169,49,37.663,49,37.1Zm1.688,6.583h1.632V42.051H50.688Z" transform="translate(-25.834 -20.559)"/>
<path id="Path_82" data-name="Path 82" class="cls-1" d="M7.9,7.7H19.434V19.234c-.338.056-10.24.056-11.534,0ZM9.532,9.388v8.27c1.181.056,7.933.056,8.27,0V9.444C15.045,9.388,12.288,9.388,9.532,9.388Z" transform="translate(-7.858 -7.7)"/>
<path id="Path_83" data-name="Path 83" class="cls-1" d="M60.572,7.7V19.234H49.038c-.056-.281-.113-10.24-.056-11.534ZM58.884,9.388h-8.27c-.056,1.463-.056,7.933,0,8.27h8.214C58.884,14.845,58.884,12.145,58.884,9.388Z" transform="translate(-25.816 -7.7)"/>
<path id="Path_84" data-name="Path 84" class="cls-1" d="M19.4,48.9V60.434H7.867c-.056-.338-.056-10.3,0-11.534ZM9.5,58.8h8.27c.056-1.463.056-7.933,0-8.27H9.555C9.5,53.288,9.5,56.045,9.5,58.8Z" transform="translate(-7.825 -25.72)"/>
<path id="Path_85" data-name="Path 85" class="cls-1" d="M40.2,59.751V58.119h1.632V54.8h1.632v3.319h1.688V56.488h1.632v3.319H50.1v1.632a15.783,15.783,0,0,0,1.632,0h1.632V63.07H48.414V61.439H46.783V63.07H41.832V61.439h1.632V59.751Z" transform="translate(-21.985 -28.301)"/>
<path id="Path_86" data-name="Path 86" class="cls-1" d="M54.9,34.53V31.267c.338-.056,3.938-.056,4.951,0V34.53h1.632V31.267h1.632V37.85H59.795V36.218H58.163V32.9H56.532V34.53Z" transform="translate(-28.415 -17.99)"/>
<path id="Path_87" data-name="Path 87" class="cls-1" d="M36.351,55.483H33.032v4.951H31.4V53.851h1.632V48.9h3.319v1.632H34.719v1.632h1.632Z" transform="translate(-18.136 -25.72)"/>
<path id="Path_88" data-name="Path 88" class="cls-1" d="M9.532,37.056v3.263a32.026,32.026,0,0,0,3.319,0V38.688H16.17v3.263H7.9V37A15.274,15.274,0,0,0,9.532,37.056Z" transform="translate(-7.858 -20.515)"/>
<path id="Path_89" data-name="Path 89" class="cls-1" d="M36.351,16.963v1.632c-.338.056-2.7.056-4.951.056V13.7h1.632v3.319C34.157,16.963,35.226,16.963,36.351,16.963Z" transform="translate(-18.136 -10.324)"/>
<path id="Path_90" data-name="Path 90" class="cls-1" d="M9.532,34.563V32.932H7.9V31.3h6.583v1.632H11.163v1.632Z" transform="translate(-7.858 -18.022)"/>
<path id="Path_91" data-name="Path 91" class="cls-1" d="M34.3,43.319V40h1.632v1.632h3.319v3.319H37.619V43.319Z" transform="translate(-19.405 -21.828)"/>
<path id="Path_92" data-name="Path 92" class="cls-1" d="M43.1,37.883V32.932h1.632V31.3h1.688v3.319H44.788v3.319C44.169,37.883,43.663,37.883,43.1,37.883Z" transform="translate(-23.254 -18.022)"/>
<path id="Path_93" data-name="Path 93" class="cls-1" d="M34.3,27.032h1.632a15.783,15.783,0,0,0,0-1.632h1.632v4.951H35.932V28.719H34.3Z" transform="translate(-19.405 -15.442)"/>
<path id="Path_94" data-name="Path 94" class="cls-1" d="M33.032,11.063V9.432a15.783,15.783,0,0,0-1.632,0V7.8h3.319v3.263Z" transform="translate(-18.136 -7.744)"/>
<path id="Path_95" data-name="Path 95" class="cls-1" d="M33.032,36.151H31.4V31.2h1.632Z" transform="translate(-18.136 -17.979)"/>
<path id="Path_96" data-name="Path 96" class="cls-1" d="M43.1,12.651V7.7h1.632v4.951Z" transform="translate(-23.254 -7.7)"/>
<path id="Path_97" data-name="Path 97" class="cls-1" d="M66.7,63.6h1.632v1.632H66.7Z" transform="translate(-33.576 -32.15)"/>
<path id="Path_98" data-name="Path 98" class="cls-1" d="M38.932,63.6v1.632H37.3V63.6Z" transform="translate(-20.717 -32.15)"/>
<circle id="Ellipse_4" data-name="Ellipse 4" class="cls-1" cx="1.181" cy="1.181" r="1.181" transform="translate(16.189 2.982)"/>
<path id="Path_99" data-name="Path 99" class="cls-1" d="M41.832,16.5v1.632H40.2V16.5Z" transform="translate(-21.985 -11.549)"/>
<path id="Path_100" data-name="Path 100" class="cls-1" d="M33.032,27.032H31.4V25.4h1.632Z" transform="translate(-18.136 -15.442)"/>
<path id="Path_101" data-name="Path 101" class="cls-1" d="M43.1,27.032V25.4h1.632a15.771,15.771,0,0,1,0,1.632Z" transform="translate(-23.254 -15.442)"/>
<path id="Path_102" data-name="Path 102" class="cls-1" d="M33.032,47.632H31.4V46h1.632Z" transform="translate(-18.136 -24.452)"/>
<path id="Path_103" data-name="Path 103" class="cls-1" d="M27.132,43v1.632H25.5V43Z" transform="translate(-15.556 -23.14)"/>
<path id="Path_104" data-name="Path 104" class="cls-1" d="M25.5,32.832V31.2h1.632v1.632Z" transform="translate(-15.556 -17.979)"/>
<path id="Path_105" data-name="Path 105" class="cls-1" d="M28.4,40h1.632v1.632H28.4Z" transform="translate(-16.824 -21.828)"/>
<path id="Path_106" data-name="Path 106" class="cls-1" d="M24.232,35.832H22.6V34.2h1.632Z" transform="translate(-14.287 -19.291)"/>
<circle id="Ellipse_5" data-name="Ellipse 5" class="cls-1" cx="1.181" cy="1.181" r="1.181" transform="translate(9.55 16.203)"/>
<circle id="Ellipse_6" data-name="Ellipse 6" class="cls-1" cx="1.181" cy="1.181" r="1.181" transform="translate(21.14 24.474)"/>
<path id="Path_107" data-name="Path 107" class="cls-1" d="M13.7,18.551V13.6h4.895c.056.281.056,3.713,0,4.951Z" transform="translate(-10.395 -10.281)"/>
<path id="Path_108" data-name="Path 108" class="cls-1" d="M59.851,18.562H54.9V13.667c.281-.056,3.6-.056,4.951,0Z" transform="translate(-28.415 -10.292)"/>
<path id="Path_109" data-name="Path 109" class="cls-1" d="M13.7,59.651V54.7h4.895c.056.281.056,3.882,0,4.951Z" transform="translate(-10.395 -28.257)"/>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7 KiB

26
www/img/icon-w2w.svg Normal file
View file

@ -0,0 +1,26 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 56.562 13.071">
<defs>
<style>
.cls-1, .cls-2 {
fill: #707070;
}
.cls-2, .cls-3 {
stroke: #707070;
stroke-width: 2px;
}
.cls-3 {
fill: none;
}
</style>
</defs>
<g id="Symbol_3_1" data-name="Symbol 3 1" transform="translate(-231.248 -160.719)">
<path id="Path_45" data-name="Path 45" class="cls-1" d="M12.722,0H1.428A1.422,1.422,0,0,0,0,1.428V11.834a1.239,1.239,0,0,0,1.237,1.237H14.023a1.239,1.239,0,0,0,1.237-1.237V3.426a1.239,1.239,0,0,0-1.237-1.237h-.952V.317A.4.4,0,0,0,12.722,0M1.428.635H12.405V2.189H1.428a.779.779,0,0,1-.793-.761A.806.806,0,0,1,1.428.635M14.594,9.3H9.264a.217.217,0,0,1-.222-.222V6.155a.217.217,0,0,1,.222-.222h5.33Zm-.6-6.472a.6.6,0,0,1,.6.6V5.3H9.264a.853.853,0,0,0-.857.857V9.074a.853.853,0,0,0,.857.857h5.33V11.8a.6.6,0,0,1-.6.6H1.237a.6.6,0,0,1-.6-.6V2.6L.7,2.633a1.446,1.446,0,0,0,.7.19h12.6Z" transform="translate(231.248 160.719)"/>
<path id="Path_46" data-name="Path 46" class="cls-1" d="M10.975,16.841h0a1.274,1.274,0,0,0,.666-1.174,1.3,1.3,0,0,0-.73-1.206,2,2,0,0,0-.92-.159H9.8v-.444a.15.15,0,0,0-.159-.159H9.2a.15.15,0,0,0-.159.159V14.3H8.533v-.444a.15.15,0,0,0-.159-.159H7.93c-.063.032-.159.1-.159.19v.444H7.327a.084.084,0,0,0-.1.1v.412a.084.084,0,0,0,.1.1h.444V19H7.327a.136.136,0,0,0-.127.127v.381a.136.136,0,0,0,.127.127h.444v.412a.15.15,0,0,0,.159.159h.444a.15.15,0,0,0,.159-.159v-.412H9.04v.412A.15.15,0,0,0,9.2,20.2h.444a.15.15,0,0,0,.159-.159v-.412h.286a2.182,2.182,0,0,0,.793-.1,1.5,1.5,0,0,0,.984-1.428,1.242,1.242,0,0,0-.888-1.269m-2.443-1.9H9.992a1.264,1.264,0,0,1,.539.1.766.766,0,0,1,.349.7.758.758,0,0,1-.793.825H8.533V14.937Zm2.062,4a1.233,1.233,0,0,1-.476.063H8.533v-1.84h1.65a.85.85,0,0,1,.92.92.9.9,0,0,1-.508.857" transform="translate(226.332 151.366)"/>
<path id="Path_45-2" data-name="Path 45" class="cls-1" d="M12.722,0H1.428A1.422,1.422,0,0,0,0,1.428V11.834a1.239,1.239,0,0,0,1.237,1.237H14.023a1.239,1.239,0,0,0,1.237-1.237V3.426a1.239,1.239,0,0,0-1.237-1.237h-.952V.317A.4.4,0,0,0,12.722,0M1.428.635H12.405V2.189H1.428a.779.779,0,0,1-.793-.761A.806.806,0,0,1,1.428.635M14.594,9.3H9.264a.217.217,0,0,1-.222-.222V6.155a.217.217,0,0,1,.222-.222h5.33Zm-.6-6.472a.6.6,0,0,1,.6.6V5.3H9.264a.853.853,0,0,0-.857.857V9.074a.853.853,0,0,0,.857.857h5.33V11.8a.6.6,0,0,1-.6.6H1.237a.6.6,0,0,1-.6-.6V2.6L.7,2.633a1.446,1.446,0,0,0,.7.19h12.6Z" transform="translate(272.55 160.719)"/>
<path id="Path_46-2" data-name="Path 46" class="cls-1" d="M10.975,16.841h0a1.274,1.274,0,0,0,.666-1.174,1.3,1.3,0,0,0-.73-1.206,2,2,0,0,0-.92-.159H9.8v-.444a.15.15,0,0,0-.159-.159H9.2a.15.15,0,0,0-.159.159V14.3H8.533v-.444a.15.15,0,0,0-.159-.159H7.93c-.063.032-.159.1-.159.19v.444H7.327a.084.084,0,0,0-.1.1v.412a.084.084,0,0,0,.1.1h.444V19H7.327a.136.136,0,0,0-.127.127v.381a.136.136,0,0,0,.127.127h.444v.412a.15.15,0,0,0,.159.159h.444a.15.15,0,0,0,.159-.159v-.412H9.04v.412A.15.15,0,0,0,9.2,20.2h.444a.15.15,0,0,0,.159-.159v-.412h.286a2.182,2.182,0,0,0,.793-.1,1.5,1.5,0,0,0,.984-1.428,1.242,1.242,0,0,0-.888-1.269m-2.443-1.9H9.992a1.264,1.264,0,0,1,.539.1.766.766,0,0,1,.349.7.758.758,0,0,1-.793.825H8.533V14.937Zm2.062,4a1.233,1.233,0,0,1-.476.063H8.533v-1.84h1.65a.85.85,0,0,1,.92.92.9.9,0,0,1-.508.857" transform="translate(267.634 151.366)"/>
<path id="Path_31" data-name="Path 31" class="cls-2" d="M0,0H13.275" transform="translate(265.885 167.457) rotate(180)"/>
<path id="arrow" class="cls-3" d="M0,0,4.764,4.866,0,9.732" transform="translate(261.884 162.554)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

143
www/views/tab-send-v2.html Normal file
View file

@ -0,0 +1,143 @@
<ion-view id="tab-send2" show-tabs>
<ion-nav-bar class="bar-royal">
<ion-nav-title>{{'Send' | translate}}</ion-nav-title>
</ion-nav-bar>
<ion-content>
<div ng-if="hasFunds">
<div class="send-wrapper item">
<div class="row">
<div class="input" ng-class="{'focus': searchFocus}">
<input type="text" class="search-input" placeholder="{{'Search or enter bitcoin address' | translate}}"
ng-model="formData.search" ng-change="findContact(formData.search)" ng-model-onblur
ng-focus="searchInFocus()" ng-blur="searchBlurred()">
</div>
</div>
<div class="buttons">
<div class="row">
<div class="col-40">
<button class="button button-standard button-primary button-outline button-clipboard-paste" ng-click="pasteClipboard()" ng-class="{'contains-address': clipboardHasAddress}">
<span class="icon"></span><br/>
<span class="non-address" translate>Paste Clipboard</span>
<span class="address" translate>Paste Address</span>
</button>
</div>
<div class="col-60">
<button class="button button-standard button-primary button-outline">
<img src="img/icon-w2w.svg"/><br/>
<span translate>Wallet to Wallet Transfer</span>
</button>
</div>
</div>
<div class="row">
<button class="button button-standard button-green button-qr" ui-sref="tabs.scan">
<span>
<img src="img/icon-scan-qr.svg"/>
<span translate>Scan QR Code</span>
</span>
</button>
</div>
</div>
</div>
</div>
<div ng-if="hasWallets && hasFunds && !hasContacts">
<div class="list sendTip">
<div class="title" translate>
Send Bitcoin faster!
</div>
<div class="subtitle">
<div ng-show="hasWallets" translate>
<p>Save frequently used addresses and send them Bitcoin in just one tap</p>
</div>
<div class="padding buttons">
<a class="button-first-contact" ng-click="addContact()">
<img src="img/icon-contact-add.svg"/>
<span translate>Add your first contact</span>
</a>
</div>
</div>
</div>
</div>
<div ng-if="!checkingBalance && (!hasFunds || !hasWallets)">
<div class="list card sendTip">
<div class="title" translate>
Your Bitcoin wallet is empty
</div>
<div class="subtitle">
<div ng-show="hasWallets" translate>
<p>To get started, buy Bitcoin Cash (BCH) or Bitcoin Core (BTC), or share your address.</p>
<p>You can receive bitcoin from any wallet or service.</p>
</div>
<div ng-show="!hasWallets" translate>To get started, you'll need to create a bitcoin wallet and get some
bitcoin.
</div>
<div class="padding buttons">
<button class="button button-standard button-green" ng-click="buyBitcoin()" ng-show="hasWallets" translate>
Buy Bitcoin now
</button>
<button class="button button-standard button-green" ng-click="createWallet()" ng-show="!hasWallets"
translate>Create bitcoin wallet
</button>
<button class="button button-standard button-white" ui-sref="tabs.receive" ng-show="hasWallets" translate>
Show my address
</button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="card contacts" ng-if="hasContacts && hasWallets && hasFunds">
<div class="item item-icon-right item-heading">
<div translate>Contacts</div>
<div translate class="subtitle"><span style="">Saved frequently used addresses</span></div>
<a ng-if="hasContacts" ui-sref="tabs.send.addressbook">
<i class="icon ion-ios-plus-empty list-add-button"></i>
</a>
</div>
<div class="list">
<a class="item item-icon-left item-icon-right" ng-repeat="item in list"
ng-if="!item.isWallet && item.recipientType != 'wallet'" ng-click="goToAmount(item)">
<i class="icon big-icon-svg">
<gravatar class="send-gravatar" name="{{item.name}}" width="40" email="{{item.email}}"></gravatar>
</i>
{{item.name}}
<p>
<span>{{item.displayCoin}}</span>
</p>
<i class="icon bp-arrow-right"></i>
</a>
<div class="show-more" ng-if="contactsShowMore" ng-click="showMore()" translate>
Show more
</div>
</div>
</div>
</div>
</div>
<!--<div class="card" ng-if="showTransferCard && hasFunds">-->
<!--<div class="item item-icon-right item-heading" ng-click="toggle('transferToWallet')">-->
<!--<span translate>Transfer to Wallet</span>-->
<!--<i class="icon bp-arrow-up" ng-show="sectionDisplay.transferToWallet"></i>-->
<!--<i class="icon bp-arrow-down" ng-show="!sectionDisplay.transferToWallet"></i>-->
<!--</div>-->
<!--<div class="list" ng-show="sectionDisplay.transferToWallet">-->
<!--<a class="item item-icon-left item-icon-right"-->
<!--ng-repeat="item in list"-->
<!--ng-if="hasWallets && item.recipientType == 'wallet'"-->
<!--ng-click="goToAmount(item)">-->
<!--<i class="icon big-icon-svg" ng-if="item.recipientType == 'wallet'" ng-init="wallet = item"-->
<!--ng-include="'views/includes/walletIcon.html'"></i>-->
<!--{{item.name}}-->
<!--<p>-->
<!--<span>{{item.balanceString}}</span>-->
<!--</p>-->
<!--<i class="icon bp-arrow-right"></i>-->
<!--</a>-->
<!--</div>-->
<!--</div>-->
</ion-content>
</ion-view>

View file

@ -12,7 +12,7 @@
<ion-nav-view name="tab-scan"></ion-nav-view> <ion-nav-view name="tab-scan"></ion-nav-view>
</ion-tab> </ion-tab>
<ion-tab title="{{'Send'|translate}}" icon-off="ico-send" icon-on="ico-send-selected" ui-sref="tabs.send"> <ion-tab title="{{'Send'|translate}}" icon-off="ico-send" icon-on="ico-send-selected" ui-sref="tabs.send2">
<ion-nav-view name="tab-send"></ion-nav-view> <ion-nav-view name="tab-send"></ion-nav-view>
</ion-tab> </ion-tab>