send/receive buttons on walletDetails + currencySymbolService
This commit is contained in:
parent
a5a999958c
commit
450b80b03f
6 changed files with 279 additions and 33 deletions
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicHistory, profileService, lodash, configService, platformInfo, walletService, txpModalService, externalLinkService, popupService, addressbookService, storageService, $ionicScrollDelegate, $window, bwcError, gettextCatalog, timeService, feeService, appConfigService, rateService) {
|
||||
angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicHistory, profileService, lodash, configService, currencySymbolService, platformInfo, walletService, txpModalService, externalLinkService, popupService, addressbookService, storageService, $ionicScrollDelegate, $window, bwcError, gettextCatalog, timeService, feeService, appConfigService, rateService) {
|
||||
|
||||
var HISTORY_SHOW_LIMIT = 10;
|
||||
var currentTxHistoryPage = 0;
|
||||
|
|
@ -12,6 +12,13 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
$scope.isAndroid = platformInfo.isAndroid;
|
||||
$scope.isIOS = platformInfo.isIOS;
|
||||
|
||||
$scope.currencySymbols = {
|
||||
'EUR': '€',
|
||||
'GBP': '£',
|
||||
'USD': '$',
|
||||
'YEN' : ''
|
||||
};
|
||||
|
||||
var channel = "firebase";
|
||||
if (platformInfo.isNW) {
|
||||
channel = "ga";
|
||||
|
|
@ -256,6 +263,11 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
return !tx.confirmations || tx.confirmations === 0;
|
||||
};
|
||||
|
||||
$scope.currencySymbol = function(code) {
|
||||
var symbol = currencySymbolService.getCurrencySymbol(code);
|
||||
return symbol?symbol:"";
|
||||
};
|
||||
|
||||
$scope.showMore = function() {
|
||||
$timeout(function() {
|
||||
currentTxHistoryPage++;
|
||||
|
|
@ -315,16 +327,16 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
}
|
||||
|
||||
scrollPos = scrollPos || 0;
|
||||
var amountHeight = 210 - scrollPos;
|
||||
var amountHeight = 230 - scrollPos;
|
||||
if (amountHeight < 80) {
|
||||
amountHeight = 80;
|
||||
}
|
||||
var contentMargin = amountHeight;
|
||||
if (contentMargin > 210) {
|
||||
contentMargin = 210;
|
||||
if (contentMargin > 230) {
|
||||
contentMargin = 230;
|
||||
}
|
||||
|
||||
var amountScale = (amountHeight / 210);
|
||||
var amountScale = (amountHeight / 230);
|
||||
if (amountScale < 0.5) {
|
||||
amountScale = 0.5;
|
||||
}
|
||||
|
|
@ -342,7 +354,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
top = TOP_BALANCE_BUTTON;
|
||||
}
|
||||
|
||||
var amountTop = ((amountScale - 0.7) / 0.7) * top;
|
||||
var amountTop = ((amountScale - 0.85) / 0.85) * top;
|
||||
if (amountTop < -10) {
|
||||
amountTop = -10;
|
||||
}
|
||||
|
|
|
|||
194
src/js/services/currencySymbolService.js
Normal file
194
src/js/services/currencySymbolService.js
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').factory('currencySymbolService', function($log) {
|
||||
var root = {};
|
||||
root.currencySymbols = {
|
||||
'AED': 'د.إ',
|
||||
'AFN': '؋',
|
||||
'ALL': 'L',
|
||||
'AMD': '֏',
|
||||
'ANG': 'ƒ',
|
||||
'AOA': 'Kz',
|
||||
'ARS': '$',
|
||||
'AUD': '$',
|
||||
'AWG': 'ƒ',
|
||||
'AZN': '₼',
|
||||
'BAM': 'KM',
|
||||
'BBD': '$',
|
||||
'BDT': '৳',
|
||||
'BGN': 'лв',
|
||||
'BHD': '.د.ب',
|
||||
'BIF': 'FBu',
|
||||
'BMD': '$',
|
||||
'BND': '$',
|
||||
'BOB': '$b',
|
||||
'BRL': 'R$',
|
||||
'BSD': '$',
|
||||
'BTC': '฿',
|
||||
'BTN': 'Nu.',
|
||||
'BWP': 'P',
|
||||
'BYR': 'Br',
|
||||
'BYN': 'Br',
|
||||
'BZD': 'BZ$',
|
||||
'CAD': '$',
|
||||
'CDF': 'FC',
|
||||
'CHF': 'CHF',
|
||||
'CLP': '$',
|
||||
'CNY': '¥',
|
||||
'COP': '$',
|
||||
'CRC': '₡',
|
||||
'CUC': '$',
|
||||
'CUP': '₱',
|
||||
'CVE': '$',
|
||||
'CZK': 'Kč',
|
||||
'DJF': 'Fdj',
|
||||
'DKK': 'kr',
|
||||
'DOP': 'RD$',
|
||||
'DZD': 'دج',
|
||||
'EEK': 'kr',
|
||||
'EGP': '£',
|
||||
'ERN': 'Nfk',
|
||||
'ETB': 'Br',
|
||||
'ETH': 'Ξ',
|
||||
'EUR': '€',
|
||||
'FJD': '$',
|
||||
'FKP': '£',
|
||||
'GBP': '£',
|
||||
'GEL': '₾',
|
||||
'GGP': '£',
|
||||
'GHC': '₵',
|
||||
'GHS': 'GH₵',
|
||||
'GIP': '£',
|
||||
'GMD': 'D',
|
||||
'GNF': 'FG',
|
||||
'GTQ': 'Q',
|
||||
'GYD': '$',
|
||||
'HKD': '$',
|
||||
'HNL': 'L',
|
||||
'HRK': 'kn',
|
||||
'HTG': 'G',
|
||||
'HUF': 'Ft',
|
||||
'IDR': 'Rp',
|
||||
'ILS': '₪',
|
||||
'IMP': '£',
|
||||
'INR': '₹',
|
||||
'IQD': 'ع.د',
|
||||
'IRR': '﷼',
|
||||
'ISK': 'kr',
|
||||
'JEP': '£',
|
||||
'JMD': 'J$',
|
||||
'JOD': 'JD',
|
||||
'JPY': '¥',
|
||||
'KES': 'KSh',
|
||||
'KGS': 'лв',
|
||||
'KHR': '៛',
|
||||
'KMF': 'CF',
|
||||
'KPW': '₩',
|
||||
'KRW': '₩',
|
||||
'KWD': 'KD',
|
||||
'KYD': '$',
|
||||
'KZT': 'лв',
|
||||
'LAK': '₭',
|
||||
'LBP': '£',
|
||||
'LKR': '₨',
|
||||
'LRD': '$',
|
||||
'LSL': 'M',
|
||||
'LTC': 'Ł',
|
||||
'LTL': 'Lt',
|
||||
'LVL': 'Ls',
|
||||
'LYD': 'LD',
|
||||
'MAD': 'MAD',
|
||||
'MDL': 'lei',
|
||||
'MGA': 'Ar',
|
||||
'MKD': 'ден',
|
||||
'MMK': 'K',
|
||||
'MNT': '₮',
|
||||
'MOP': 'MOP$',
|
||||
'MRO': 'UM',
|
||||
'MRU': 'UM',
|
||||
'MUR': '₨',
|
||||
'MVR': 'Rf',
|
||||
'MWK': 'MK',
|
||||
'MXN': '$',
|
||||
'MYR': 'RM',
|
||||
'MZN': 'MT',
|
||||
'NAD': '$',
|
||||
'NGN': '₦',
|
||||
'NIO': 'C$',
|
||||
'NOK': 'kr',
|
||||
'NPR': '₨',
|
||||
'NZD': '$',
|
||||
'OMR': '﷼',
|
||||
'PAB': 'B/.',
|
||||
'PEN': 'S/.',
|
||||
'PGK': 'K',
|
||||
'PHP': '₱',
|
||||
'PKR': '₨',
|
||||
'PLN': 'zł',
|
||||
'PYG': 'Gs',
|
||||
'QAR': '﷼',
|
||||
'RMB': '¥',
|
||||
'RON': 'lei',
|
||||
'RSD': 'Дин.',
|
||||
'RUB': '₽',
|
||||
'RWF': 'R₣',
|
||||
'SAR': '﷼',
|
||||
'SBD': '$',
|
||||
'SCR': '₨',
|
||||
'SDG': 'ج.س.',
|
||||
'SEK': 'kr',
|
||||
'SGD': '$',
|
||||
'SHP': '£',
|
||||
'SLL': 'Le',
|
||||
'SOS': 'S',
|
||||
'SRD': '$',
|
||||
'SSP': '£',
|
||||
'STD': 'Db',
|
||||
'STN': 'Db',
|
||||
'SVC': '$',
|
||||
'SYP': '£',
|
||||
'SZL': 'E',
|
||||
'THB': '฿',
|
||||
'TJS': 'SM',
|
||||
'TMT': 'T',
|
||||
'TND': 'د.ت',
|
||||
'TOP': 'T$',
|
||||
'TRL': '₤',
|
||||
'TRY': '₺',
|
||||
'TTD': 'TT$',
|
||||
'TVD': '$',
|
||||
'TWD': 'NT$',
|
||||
'TZS': 'TSh',
|
||||
'UAH': '₴',
|
||||
'UGX': 'USh',
|
||||
'USD': '$',
|
||||
'UYU': '$U',
|
||||
'UZS': 'лв',
|
||||
'VEF': 'Bs',
|
||||
'VND': '₫',
|
||||
'VUV': 'VT',
|
||||
'WST': 'WS$',
|
||||
'XAF': 'FCFA',
|
||||
'XBT': 'Ƀ',
|
||||
'XCD': '$',
|
||||
'XOF': 'CFA',
|
||||
'XPF': '₣',
|
||||
'YER': '﷼',
|
||||
'ZAR': 'R',
|
||||
'ZWD': 'Z$'
|
||||
};
|
||||
|
||||
root.getCurrencySymbol = function(code) {
|
||||
code = code.toUpperCase();
|
||||
|
||||
if (root.currencySymbols[code]) {
|
||||
$log.debug("Currency symbol for "+code+" found");
|
||||
return root.currencySymbols[code];
|
||||
}
|
||||
$log.debug("Currency symbol for "+code+" not found");
|
||||
return false;
|
||||
};
|
||||
|
||||
return root;
|
||||
|
||||
});
|
||||
|
|
@ -233,6 +233,10 @@ input[type=number] {
|
|||
font-size: 24px;
|
||||
}
|
||||
|
||||
.size-25 {
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.size-28 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@
|
|||
ion-content {
|
||||
|
||||
&.collapsible {
|
||||
margin-top: 210px;
|
||||
margin-top: 230px;
|
||||
}
|
||||
|
||||
padding-top: 0;
|
||||
|
|
@ -190,12 +190,32 @@
|
|||
transform: translateY(100px);
|
||||
}
|
||||
}
|
||||
|
||||
.buttons {
|
||||
margin-bottom: 0;
|
||||
margin-top: 6px;
|
||||
>.col {
|
||||
padding: 5px 10px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.button {
|
||||
border: 2px solid;
|
||||
border-radius: 47px;
|
||||
padding: 0 15px 0 15px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
font-size: 19px;
|
||||
font-weight: bolder;
|
||||
min-height: 45px;
|
||||
line-height: 45px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.amount {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
height: 210px;
|
||||
height: 230px;
|
||||
padding-top: 40px;
|
||||
display: block;
|
||||
align-items: center;
|
||||
|
|
|
|||
|
|
@ -23,20 +23,22 @@
|
|||
</div>
|
||||
|
||||
<div class="buttons row">
|
||||
<div class="col">
|
||||
<div class="button button-outline button-grey-outline" ui-sref="tabs.receive">
|
||||
<span translate>Receive</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="button button-outline button-grey-outline" ng-class="{'ng-hide': walletsWithFunds.length}" ui-sref="tabs.buyandsell">
|
||||
<span translate>Buy Bitcoin</span>
|
||||
</div>
|
||||
<div class="button button-outline button-grey-outline" ng-class="{'ng-hide': !walletsWithFunds.length}" ui-sref="tabs.send">
|
||||
<span translate>Send</span>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="button button-outline button-grey-outline" ui-sref="tabs.receive">
|
||||
<span translate>Receive</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="button button-outline button-grey-outline" ng-class="{'ng-hide': walletsWithFunds.length}"
|
||||
ui-sref="tabs.buyandsell">
|
||||
<span translate>Buy Bitcoin</span>
|
||||
</div>
|
||||
<div class="button button-outline button-grey-outline" ng-class="{'ng-hide': !walletsWithFunds.length}"
|
||||
ui-sref="tabs.send">
|
||||
<span translate>Send</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list card homeTip" ng-if="homeTip">
|
||||
<div class="item item-icon-right item-heading">
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
on-hold="hideToggle()"
|
||||
ng-style="{'transform': amountScale}"
|
||||
ng-class="{amount__balance: amountIsCollapsible}">
|
||||
<strong class="size-36">{{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}</strong>
|
||||
<strong class="size-25">{{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}</strong>
|
||||
<div
|
||||
class="size-14 amount-alternative"
|
||||
ng-if="status.totalBalanceAlternative && wallet.network == 'livenet'"
|
||||
|
|
@ -48,12 +48,12 @@
|
|||
on-hold="hideToggle()"
|
||||
ng-style="{'transform': amountScale}"
|
||||
ng-class="{amount__balance: amountIsCollapsible}">
|
||||
<strong class="size-36">{{status.totalBalanceStr}}</strong>
|
||||
<strong class="size-25">{{status.totalBalanceStr}}</strong>
|
||||
<div
|
||||
class="size-14 amount-alternative"
|
||||
ng-if="status.totalBalanceAlternative && wallet.network == 'livenet'"
|
||||
ng-style="{opacity: altAmountOpacity}">
|
||||
{{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
|
||||
{{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -86,11 +86,25 @@
|
|||
</strong>
|
||||
|
||||
<span>
|
||||
{{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}}
|
||||
{{currencySymbol(status.alternativeIsoCode)}} {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="buttons row">
|
||||
<div class="col">
|
||||
<div class="button button-outline button-white-outline" ui-sref="tabs.receive">
|
||||
<span translate>Receive</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="button button-outline button-white-outline" ng-if="!status.availableBalanceSat" ui-sref="tabs.buyandsell">
|
||||
<span translate>Buy Bitcoin</span>
|
||||
</div>
|
||||
<div class="button button-outline button-white-outline" ng-if="status.availableBalanceSat>0" ui-sref="tabs.send">
|
||||
<span translate>Send</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wallet-details-wallet-info" ng-style="{opacity: altAmountOpacity}">
|
||||
<span ng-include="'views/includes/walletInfo.html'"></span>
|
||||
|
|
@ -127,12 +141,12 @@
|
|||
on-hold="hideToggle()"
|
||||
ng-style="{'transform': amountScale}"
|
||||
ng-class="{amount__balance: amountIsCollapsible}">
|
||||
<strong class="size-36">{{status.totalBalanceStr}}</strong>
|
||||
<strong class="size-25">{{status.totalBalanceStr}}</strong>
|
||||
<div
|
||||
class="size-14 amount-alternative"
|
||||
ng-if="status.totalBalanceAlternative && wallet.network == 'livenet'"
|
||||
ng-style="{opacity: altAmountOpacity}">
|
||||
{{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
|
||||
{{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -142,9 +156,9 @@
|
|||
on-hold="hideToggle()"
|
||||
ng-style="{'transform': amountScale}"
|
||||
ng-class="{amount__balance: amountIsCollapsible}">
|
||||
<strong class="size-36">{{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}</strong>
|
||||
<strong class="size-25">{{currencySymbol(status.alternativeIsoCode)}} {{status.totalBalanceAlternative}} {{status.alternativeIsoCode}}</strong>
|
||||
<div
|
||||
class="size-14 amount-alternative"
|
||||
class="size-16 amount-alternative"
|
||||
ng-if="status.totalBalanceAlternative && wallet.network == 'livenet'"
|
||||
ng-style="{opacity: altAmountOpacity}">
|
||||
{{status.totalBalanceStr}}
|
||||
|
|
@ -156,7 +170,7 @@
|
|||
ng-show="!updateStatusError && wallet.balanceHidden && !wallet.scanning"
|
||||
on-hold="hideToggle()">
|
||||
<strong class="size-24" translate>[Balance Hidden]</strong>
|
||||
<div ng-style="{opacity: altAmountOpacity}" class="size-14 amount-alternative" translate>
|
||||
<div ng-style="{opacity: altAmountOpacity}" class="size-16 amount-alternative" translate>
|
||||
Tap and hold to show
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -166,7 +180,7 @@
|
|||
class="amount__balance"
|
||||
ng-show="!updateStatusError && wallet.scanning">
|
||||
<strong class="size-24" translate>[Scanning Funds]</strong>
|
||||
<div ng-style="{opacity: altAmountOpacity}" class="size-14 amount-alternative" translate>
|
||||
<div ng-style="{opacity: altAmountOpacity}" class="size-16 amount-alternative" translate>
|
||||
Please wait
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -180,7 +194,7 @@
|
|||
</strong>
|
||||
|
||||
<span>
|
||||
{{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}}
|
||||
{{currencySymbol(status.alternativeIsoCode)}} {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -189,7 +203,7 @@
|
|||
<button class="button button-standard button-primary amount__button-balance size-14" ng-click="openBalanceModal()">
|
||||
<i class="icon ion-ios-checkmark-outline"></i>
|
||||
<strong>
|
||||
{{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}}
|
||||
{{currencySymbol(status.alternativeIsoCode)}} {{status.spendableBalanceAlternative}} {{status.alternativeIsoCode}}
|
||||
</strong>
|
||||
|
||||
<span>
|
||||
|
|
@ -235,7 +249,7 @@
|
|||
<div class="item item-footer description" ng-show="status.lockedBalanceSat" style="background: white;">
|
||||
<span translate>Total Locked Balance</span>:
|
||||
<b>{{status.lockedBalanceStr}} </b>
|
||||
<span> {{status.lockedBalanceAlternative}} {{status.alternativeIsoCode}} </span>
|
||||
<span> {{currencySymbol(status.alternativeIsoCode)}} {{status.lockedBalanceAlternative}} {{status.alternativeIsoCode}} </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue