taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit 0c0f3b1aeed93caf4aba69d27bbda8b4afc87003
parent 66adf65031d27f9e23cc59dd2cf7a31efa717733
Author: Marc Stibane <marc@taler.net>
Date:   Wed,  3 Jan 2024 17:44:58 +0100

Summary in ThreeAmountsV

Diffstat:
MTalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift | 4+++-
MTalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift | 4+++-
MTalerWallet1/Views/Sheets/Payment/PayTemplateView.swift | 8++++++--
MTalerWallet1/Views/Sheets/Payment/PaymentView.swift | 8++++++--
MTalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift | 4+++-
MTalerWallet1/Views/Transactions/ThreeAmountsV.swift | 16+++++++++++++---
6 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift @@ -36,7 +36,9 @@ struct P2pPayURIView: View { bottomAbbrev: String(localized: "Effective:"), bottomAmount: effective, large: false, pending: false, incoming: false, - baseURL: nil) + baseURL: nil, + status: nil, + summary: peerPullDebitResponse.contractTerms.summary) } .listStyle(myListStyle.style).anyView .navigationTitle(navTitle) diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift @@ -38,7 +38,9 @@ struct P2pReceiveURIView: View { bottomAbbrev: String(localized: "Effective:"), bottomAmount: effective, large: false, pending: false, incoming: true, - baseURL: nil) + baseURL: nil, + status: nil, + summary: peerPushCreditResponse.contractTerms.summary) } .listStyle(myListStyle.style).anyView .navigationTitle(navTitle) diff --git a/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift b/TalerWallet1/Views/Sheets/Payment/PayTemplateView.swift @@ -66,7 +66,9 @@ struct PayTemplateView: View { bottomAbbrev: String(localized: "Effective:"), bottomAmount: effective, large: false, pending: false, incoming: false, - baseURL: baseURL) + baseURL: baseURL, + status: nil, + summary: nil) // TODO: payment: popup with all possible exchanges, check fees } else if let balanceDetails = preparePayResult.balanceDetails { // Insufficient Text("You don't have enough \(currency)") @@ -78,7 +80,9 @@ struct PayTemplateView: View { bottomAbbrev: String(localized: "Available:"), bottomAmount: balanceDetails.balanceAvailable, large: false, pending: false, incoming: false, - baseURL: baseURL) + baseURL: baseURL, + status: nil, + summary: nil) } else { // TODO: Error - neither effective nor balanceDetails Text("Error") diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift @@ -62,7 +62,9 @@ struct PaymentView: View { bottomAbbrev: String(localized: "Effective:"), bottomAmount: effective, large: false, pending: false, incoming: false, - baseURL: baseURL) + baseURL: baseURL, + status: nil, + summary: terms.summary) // TODO: payment: popup with all possible exchanges, check fees } else if let balanceDetails = preparePayResult.balanceDetails { // Insufficient Text("You don't have enough \(currency)") @@ -74,7 +76,9 @@ struct PaymentView: View { bottomAbbrev: String(localized: "Available:"), bottomAmount: balanceDetails.balanceAvailable, large: false, pending: false, incoming: false, - baseURL: baseURL) + baseURL: baseURL, + status: nil, + summary: terms.summary) } else { // TODO: Error - neither effective nor balanceDetails Text("Error") diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift @@ -43,7 +43,9 @@ struct WithdrawURIView: View { bottomAbbrev: String(localized: "Effective:"), bottomAmount: effective, large: false, pending: false, incoming: true, - baseURL: exchange.exchangeBaseUrl) + baseURL: exchange.exchangeBaseUrl, + status: nil, // common.txState.major.localizedState + summary: nil) let someCoins = SomeCoins(details: withdrawalAmountDetails) QuiteSomeCoins(someCoins: someCoins, shouldShowFee: true, // TODO: set to false if we never charge withdrawal fees diff --git a/TalerWallet1/Views/Transactions/ThreeAmountsV.swift b/TalerWallet1/Views/Transactions/ThreeAmountsV.swift @@ -13,6 +13,7 @@ struct ThreeAmountsSheet: View { var bottomAbbrev: String? let baseURL: String? let large: Bool // set to false for QR or IBAN + let summary: String? var body: some View { let raw = common.amountRaw @@ -35,7 +36,8 @@ struct ThreeAmountsSheet: View { bottomAmount: incomplete ? nil : effective, large: large, pending: pending, incoming: incoming, baseURL: baseURL, - status: common.txState.major.localizedState) + status: common.txState.major.localizedState, + summary: summary) } } // MARK: - @@ -51,7 +53,8 @@ struct ThreeAmountsV: View { let pending: Bool let incoming: Bool let baseURL: String? - var status: String? + let status: String? + let summary: String? @AppStorage("iconOnly") var iconOnly: Bool = false @@ -60,6 +63,12 @@ struct ThreeAmountsV: View { let foreColor = pending ? WalletColors().pendingColor(incoming) : WalletColors().transactionColor(incoming) Section { + if let summary { + Text(summary) + .accessibilityFont(.title2) + .lineLimit(4) + .padding(.bottom) + } AmountView(title: iconOnly ? topAbbrev : topTitle, value: topAmount.readableDescription, color: labelColor, @@ -122,7 +131,8 @@ struct ThreeAmounts_Previews: PreviewProvider { Group { List { ThreeAmountsSheet(common: common, topAbbrev: "Withdrawal", - topTitle: "Withdrawal", baseURL: DEMOEXCHANGE, large: 1==0) + topTitle: "Withdrawal", baseURL: DEMOEXCHANGE, + large: 1==0, summary: nil) .safeAreaInset(edge: .bottom) { Button(String(localized: "Accept"), action: {}) .buttonStyle(TalerButtonStyle(type: .prominent))