diff --git a/src/js/controllers/walletToWalletController.js b/src/js/controllers/walletToWalletController.js
index eaf8f7700..e12b78837 100644
--- a/src/js/controllers/walletToWalletController.js
+++ b/src/js/controllers/walletToWalletController.js
@@ -1,14 +1,23 @@
'use strict';
-angular.module('copayApp.controllers').controller('walletToWalletController', function($scope, $rootScope, $log, profileService, configService) {
-
- // TODO: change according to which screen this is, origin/destination
- $scope.headerTitle = gettextCatalog.getString('Choose your origin wallet');
- $scope.headerSubtitle = gettextCatalog.getString('This is where the Bitcoin will be taken out from.');
+angular.module('copayApp.controllers').controller('walletToWalletController', function($scope, $rootScope, $log, configService, gettextCatalog, profileService) {
$scope.$on("$ionicView.enter", function(event, data) {
- $scope.walletsBch = profileService.getWallets({coin: 'bch'});
- $scope.walletsBtc = profileService.getWallets({coin: 'btc'});
+ $scope.type = 'origin';
+ $scope.coin = 'bch';
+ $scope.walletsEmpty = [];
+ $scope.isPaymentRequest = true;
+
+ if ($scope.type === 'origin') {
+ $scope.headerTitle = gettextCatalog.getString('Choose a wallet to send from');
+ $scope.walletsEmpty = profileService.getWallets({coin: $scope.coin, hasNoFunds: true});
+ } else if ($scope.type === 'destination') {
+ $scope.headerTitle = gettextCatalog.getString('Choose a wallet to send to');
+ }
+
+ $scope.walletsBch = profileService.getWallets({coin: 'bch', hasFunds: $scope.type==='origin'});
+ $scope.walletsBtc = profileService.getWallets({coin: 'btc', hasFunds: $scope.type==='origin'});
+
configService.whenAvailable(function(config) {
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
});
@@ -17,5 +26,4 @@ angular.module('copayApp.controllers').controller('walletToWalletController', fu
$scope.useWallet = function(wallet) {
// Do something with selected wallet
};
-
});
\ No newline at end of file
diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js
index 4f8710c28..c86d263f2 100644
--- a/src/js/services/profileService.js
+++ b/src/js/services/profileService.js
@@ -847,6 +847,13 @@ angular.module('copayApp.services')
});
}
+ if (opts.hasNoFunds) {
+ ret = lodash.filter(ret, function(w) {
+ if (!w.status) return;
+ return (w.status.availableBalanceSat === 0);
+ });
+ }
+
if (opts.minAmount) {
ret = lodash.filter(ret, function(w) {
if (!w.status) return;
diff --git a/src/sass/views/wallet-to-wallet-transfer.scss b/src/sass/views/wallet-to-wallet-transfer.scss
index e909258cf..7328a2891 100644
--- a/src/sass/views/wallet-to-wallet-transfer.scss
+++ b/src/sass/views/wallet-to-wallet-transfer.scss
@@ -1,18 +1,71 @@
#wallet-to-wallet-transfer {
- .header, .list {
+ .header--request {
+ padding: 30px 24px;
+ width: 100%;
+ height: 139px;
+ background-color: #fff;
+ &__title {
+ width: 46px;
+ height: 20px;
+ font-size: 16px;
+ font-weight: 600;
+ letter-spacing: -0.4px;
+ color: #000000;
+ }
+ &__amount {
+ font-size: 29px;
+ font-weight: 600;
+ letter-spacing: -0.7px;
+ color: #000000;
+ margin: 11px 0 2px;
+ }
+ &__amount-alt {
+ opacity: 0.45;
+ font-size: 16px;
+ font-weight: 600;
+ letter-spacing: -0.4px;
+ color: #000000;
+ }
+ }
+ .wallets-header {
font-size: 12px;
- margin: 20px 14px;
+ margin: 20px 14px 0px;
.title {
- font-size: 20px;
+ font-size: 16px;
font-weight: bold;
color: $v-dark-gray;
+ margin-bottom: -12px;
}
- .subtitle {
- font-size: 12px;
- line-height: 1.5em;
- font-weight: 300;
- color: $v-dark-gray;
+ }
+ .card {
+ font-size: 12px;
+ margin: 20px 14px 0px;
+
+ .item-heading {
+ font-weight: 600;
+ }
+
+ &-insufficient {
+ .wallet {
+ opacity: 0.4;
+
+ }
+ .item-heading {
+ font-size: 12px;
+ >div {
+ display: inline-block;
+ vertical-align: text-bottom;
+ }
+ }
+ &__dot {
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ background-color: #ec5959;
+ border-radius: 8px;
+ margin: 2px 6px 2px 2px;
+ }
}
}
}
\ No newline at end of file
diff --git a/www/views/wallet-to-wallet-transfer.html b/www/views/wallet-to-wallet-transfer.html
index 87ae6f6ed..2055e4845 100644
--- a/www/views/wallet-to-wallet-transfer.html
+++ b/www/views/wallet-to-wallet-transfer.html
@@ -3,13 +3,15 @@
{{'Wallet to wallet transfer' | translate}}
-