From 31729e41cf43996d9d804d4e4993932c9009af9f Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Tue, 26 Jul 2022 15:54:08 +0300 Subject: [PATCH] feat: shuffle the UI --- .../static/components/payment/payment.html | 151 +++++++++++++----- .../static/components/payment/payment.js | 8 + .../static/components/utxo-list/utxo-list.js | 2 +- 3 files changed, 118 insertions(+), 43 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/payment/payment.html b/lnbits/extensions/watchonly/static/components/payment/payment.html index 5a6afe46..9a9a430c 100644 --- a/lnbits/extensions/watchonly/static/components/payment/payment.html +++ b/lnbits/extensions/watchonly/static/components/payment/payment.html @@ -32,7 +32,7 @@ - {{satBtc(getTotalPaymentAmount())}} + {{satBtc(totalPayedAmount)}} @@ -86,7 +86,7 @@
- Fee: - - {{satBtc(feeValue)}} - - Fee Rate: + Fee Rate: {{feeRate}} sats/vbyte + Fee: + + {{satBtc(feeValue)}} +
@@ -118,6 +118,107 @@ + + + +
+
+ +
+ +
+
+ Balance: + + {{satBtc(balance)}} + + Selected: + + {{satBtc(selectedAmount)}} + +
+
+
+ +
+
+ + +
+
+
+
+ + + +
+
+ +
+ +
+
+ Change: + + {{satBtc(balance)}} + +
+
+
+ +
+
+ +
+
Change Account:
+
+ +
+
+ +
+
+
+
+
+
+
- -
-
Change Account:
-
- -
-
- -
-
-
+
- diff --git a/lnbits/extensions/watchonly/static/components/payment/payment.js b/lnbits/extensions/watchonly/static/components/payment/payment.js index 6d6428a2..ab844808 100644 --- a/lnbits/extensions/watchonly/static/components/payment/payment.js +++ b/lnbits/extensions/watchonly/static/components/payment/payment.js @@ -30,6 +30,8 @@ async function payment(path) { changeAddress: {}, changeAmount: 0, showCustomFee: false, + showCoinSelect: false, + showChange: false, feeRate: 1 } }, @@ -50,6 +52,12 @@ async function payment(path) { return this.utxos .filter(utxo => utxo.selected) .reduce((t, a) => t + (a.amount || 0), 0) + }, + balance: function () { + return this.utxos.reduce((t, a) => t + (a.amount || 0), 0) + }, + totalPayedAmount: function () { + return this.sendToList.reduce((t, a) => t + (a.amount || 0), 0) } }, diff --git a/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js b/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js index 9e71f3a1..3b5c3974 100644 --- a/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js +++ b/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js @@ -108,7 +108,7 @@ async function utxoList(path) { this.utxos.forEach(u => (u.selected = true)) return } - + this.utxos.forEach(u => (u.selected = false)) const isManual = mode === 'Manual' if (isManual || !this.payedAmount) return