commit 99033ef40f3e9b56e1e41a4f019d8959972e50fa parent 932998905f177d331af37db2b518e38ce89d9687 Author: Marc Stibane <marc@taler.net> Date: Sat, 27 Jul 2024 11:27:57 +0200 feeLabel Diffstat:
5 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/TalerWallet1/Views/Banking/DepositAmountV.swift b/TalerWallet1/Views/Banking/DepositAmountV.swift @@ -49,6 +49,11 @@ struct DepositAmountV: View { return feeAmount } + private func feeLabel(_ feeString: String) -> String { + feeString.count > 0 ? String(localized: "+ \(feeString) fee") + : EMPTYSTRING + } + private func feeIsNotZero() -> Bool? { if let hasNoFees = exchange?.noFees { if hasNoFees { diff --git a/TalerWallet1/Views/HelperViews/AmountInputV.swift b/TalerWallet1/Views/HelperViews/AmountInputV.swift @@ -86,13 +86,13 @@ struct AmountInputV: View { shortcutAction: shortcutAction) // .accessibility(sortPriority: 2) - let color = flags.insufficient || !(feeAmount?.isZero ?? true) ? .red - : WalletColors().secondary(colorScheme, colorSchemeContrast) - Text(flags.insufficient ? insufficientLabel : feeLabel(feeStr)) - .talerFont(.body) - .foregroundColor(color) - .padding(4) - .accessibility(sortPriority: 1) +// let color = flags.insufficient || !(feeAmount?.isZero ?? true) ? .red +// : WalletColors().secondary(colorScheme, colorSchemeContrast) +// Text(flags.insufficient ? insufficientLabel : feeLabel(feeStr)) +// .talerFont(.body) +// .foregroundColor(color) +// .padding(4) +// .accessibility(sortPriority: 1) Button("Next") { buttonAction() } .buttonStyle(TalerButtonStyle(type: .prominent, disabled: flags.disabled)) .disabled(flags.disabled) diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift b/TalerWallet1/Views/Peer2peer/SendAmount.swift @@ -45,6 +45,11 @@ struct SendAmount: View { buttonSelected = true } + private func feeLabel(_ feeString: String) -> String { + feeString.count > 0 ? String(localized: "+ \(feeString) fee") + : EMPTYSTRING + } + private func fee(ppCheck: CheckPeerPushDebitResponse?) -> Amount? { do { if let ppCheck { diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift @@ -11,7 +11,7 @@ import SymLog typealias Announce = (_ this: String) -> () -func feeLabel(_ feeString: String) -> String { +fileprivate func feeLabel(_ feeString: String) -> String { feeString.count > 0 ? String(localized: "+ \(feeString) fee") : EMPTYSTRING } diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift @@ -59,6 +59,11 @@ struct WithdrawURIView: View { buttonSelected = true } + private func feeLabel(_ feeString: String) -> String { + feeString.count > 0 ? String(localized: "\(feeString) fee") + : EMPTYSTRING + } + private func computeFeeWithdraw(_ amount: Amount) async -> ComputeFeeResult? { if let exchange { if let details = try? await model.getWithdrawalDetailsForAmountM(exchange.exchangeBaseUrl,