amount on custom amount screen
This commit is contained in:
parent
fb275d4b08
commit
8ddfffd56b
3 changed files with 69 additions and 18 deletions
|
|
@ -64,6 +64,14 @@ angular.module('copayApp.controllers').controller('customAmountController', func
|
||||||
var currency = parsedAmount.currency;
|
var currency = parsedAmount.currency;
|
||||||
$scope.amountUnitStr = parsedAmount.amountUnitStr;
|
$scope.amountUnitStr = parsedAmount.amountUnitStr;
|
||||||
|
|
||||||
|
configService.whenAvailable(function (config) {
|
||||||
|
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
|
||||||
|
|
||||||
|
$timeout(function () {
|
||||||
|
$scope.$apply();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
if (currency != 'BTC' && currency != 'BCH') {
|
if (currency != 'BTC' && currency != 'BCH') {
|
||||||
// Convert to BTC or BCH
|
// Convert to BTC or BCH
|
||||||
var config = configService.getSync().wallet.settings;
|
var config = configService.getSync().wallet.settings;
|
||||||
|
|
@ -71,7 +79,7 @@ angular.module('copayApp.controllers').controller('customAmountController', func
|
||||||
var btcParsedAmount = txFormatService.parseAmount($scope.wallet.coin, amountUnit, $scope.wallet.coin);
|
var btcParsedAmount = txFormatService.parseAmount($scope.wallet.coin, amountUnit, $scope.wallet.coin);
|
||||||
|
|
||||||
$scope.amountBtc = btcParsedAmount.amount;
|
$scope.amountBtc = btcParsedAmount.amount;
|
||||||
$scope.altAmountStr = btcParsedAmount.amountUnitStr;
|
$scope.altAmountStr = btcParsedAmount.amountUnitStr.toUpperCase();
|
||||||
} else {
|
} else {
|
||||||
$scope.amountBtc = amount; // BTC or BCH
|
$scope.amountBtc = amount; // BTC or BCH
|
||||||
$scope.altAmountStr = txFormatService.formatAlternativeStr($scope.wallet.coin, parsedAmount.amountSat);
|
$scope.altAmountStr = txFormatService.formatAlternativeStr($scope.wallet.coin, parsedAmount.amountSat);
|
||||||
|
|
|
||||||
|
|
@ -26,16 +26,10 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.qr-code {
|
.qr-code {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 24vh;
|
margin-top: 6px;
|
||||||
margin-bottom: 7vh;
|
qrcode canvas {
|
||||||
@media(max-height: 800px) {
|
height: 30vh;
|
||||||
margin-top: 18vh;
|
max-height: 220px;
|
||||||
}
|
|
||||||
@media(max-height: 700px) {
|
|
||||||
margin-top: 14vh;
|
|
||||||
}
|
|
||||||
@media(max-height: 600px) {
|
|
||||||
margin-top: 8vh;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.info {
|
.info {
|
||||||
|
|
@ -91,5 +85,34 @@
|
||||||
.address-types {
|
.address-types {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.amount {
|
||||||
|
margin-top: 20vh;
|
||||||
|
margin-bottom: 4vh;
|
||||||
|
@media(max-height: 800px) {
|
||||||
|
margin-top: 12vh;
|
||||||
|
margin-bottom: 6vh;
|
||||||
|
}
|
||||||
|
@media(max-height: 700px) {
|
||||||
|
margin-top: 10vh;
|
||||||
|
margin-bottom: 4vh;
|
||||||
|
}
|
||||||
|
@media(max-height: 600px) {
|
||||||
|
margin-top: 6vh;
|
||||||
|
margin-bottom: 2vh;
|
||||||
|
|
||||||
|
}
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
//padding-top: 30px;
|
||||||
|
display: block;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
&-alternative {
|
||||||
|
line-height: 36px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<ion-nav-buttons side="secondary">
|
<ion-nav-buttons side="secondary">
|
||||||
<button class="button-share ng-hide" ng-show="showShareButton" ng-click="shareAddress()">
|
<button class="button-share ng-hide" ng-show="showShareButton" ng-click="shareAddress()">
|
||||||
<i class="icon"
|
<i class="icon"
|
||||||
ng-class="{
|
ng-class="{
|
||||||
'ion-ios-upload-outline': showShareButton == 'iOS',
|
'ion-ios-upload-outline': showShareButton == 'iOS',
|
||||||
'ion-android-share-alt': showShareButton != 'iOS'
|
'ion-android-share-alt': showShareButton != 'iOS'
|
||||||
}"></i>
|
}"></i>
|
||||||
|
|
@ -22,36 +22,56 @@
|
||||||
<div class="address" ng-if="address && amountBtc">
|
<div class="address" ng-if="address && amountBtc">
|
||||||
<div ng-show="showingPaymentReceived" ng-click="showingPaymentReceived = false">
|
<div ng-show="showingPaymentReceived" ng-click="showingPaymentReceived = false">
|
||||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 130.2 130.2">
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 130.2 130.2">
|
||||||
<circle class="path circle" fill="none" stroke="#19B234" stroke-width="6" stroke-miterlimit="10" cx="65.1" cy="65.1" r="62.1"/>
|
<circle class="path circle" fill="none" stroke="#19B234" stroke-width="6" stroke-miterlimit="10" cx="65.1"
|
||||||
<polyline class="path check" fill="none" stroke="#19B234" stroke-width="6" stroke-linecap="round" stroke-miterlimit="10" points="100.2,40.2 51.5,88.8 29.8,67.5 "/>
|
cy="65.1" r="62.1"/>
|
||||||
|
<polyline class="path check" fill="none" stroke="#19B234" stroke-width="6" stroke-linecap="round"
|
||||||
|
stroke-miterlimit="10" points="100.2,40.2 51.5,88.8 29.8,67.5 "/>
|
||||||
</svg>
|
</svg>
|
||||||
<p class="success animated fadeIn" style="text-align: center">
|
<p class="success animated fadeIn" style="text-align: center">
|
||||||
<br/>Payment Received!<br/>
|
<br/>Payment Received!<br/>
|
||||||
<br/>Return To Address<br/>
|
<br/>Return To Address<br/>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div ng-show="!showingPaymentReceived" class="amount">
|
||||||
|
<div ng-show="selectedPriceDisplay=='fiat'">
|
||||||
|
<strong class="size-36">{{amountUnitStr}}</strong>
|
||||||
|
<div class="size-14 amount-alternative">
|
||||||
|
{{altAmountStr}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ng-show="selectedPriceDisplay=='crypto'">
|
||||||
|
<strong class="size-36">{{altAmountStr}}</strong>
|
||||||
|
<div class="size-14 amount-alternative">
|
||||||
|
{{amountUnitStr}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div ng-show="!showingPaymentReceived" class="qr-code" copy-to-clipboard="copyToClipboard()">
|
<div ng-show="!showingPaymentReceived" class="qr-code" copy-to-clipboard="copyToClipboard()">
|
||||||
<qrcode size="220" data="{{ protocolHandler }}:{{address + '?amount=' + amountBtc}}" color="#334"></qrcode>
|
<qrcode size="220" data="{{ protocolHandler }}:{{address + '?amount=' + amountBtc}}" color="#334"></qrcode>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="!showingPaymentReceived" ng-show="address && coin == 'bch'" class="address-types">
|
<div ng-show="!showingPaymentReceived" ng-show="address && coin == 'bch'" class="address-types">
|
||||||
<div>
|
<div>
|
||||||
<button ng-show="address && coin == 'bch' && bchAddressType != 'cashaddr'" class="button-address" ng-click="displayAddress('cashaddr')">
|
<button ng-show="address && coin == 'bch' && bchAddressType != 'cashaddr'" class="button-address"
|
||||||
|
ng-click="displayAddress('cashaddr')">
|
||||||
<span translate>Display new style address</span>
|
<span translate>Display new style address</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button ng-show="address && coin == 'bch' && bchAddressType != 'legacy'" class="button-address" ng-click="displayAddress('legacy')">
|
<button ng-show="address && coin == 'bch' && bchAddressType != 'legacy'" class="button-address"
|
||||||
|
ng-click="displayAddress('legacy')">
|
||||||
<span translate>Display legacy address</span>
|
<span translate>Display legacy address</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button ng-show="address && coin == 'bch' && bchAddressType != 'bitpay'" class="button-address" ng-click="displayAddress('bitpay')">
|
<button ng-show="address && coin == 'bch' && bchAddressType != 'bitpay'" class="button-address"
|
||||||
|
ng-click="displayAddress('bitpay')">
|
||||||
<span translate>Display BitPay address</span>
|
<span translate>Display BitPay address</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="item single-line" copy-to-clipboard="(coin == 'bch' && bchAddressType == 'cashaddr' ? 'bitcoincash:' : '') + address">
|
<div class="item single-line"
|
||||||
|
copy-to-clipboard="(coin == 'bch' && bchAddressType == 'cashaddr' ? 'bitcoincash:' : '') + address">
|
||||||
<span class="label" translate>Address</span>
|
<span class="label" translate>Address</span>
|
||||||
<span class="item-note ellipsis">
|
<span class="item-note ellipsis">
|
||||||
{{address}}
|
{{address}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue