taler-ios

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

commit 0cddeb6e08da42bae1b9f9c027a613e3ca174852
parent f4ea12491f0ad10ebe766bd4c925cdb5bb2c7bc7
Author: Marc Stibane <marc@taler.net>
Date:   Fri,  2 Aug 2024 15:25:03 +0200

CopyShare for QR, with separate content

Diffstat:
MTalerWallet1/Views/HelperViews/QRCodeDetailView.swift | 7++++---
MTalerWallet1/Views/Peer2peer/SendAmount.swift | 7++++---
MTalerWallet1/Views/Transactions/ManualDetailsV.swift | 3+++
MTalerWallet1/Views/Transactions/TransactionDetailV.swift | 2+-
MTalerWallet1/Views/Transactions/TransactionSummaryV.swift | 3++-
5 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift @@ -12,6 +12,7 @@ import AVFoundation struct QRCodeDetailView: View { let talerURI: String + let talerCopyShare: String let incoming: Bool let amount: Amount @@ -36,7 +37,7 @@ struct QRCodeDetailView: View { .talerFont(.title3) // .padding(.vertical) .listRowSeparator(.hidden) - CopyShare(textToCopy: talerURI) + CopyShare(textToCopy: talerCopyShare) .disabled(false) // .padding(.bottom) .listRowSeparator(.hidden) @@ -87,12 +88,12 @@ struct QRCodeDetailView: View { // MARK: - #if DEBUG fileprivate struct ContentView: View { - @State var talerURI: String = "taler://pay-push/exchange.demo.taler.net/95ZG4D1AGFGZQ7CNQ1V49D3FT18HXKA6HQT4X3XME9YSJQVFQ520" + @State var previewURI: String = "taler://pay-push/exchange.demo.taler.net/95ZG4D1AGFGZQ7CNQ1V49D3FT18HXKA6HQT4X3XME9YSJQVFQ520" var body: some View { let amount = Amount(currency: LONGCURRENCY, cent: 123) List { - QRCodeDetailView(talerURI: talerURI, incoming: false, amount: amount) + QRCodeDetailView(talerURI: previewURI, talerCopyShare: previewURI, incoming: false, amount: amount) } } } diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift b/TalerWallet1/Views/Peer2peer/SendAmount.swift @@ -86,15 +86,16 @@ struct SendAmount: View { peerPushCheck = ppCheck let feeLabel = feeLabel(feeStr) // announce("\(amountVoiceOver), \(feeLabel)") - return ComputeFeeResult(insufficient: insufficient, feeAmount: fee, - feeStr: feeLabel, numCoins: nil) + return ComputeFeeResult(insufficient: insufficient, + feeAmount: fee, + feeStr: feeLabel, + numCoins: nil) } else { peerPushCheck = nil } } catch { // handle cancel, errors symLog.log("❗️ \(error)") - } return nil } diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift b/TalerWallet1/Views/Transactions/ManualDetailsV.swift @@ -209,6 +209,9 @@ struct ManualDetailsV: View { .frame(maxWidth: .infinity, alignment: .center) .accessibilityLabel("QR Code") .listRowSeparator(.hidden) + CopyShare(textToCopy: spec.qrContent) + .disabled(false) +// .padding(.bottom) // Text(specDetails) // .listRowSeparator(.automatic) diff --git a/TalerWallet1/Views/Transactions/TransactionDetailV.swift b/TalerWallet1/Views/Transactions/TransactionDetailV.swift @@ -18,7 +18,7 @@ struct TransactionDetailV: View { let info = details.info Section { if let posConfirmation = details.posConfirmation { - Text("Confirmation:") + Text("Confirmation:", comment: "purchase may have a pos validation / confirmation") .talerFont(.title3) .listRowSeparator(.hidden) Text(posConfirmation) diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift @@ -494,6 +494,7 @@ struct TransactionSummaryV: View { if let talerURI = details[TALERURI] { if talerURI.count > 10 { QRCodeDetailView(talerURI: talerURI, + talerCopyShare: talerURI, incoming: transaction.isP2pIncoming, amount: transaction.common.amountRaw) } @@ -507,7 +508,7 @@ struct TransactionSummaryV: View { } } } -} +} // TransactionSummaryV // MARK: - #if DEBUG //struct TransactionSummary_Previews: PreviewProvider {