[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 22/32: CallStack
From: |
gnunet |
Subject: |
[taler-taler-ios] 22/32: CallStack |
Date: |
Sat, 10 Feb 2024 15:04:48 +0100 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit 19745a240c51c38a867d3fdfc8f02a0acc8471fb
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Feb 8 17:19:59 2024 +0100
CallStack
---
.../Views/Sheets/P2P_Sheets/P2pPayURIView.swift | 3 +-
.../Sheets/P2P_Sheets/P2pReceiveURIView.swift | 3 +-
.../Views/Sheets/Payment/PayTemplateView.swift | 6 ++--
.../Views/Sheets/Payment/PaymentView.swift | 6 ++--
.../WithdrawBankIntegrated/WithdrawURIView.swift | 3 +-
.../Views/Transactions/ThreeAmountsV.swift | 31 ++++++++++++---------
.../Views/Transactions/TransactionSummaryV.swift | 32 ++++++++++++----------
7 files changed, 50 insertions(+), 34 deletions(-)
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
index 50ecfdb..b27203f 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
@@ -29,7 +29,8 @@ struct P2pPayURIView: View {
let effective = peerPullDebitResponse.amountEffective
let currency = raw.currencyStr
let fee = try! Amount.diff(raw, effective)
- ThreeAmountsV(topTitle: String(localized: "Amount to
pay:"),
+ ThreeAmountsV(stack: stack.push(),
+ topTitle: String(localized: "Amount to
pay:"),
topAbbrev: String(localized: "Pay:", comment:
"mini"),
topAmount: raw, fee: fee,
bottomTitle: String(localized: "Amount to be
spent:"),
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
index 72e1022..07968fb 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
@@ -37,7 +37,8 @@ struct P2pReceiveURIView: View {
let effective = peerPushCreditResponse.amountEffective
let currency = raw.currencyStr
let fee = try! Amount.diff(raw, effective)
- ThreeAmountsV(topTitle: String(localized: "Gross Amount to
receive:"),
+ ThreeAmountsV(stack: stack.push(),
+ topTitle: String(localized: "Gross Amount to
receive:"),
topAbbrev: String(localized: "Receive
gross:", comment: "mini"),
topAmount: raw, fee: fee,
bottomTitle: String(localized: "Net Amount to
receive:"),
diff --git a/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift
b/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift
index 609bf44..4670af6 100644
--- a/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift
+++ b/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift
@@ -59,7 +59,8 @@ struct PayTemplateView: View {
if let effective {
// TODO: already paid
let fee = try! Amount.diff(raw, effective) // TODO:
different currencies
- ThreeAmountsV(topTitle: topTitle,
+ ThreeAmountsV(stack: stack.push(),
+ topTitle: topTitle,
topAbbrev: topAbbrev,
topAmount: raw, fee: fee,
bottomTitle: String(localized: "Amount to
spend:"),
@@ -74,7 +75,8 @@ struct PayTemplateView: View {
} else if let balanceDetails = preparePayResult.balanceDetails
{ // Insufficient
Text("You don't have enough \(currency)")
.accessibilityFont(.body)
- ThreeAmountsV(topTitle: topTitle,
+ ThreeAmountsV(stack: stack.push(),
+ topTitle: topTitle,
topAbbrev: topAbbrev,
topAmount: raw, fee: nil,
bottomTitle: String(localized: "Amount
available:"),
diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
index 2be6497..3776129 100644
--- a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
+++ b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
@@ -36,7 +36,8 @@ struct PaymentView: View {
if let effective {
// TODO: already paid
let fee = try! Amount.diff(raw, effective) // TODO:
different currencies
- ThreeAmountsV(topTitle: topTitle,
+ ThreeAmountsV(stack: stack.push(),
+ topTitle: topTitle,
topAbbrev: topAbbrev,
topAmount: raw, fee: fee,
bottomTitle: String(localized: "Amount to
spend:"),
@@ -51,7 +52,8 @@ struct PaymentView: View {
} else if let balanceDetails = preparePayResult.balanceDetails
{ // Insufficient
Text("You don't have enough \(currency)")
.accessibilityFont(.headline)
- ThreeAmountsV(topTitle: topTitle,
+ ThreeAmountsV(stack: stack.push(),
+ topTitle: topTitle,
topAbbrev: topAbbrev,
topAmount: raw, fee: nil,
bottomTitle: String(localized: "Amount
available:"),
diff --git
a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
index f3b3dc8..43b04c3 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
@@ -43,7 +43,8 @@ struct WithdrawURIView: View {
let outColor = WalletColors().transactionColor(false)
let inColor = WalletColors().transactionColor(true)
- ThreeAmountsV(topTitle: String(localized: "Chosen amount
to withdraw:"),
+ ThreeAmountsV(stack: stack.push(),
+ topTitle: String(localized: "Chosen amount
to withdraw:"),
topAbbrev: String(localized: "Chosen:",
comment: "mini"),
topAmount: raw, fee: fee,
bottomTitle: String(localized: "Amount to be
withdrawn:"),
diff --git a/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
b/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
index 31b7d07..76af34a 100644
--- a/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
+++ b/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
@@ -6,6 +6,7 @@ import SwiftUI
import taler_swift
struct ThreeAmountsSheet: View {
+ let stack: CallStack
var common: TransactionCommon
var topAbbrev: String
var topTitle: String
@@ -33,19 +34,22 @@ struct ThreeAmountsSheet: View {
: String(localized:
"Obtained:", comment: "mini") )
: (pending ? String(localized:
"Pay:", comment: "mini")
: String(localized:
"Paid:", comment: "mini") )
- ThreeAmountsV(topTitle: topTitle, topAbbrev: topAbbrev, topAmount:
raw, fee: fee,
- bottomTitle: bottomTitle ?? defaultBottomTitle,
- bottomAbbrev: bottomAbbrev ?? defaultBottomAbbrev,
- bottomAmount: incomplete ? nil : effective,
- large: large, pending: pending, incoming: incoming,
- baseURL: baseURL,
- status: common.txState.major.localizedState,
- summary: summary,
- merchant: merchant)
+ ThreeAmountsV(stack: stack.push(),
+ topTitle: topTitle, topAbbrev: topAbbrev,
+ topAmount: raw, fee: fee,
+ bottomTitle: bottomTitle ?? defaultBottomTitle,
+ bottomAbbrev: bottomAbbrev ?? defaultBottomAbbrev,
+ bottomAmount: incomplete ? nil : effective,
+ large: large, pending: pending, incoming: incoming,
+ baseURL: baseURL,
+ status: common.txState.major.localizedState,
+ summary: summary,
+ merchant: merchant)
}
}
// MARK: -
struct ThreeAmountsV: View {
+ let stack: CallStack
var topTitle: String
var topAbbrev: String
var topAmount: Amount
@@ -88,7 +92,7 @@ struct ThreeAmountsV: View {
.accessibilityElement(children: .combine)
if let fee {
AmountRowV(title: minimalistic ? String(localized: "Fee
(short):", defaultValue:"Fee:", comment:"short version")
- : String(localized: "Fee (long):",
defaultValue:"Fee:", comment:"long version"),
+ : String(localized: "Fee
(long):", defaultValue:"Fee:", comment:"long version"),
amount: fee,
color: labelColor,
large: false)
@@ -141,9 +145,10 @@ struct ThreeAmounts_Previews: PreviewProvider {
txActions: [])
Group {
List {
- ThreeAmountsSheet(common: common, topAbbrev: "Withdrawal",
- topTitle: "Withdrawal", baseURL: DEMOEXCHANGE,
- large: 1==0, summary: nil, merchant: nil)
+ ThreeAmountsSheet(stack: CallStack("Preview"),
+ common: common, topAbbrev: "Withdrawal",
+ topTitle: "Withdrawal", baseURL: DEMOEXCHANGE,
+ large: 1==0, summary: nil, merchant: nil)
.safeAreaInset(edge: .bottom) {
Button(String(localized: "Accept"), action: {})
.buttonStyle(TalerButtonStyle(type: .prominent))
diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift
b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift
index aa1e548..5eea652 100644
--- a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift
+++ b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift
@@ -137,7 +137,8 @@ struct TransactionSummaryV: View {
}
} .listRowSeparator(.automatic)
.accessibilityFont(.title)
- TypeDetail(transaction: $transaction, hasDone: doneAction !=
nil)
+ TypeDetail(stack: stack.push(),
+ transaction: $transaction, hasDone: doneAction !=
nil)
// if transaction.isRetryable { if let retryAction {
// TransactionButton(transactionId: common.transactionId,
command: .retry,
@@ -238,6 +239,7 @@ struct TransactionSummaryV: View {
}
struct TypeDetail: View {
+ let stack: CallStack
@Binding var transaction: Transaction
let hasDone: Bool
@@ -275,27 +277,25 @@ struct TransactionSummaryV: View {
} } } }
} // switch
} // ManualDetails or Confirm now (with bank)
- ThreeAmountsSheet(common: common, topAbbrev:
String(localized: "Chosen:", comment: "mini"),
+ ThreeAmountsSheet(stack: stack.push(),
+ common: common, topAbbrev:
String(localized: "Chosen:", comment: "mini"),
topTitle: String(localized: "Chosen
amount to withdraw:"),
baseURL: details.exchangeBaseUrl,
large: false,
summary: nil, merchant: nil)
}
case .deposit(let depositTransaction): Group {
let details = depositTransaction.details
- ThreeAmountsSheet(common: common, topAbbrev:
String(localized: "Deposit:", comment: "mini"),
+ ThreeAmountsSheet(stack: stack.push(),
+ common: common, topAbbrev:
String(localized: "Deposit:", comment: "mini"),
topTitle: String(localized: "Amount
to deposit:"),
baseURL: nil, large: true,
// TODO: baseURL
summary: nil, merchant: nil)
}
case .payment(let paymentTransaction): Group {
let details = paymentTransaction.details
- NavigationLink(destination: LazyView {
- LoadingView(url: nil, message: "Details")
- }) {
- Text("Show details")
- }
-// .buttonStyle(TalerButtonStyle(type: .bordered))
- ThreeAmountsSheet(common: common, topAbbrev:
String(localized: "Price:", comment: "mini"),
+// TransactionDetailV(paymentTx: paymentTransaction)
+ ThreeAmountsSheet(stack: stack.push(),
+ common: common, topAbbrev:
String(localized: "Price:", comment: "mini"),
topTitle: String(localized: "Price
(net):"),
baseURL: nil, large: true,
// TODO: baseURL
summary: details.info.summary,
@@ -303,7 +303,8 @@ struct TransactionSummaryV: View {
}
case .refund(let refundTransaction): Group {
let details = refundTransaction.details
// TODO: more details
- ThreeAmountsSheet(common: common, topAbbrev:
String(localized: "Refunded:", comment: "mini"),
+ ThreeAmountsSheet(stack: stack.push(),
+ common: common, topAbbrev:
String(localized: "Refunded:", comment: "mini"),
topTitle: String(localized: "Refunded
amount:"),
baseURL: nil, large: true,
// TODO: baseURL
summary: details.info?.summary,
@@ -311,7 +312,8 @@ struct TransactionSummaryV: View {
}
case .reward(let rewardTransaction): Group {
let details = rewardTransaction.details
- ThreeAmountsSheet(common: common, topAbbrev:
String(localized: "Reward:", comment: "mini"),
+ ThreeAmountsSheet(stack: stack.push(),
+ common: common, topAbbrev:
String(localized: "Reward:", comment: "mini"),
topTitle: String(localized: "Received
Reward:"),
baseURL: details.exchangeBaseUrl,
large: true,
summary: nil, merchant: nil)
// TODO: summary
@@ -319,7 +321,8 @@ struct TransactionSummaryV: View {
case .refresh(let refreshTransaction): Group {
let details = refreshTransaction.details
// TODO: details
Text(details.refreshReason.rawValue)
- ThreeAmountsSheet(common: common, topAbbrev:
String(localized: "Refreshed:", comment: "mini"),
+ ThreeAmountsSheet(stack: stack.push(),
+ common: common, topAbbrev:
String(localized: "Refreshed:", comment: "mini"),
topTitle: String(localized: "Refreshed
amount:"),
baseURL: nil, large: true,
// TODO: baseURL
summary: nil, merchant: nil)
@@ -353,7 +356,8 @@ struct TransactionSummaryV: View {
let colon = ":"
let localizedType = transaction.isDone ?
transaction.localizedTypePast
:
transaction.localizedType
- ThreeAmountsSheet(common: common,
+ ThreeAmountsSheet(stack: stack.push(),
+ common: common,
topAbbrev: localizedType + colon,
topTitle: localizedType + colon,
baseURL: details.exchangeBaseUrl,
large: false,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 30/32: Bump version to 0.9.4 (3), (continued)
- [taler-taler-ios] 30/32: Bump version to 0.9.4 (3), gnunet, 2024/02/10
- [taler-taler-ios] 18/32: Dismiss P2P without showing details again, gnunet, 2024/02/10
- [taler-taler-ios] 32/32: remove reward, gnunet, 2024/02/10
- [taler-taler-ios] 31/32: Wording, gnunet, 2024/02/10
- [taler-taler-ios] 12/32: devExperiment Refresh, gnunet, 2024/02/10
- [taler-taler-ios] 11/32: Identifiable, gnunet, 2024/02/10
- [taler-taler-ios] 28/32: RotatingTaler while waiting for tx to finish, gnunet, 2024/02/10
- [taler-taler-ios] 23/32: TransactionDetailV, gnunet, 2024/02/10
- [taler-taler-ios] 19/32: Show merchant in payment details, gnunet, 2024/02/10
- [taler-taler-ios] 15/32: githash 7 chars, gnunet, 2024/02/10
- [taler-taler-ios] 22/32: CallStack,
gnunet <=
- [taler-taler-ios] 10/32: ScrollVStack, gnunet, 2024/02/10
- [taler-taler-ios] 24/32: static func <, gnunet, 2024/02/10
- [taler-taler-ios] 29/32: cleanup, gnunet, 2024/02/10
- [taler-taler-ios] 25/32: use ScopeInfo, gnunet, 2024/02/10