taler-ios

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

commit b77c4065cc14fa9b2b884dd463d4aefca09b4373
parent 5747e3ce6c8901782c200e42270cc0a93c0d2948
Author: Marc Stibane <marc@taler.net>
Date:   Fri, 30 Jun 2023 18:13:32 +0200

ThreeAmountsSheet

Diffstat:
MTalerWallet1/Views/Transactions/ThreeAmounts.swift | 5+++--
MTalerWallet1/Views/Transactions/TransactionDetailView.swift | 27++++++++++++++-------------
2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/TalerWallet1/Views/Transactions/ThreeAmounts.swift b/TalerWallet1/Views/Transactions/ThreeAmounts.swift @@ -5,12 +5,13 @@ import SwiftUI import taler_swift -struct ThreeAmounts: View { +struct ThreeAmountsSheet: View { var common: TransactionCommon var topTitle: String var bottomTitle: String? let baseURL: String? let large: Bool // set to false for QR or IBAN + var body: some View { let raw = common.amountRaw let effective = common.amountEffective @@ -98,7 +99,7 @@ struct ThreeAmounts_Previews: PreviewProvider { txActions: []) Group { List { - ThreeAmounts(common: common, topTitle: "Withdrawal", baseURL: DEMOEXCHANGE, large: 1==1) + ThreeAmountsSheet(common: common, topTitle: "Withdrawal", baseURL: DEMOEXCHANGE, large: 1==1) .safeAreaInset(edge: .bottom) { Button(String(localized: "Accept"), action: {}) .buttonStyle(TalerButtonStyle(type: .prominent)) diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift b/TalerWallet1/Views/Transactions/TransactionDetailView.swift @@ -189,8 +189,8 @@ struct TransactionDetailView: View { } } // ManualDetails or Confirm with bank let _ = print("ThreeAmounts") - ThreeAmounts(common: common, topTitle: String(localized: "Chosen amount to withdraw:"), - baseURL: withdrawalTransaction.details.exchangeBaseUrl, large: true) + ThreeAmountsSheet(common: common, topTitle: String(localized: "Chosen amount to withdraw:"), + baseURL: withdrawalTransaction.details.exchangeBaseUrl, large: true) case .payment(let paymentTransaction): let details = paymentTransaction.details let info = details.info @@ -198,31 +198,32 @@ struct TransactionDetailView: View { .font(.title) .lineLimit(4) .padding(.bottom) - ThreeAmounts(common: common, topTitle: String(localized: "Sum to be paid:"), - baseURL: nil, large: true) // TODO: baseURL + ThreeAmountsSheet(common: common, topTitle: String(localized: "Sum to be paid:"), + baseURL: nil, large: true) // TODO: baseURL case .refund(let refundTransaction): let details = refundTransaction.details // TODO: more details - ThreeAmounts(common: common, topTitle: String(localized: "Refunded amount:"), - baseURL: nil, large: true) // TODO: baseURL + ThreeAmountsSheet(common: common, topTitle: String(localized: "Refunded amount:"), + baseURL: nil, large: true) // TODO: baseURL case .reward(let rewardTransaction): let details = rewardTransaction.details // TODO: more details - ThreeAmounts(common: common, topTitle: String(localized: "Received Reward:"), - baseURL: details.exchangeBaseUrl, large: true) + ThreeAmountsSheet(common: common, topTitle: String(localized: "Received Reward:"), + baseURL: details.exchangeBaseUrl, large: true) // case .tip(let tipTransaction): // let details = tipTransaction.details // TODO: details -// ThreeAmounts(common: common, topTitle: String(localized: "Received Tip:"), large: true) +// ThreeAmountsSheet(common: common, topTitle: String(localized: "Received Tip:"), +// baseURL: nil, large: true) case .refresh(let refreshTransaction): let details = refreshTransaction.details // TODO: details - ThreeAmounts(common: common, topTitle: String(localized: "Refreshed amount:"), - baseURL: nil, large: true) // TODO: baseURL + ThreeAmountsSheet(common: common, topTitle: String(localized: "Refreshed amount:"), + baseURL: nil, large: true) // TODO: baseURL case .peer2peer(let p2pTransaction): let details = p2pTransaction.details // TODO: details // TODO: isSendCoins should show QR only while not expired if pending || transaction.isSendCoins { QRCodeDetails(transaction: transaction) } - ThreeAmounts(common: common, topTitle: String(localized: "Peer to Peer:"), - baseURL: details.exchangeBaseUrl, large: false) + ThreeAmountsSheet(common: common, topTitle: String(localized: "Peer to Peer:"), + baseURL: details.exchangeBaseUrl, large: false) } // switch } // Group }