Starting on generic wallet selection screen for all sending scenarios.
This commit is contained in:
parent
fb275d4b08
commit
770116c942
4 changed files with 123 additions and 2 deletions
57
src/js/controllers/sendWalletController.js
Normal file
57
src/js/controllers/sendWalletController.js
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('sendWalletController', sendWalletController);
|
||||
|
||||
function sendWalletController(gettextCatalog, configService, $filter, $ionicHistory, $ionicModal, $ionicScrollDelegate, lodash, $log, nodeWebkitService, rateService, $scope, $state, $stateParams, $timeout, txFormatService, platformInfo, popupService, profileService, walletService, $window) {
|
||||
var vm = this;
|
||||
|
||||
vm.headerTitle = '';
|
||||
vm.isSendFrom = true;
|
||||
vm.walletsBch = [];
|
||||
vm.walletsBtc = [];
|
||||
vm.walletsEmpty = [];
|
||||
|
||||
vm.useWallet = useWallet;
|
||||
|
||||
$scope.$on('$ionicView.beforeEnter', onBeforeEnter);
|
||||
|
||||
var fromWalletId = '';
|
||||
var thirdParty = null;
|
||||
|
||||
function onBeforeEnter(event, data) {
|
||||
thirdParty = data.stateParams.thirdParty
|
||||
|
||||
fromWalletId =data.stateParams.fromWalletId;
|
||||
vm.isSendFrom = !!fromWalletId;
|
||||
|
||||
if (vm.isSendFrom) {
|
||||
vm.headerTitle = gettextCatalog.getString('From');
|
||||
} else {
|
||||
vm.headerTitle = gettextCatalog.getString('To');
|
||||
}
|
||||
|
||||
vm.walletsBch = profileService.getWallets({
|
||||
coin: 'bch',
|
||||
hasFunds: true
|
||||
});
|
||||
vm.walletsBtc = profileService.getWallets({
|
||||
coin: 'btc',
|
||||
hasFunds: true
|
||||
});
|
||||
vm.walletsEmpty = profileService.getWallets({
|
||||
hasFunds: false
|
||||
});
|
||||
|
||||
// Will make this generic for other third party services later, but
|
||||
// this is where it will happen
|
||||
if (thirdParty && thirdParty.id === 'shapeshift') {
|
||||
|
||||
} else {
|
||||
headerTitle = 'Wallet-to-Wallet transfer'
|
||||
}
|
||||
}
|
||||
|
||||
function useWallet(wallet) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -285,7 +285,16 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
* Send
|
||||
*
|
||||
*/
|
||||
|
||||
.state('tabs.send.wallet', {
|
||||
url: '/send-wallet/:recipientType/:toAddress/:toName/:toEmail/:toColor/:coin/:fixedUnit/:fromWalletId/:minShapeshiftAmount/:maxShapeshiftAmount/:shapeshiftOrderId/:displayAddress/:noPrefix',
|
||||
views: {
|
||||
'tab-send@tabs' : {
|
||||
controller: 'sendWalletController',
|
||||
controllerAs: 'vm',
|
||||
templateUrl: 'views/sendWallet.html'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('tabs.send.amount', {
|
||||
url: '/amount/:recipientType/:toAddress/:toName/:toEmail/:toColor/:coin/:fixedUnit/:fromWalletId/:minShapeshiftAmount/:maxShapeshiftAmount/:shapeshiftOrderId/:displayAddress/:noPrefix',
|
||||
views: {
|
||||
|
|
|
|||
55
www/views/sendWallet.html
Normal file
55
www/views/sendWallet.html
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<ion-view id="send-wallet" show-tabs>
|
||||
<ion-nav-bar class="bar-royal">
|
||||
<ion-nav-title>{{'Wallet to wallet transfer' | translate}}</ion-nav-title>
|
||||
</ion-nav-bar>
|
||||
<ion-content>
|
||||
<div class="header--request" ng-if="isPaymentRequest">
|
||||
<div class="header--request__title" translate>Paying</div>
|
||||
<div class="header--request__amount" translate>$37.42 USD</div>
|
||||
<div class="header--request__amount-alt" translate>0.04580000 BCH {{requestAmount}}</div>
|
||||
</div>
|
||||
<div class="wallets-header">
|
||||
<div class="title">
|
||||
{{vm.headerTitle}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="list card">
|
||||
<div class="item item-icon-right item-heading">
|
||||
<div translate>Bitcoin Cash (BCH)</div>
|
||||
<div translate class="subtitle">Instant transactions with low fees</div>
|
||||
</div>
|
||||
<div>
|
||||
<a ng-repeat="wallet in vm.walletsBch track by $index"
|
||||
class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet"
|
||||
ng-click="vm.useWallet(wallet)">
|
||||
<span ng-include="'views/includes/walletList.html'"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list card" ng-if="vm.walletsBtc.length > 0">
|
||||
<div class="item item-icon-right item-heading">
|
||||
<div translate>Bitcoin Core (BTC)</div>
|
||||
</div>
|
||||
<div>
|
||||
<a ng-repeat="wallet in vm.walletsBtc track by $index"
|
||||
class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet"
|
||||
ng-click="vm.useWallet(wallet)">
|
||||
<span ng-include="'views/includes/walletList.html'"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list card card-insufficient" ng-if="vm.walletsEmpty.length > 0">
|
||||
<div class="item item-icon-right item-heading">
|
||||
<span class="card-insufficient__dot"></span><div translate>Insufficient funds</div>
|
||||
</div>
|
||||
<div>
|
||||
<a ng-repeat="wallet in vm.walletsEmpty track by $index"
|
||||
class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet">
|
||||
<span ng-include="'views/includes/walletList.html'"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
</button>
|
||||
</div>
|
||||
<div class="col-60">
|
||||
<button class="button button-standard button-primary button-outline" ng-click="showWalletSelector()">
|
||||
<button class="button button-standard button-primary button-outline" ui-sref="tabs.send.wallet">
|
||||
<img src="img/icon-w2w.svg"/><br/>
|
||||
<span translate>Wallet to Wallet Transfer</span>
|
||||
</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue