Merge pull request #5625 from JDonadio/ref/icons

Use icon properly - confirm view
This commit is contained in:
Gustavo Maximiliano Cortez 2017-02-20 16:52:43 -03:00 committed by GitHub
commit 7ed05af807
9 changed files with 54 additions and 24 deletions

View file

@ -23,8 +23,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
$scope.forceCurrency = data.stateParams.forceCurrency;
$scope.showMenu = $ionicHistory.backView() && $ionicHistory.backView().stateName == 'tabs.send';
var isWallet = data.stateParams.isWallet || 'false';
$scope.isWallet = (isWallet.toString().trim().toLowerCase() == 'true' ? true : false);
$scope.recipientType = data.stateParams.recipientType || null;
$scope.toAddress = data.stateParams.toAddress;
$scope.toName = data.stateParams.toName;
$scope.toEmail = data.stateParams.toEmail;
@ -95,11 +94,12 @@ angular.module('copayApp.controllers').controller('amountController', function($
$scope.sendMax = function() {
$scope.showSendMax = false;
$state.transitionTo('tabs.send.confirm', {
isWallet: $scope.isWallet,
recipientType: $scope.recipientType,
toAmount: null,
toAddress: $scope.toAddress,
toName: $scope.toName,
toEmail: $scope.toEmail,
toColor: $scope.toColor,
useSendMax: true,
});
};
@ -233,11 +233,12 @@ angular.module('copayApp.controllers').controller('amountController', function($
});
} else {
$state.transitionTo('tabs.send.confirm', {
isWallet: $scope.isWallet,
recipientType: $scope.recipientType,
toAmount: (amount * unitToSatoshi).toFixed(0),
toAddress: $scope.toAddress,
toName: $scope.toName,
toEmail: $scope.toEmail
toEmail: $scope.toEmail,
toColor: $scope.toColor,
});
}
}

View file

@ -14,11 +14,11 @@ angular.module('copayApp.controllers').controller('confirmController', function(
toAmount = data.stateParams.toAmount;
cachedSendMax = {};
$scope.useSendMax = data.stateParams.useSendMax == 'true' ? true : false;
var isWallet = data.stateParams.isWallet || 'false';
$scope.isWallet = (isWallet.toString().trim().toLowerCase() == 'true' ? true : false);
$scope.recipientType = data.stateParams.recipientType || null;
$scope.toAddress = data.stateParams.toAddress;
$scope.toName = data.stateParams.toName;
$scope.toEmail = data.stateParams.toEmail;
$scope.toColor = data.stateParams.toColor;
$scope.description = data.stateParams.description;
$scope.paypro = data.stateParams.paypro;
$scope.insufficientFunds = false;
@ -503,8 +503,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$log.debug('statusChangeHandler: ', processName, showName, isOn);
if (
(
processName === 'broadcastingTx' ||
((processName === 'signingTx') && $scope.wallet.m > 1) ||
processName === 'broadcastingTx' ||
((processName === 'signingTx') && $scope.wallet.m > 1) ||
(processName == 'sendingTx' && !$scope.wallet.canSign() && !$scope.wallet.isPrivKeyExternal())
) && !isOn) {
$scope.sendStatus = 'success';

View file

@ -23,7 +23,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
originalList.push({
color: v.color,
name: v.name,
isWallet: true,
recipientType: 'wallet',
getAddress: function(cb) {
walletService.getAddress(v, false, cb);
},
@ -41,6 +41,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
name: lodash.isObject(v) ? v.name : v,
address: k,
email: lodash.isObject(v) ? v.email : null,
recipientType: 'contact',
getAddress: function(cb) {
return cb(null, k);
},
@ -99,7 +100,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
}
$log.debug('Got toAddress:' + addr + ' | ' + item.name);
return $state.transitionTo('tabs.send.amount', {
isWallet: item.isWallet,
recipientType: item.recipientType,
toAddress: addr,
toName: item.name,
toEmail: item.email,
@ -142,7 +143,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
$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;

View file

@ -12,10 +12,10 @@ angular.module('copayApp.directives')
email: '@'
},
link: function(scope, el, attr) {
if(typeof scope.email === "string"){
if (typeof scope.email === "string") {
scope.emailHash = md5.createHash(scope.email.toLowerCase() || '');
}
},
template: '<img class="gravatar" alt="{{ name }}" height="{{ height }}" width="{{ width }}" src="https://secure.gravatar.com/avatar/{{ emailHash }}.jpg?s={{ width }}&d=identicon">'
template: '<img class="gravatar" alt="{{ name }}" height="{{ height }}" width="{{ width }}" src="https://secure.gravatar.com/avatar/{{ emailHash }}.jpg?s={{ width }}&d=mm">'
};
});

View file

@ -274,7 +274,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
*/
.state('tabs.send.amount', {
url: '/amount/:isWallet/:toAddress/:toName/:toEmail/:toColor',
url: '/amount/:recipientType/:toAddress/:toName/:toEmail/:toColor',
views: {
'tab-send@tabs': {
controller: 'amountController',
@ -283,7 +283,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
})
.state('tabs.send.confirm', {
url: '/confirm/:isWallet/:toAddress/:toName/:toAmount/:toEmail/:description/:useSendMax',
url: '/confirm/:recipientType/:toAddress/:toName/:toAmount/:toEmail/:toColor/:description/:useSendMax',
views: {
'tab-send@tabs': {
controller: 'confirmController',

View file

@ -7,4 +7,14 @@
.tx-details-content > .scroll {
padding-bottom: .25rem;
}
.gravatar-contact {
display: flex;
margin-left: -3px;
span {
margin: 5px 0 0 8px;
}
}
.wallet-name {
margin-top: -3px;
}
}