improve confirm view UI

This commit is contained in:
Gabriel Bazán 2016-12-28 12:11:55 -03:00
commit 7f684c8eb6
4 changed files with 15 additions and 9 deletions

View file

@ -63,9 +63,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
if (!$scope.wallets || !$scope.wallets.length) { if (!$scope.wallets || !$scope.wallets.length) {
$scope.noMatchingWallet = true; $scope.noMatchingWallet = true;
if ($scope.paypro) { displayValues();
displayValues(); $log.warn('No ' + $scope.network + ' wallets to make the payment');
}
$timeout(function() { $timeout(function() {
$scope.$apply(); $scope.$apply();
}); });
@ -107,6 +106,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
} else initConfirm(); } else initConfirm();
} else { } else {
if (!enoughFunds) $scope.insufficientFunds = true; if (!enoughFunds) $scope.insufficientFunds = true;
displayValues();
$log.warn('No wallet available to make the payment'); $log.warn('No wallet available to make the payment');
} }
$timeout(function() { $timeout(function() {

View file

@ -8,7 +8,9 @@ angular.module('copayApp.directives')
transclude: true, transclude: true,
scope: { scope: {
sendStatus: '=clickSendStatus', sendStatus: '=clickSendStatus',
wallet: '=hasWalletChosen' hasWalletChosen: '=hasWalletChosen',
insufficientFunds: '=insufficientFunds',
noMatchingWallet: '=noMatchingWallet'
}, },
link: function(scope, element, attrs) { link: function(scope, element, attrs) {
scope.$watch('sendStatus', function() { scope.$watch('sendStatus', function() {

View file

@ -120,17 +120,21 @@
</ion-content> </ion-content>
<click-to-accept <click-to-accept
ng-click="approve(statusChangeHandler)" ng-click="approve(statusChangeHandler)"
ng-if="!isCordova && wallets[0] && !insufficientFunds && !noMatchingWallet" ng-if="!isCordova"
click-send-status="sendStatus" click-send-status="sendStatus"
has-wallet-chosen="wallet"> has-wallet-chosen="wallet"
insufficient-funds="insufficientFunds"
no-matching-wallet="noMatchingWallet">
{{'Accept' | translate}} {{'Accept' | translate}}
</click-to-accept> </click-to-accept>
<slide-to-accept <slide-to-accept
ng-disabled="!wallet" ng-disabled="!wallet"
ng-if="isCordova && wallets[0] && !insufficientFunds && !noMatchingWallet" ng-if="isCordova"
slide-on-confirm="onConfirm()" slide-on-confirm="onConfirm()"
slide-send-status="sendStatus" slide-send-status="sendStatus"
has-wallet-chosen="wallet"> has-wallet-chosen="wallet"
insufficient-funds="insufficientFunds"
no-matching-wallet="noMatchingWallet">
{{'Accept' | translate}} {{'Accept' | translate}}
</slide-to-accept> </slide-to-accept>
<slide-to-accept-success <slide-to-accept-success

View file

@ -1,4 +1,4 @@
<button ng-disabled="!wallet" class="click-to-accept__button button button-standard button-primary" ng-class="{disable: sendStatus}"> <button ng-disabled="!hasWalletChosen || insufficientFunds || noMatchingWallet" class="click-to-accept__button button button-standard button-primary" ng-class="{disable: sendStatus}">
<span ng-if="!sendStatus"> <span ng-if="!sendStatus">
<ng-transclude></ng-transclude> <ng-transclude></ng-transclude>
</span> </span>