commit 9b397c7f71f5f593579637de6c3e430aa74bd33f
parent eba3a81f83a782196510230e143095494cec689f
Author: Marc Stibane <marc@taler.net>
Date: Tue, 30 Jul 2024 09:23:35 +0200
Add CURRENCY below Pay button
Diffstat:
2 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/TalerWallet1/Localizable.xcstrings b/TalerWallet1/Localizable.xcstrings
@@ -3505,6 +3505,9 @@
}
}
},
+ "Pay %@ now" : {
+
+ },
"Pay P2P" : {
"comment" : "Nav Title",
"localizations" : {
@@ -3640,6 +3643,9 @@
}
}
},
+ "Payment is made in %@" : {
+
+ },
"Payment provider:" : {
"localizations" : {
"de" : {
diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift
@@ -91,12 +91,12 @@ struct PaymentView: View {
var body: some View {
Group {
if let preparePayResult {
+ let raw = preparePayResult.amountRaw
let effective = preparePayResult.amountEffective
let terms = preparePayResult.contractTerms
List {
// TODO: show balanceDetails.balanceAvailable
let baseURL = preparePayResult.contractTerms.exchanges.first?.url
- let raw = preparePayResult.amountRaw
let status = preparePayResult.status
let currency = raw.currencyStr
let topTitle = String(localized: "Amount to pay:")
@@ -151,15 +151,20 @@ struct PaymentView: View {
.listStyle(myListStyle.style).anyView
.safeAreaInset(edge: .bottom) {
if let effective {
- NavigationLink(destination: LazyView {
- PaymentDone(stack: stack.push(),
- currencyInfo: $currencyInfo,
- transactionId: preparePayResult.transactionId)
- }) {
- Text(navTitle) // Confirm Payment
+ VStack {
+ NavigationLink(destination: LazyView {
+ PaymentDone(stack: stack.push(),
+ currencyInfo: $currencyInfo,
+ transactionId: preparePayResult.transactionId)
+ }) {
+ let formatted = raw.formatted(currencyInfo, isNegative: false)
+ Text("Pay \(formatted) now")
+ }
+ .buttonStyle(TalerButtonStyle(type: .prominent))
+ .padding(.horizontal)
+ Text("Payment is made in \(currencyInfo.scope.currency)")
+ .talerFont(.callout)
}
- .buttonStyle(TalerButtonStyle(type: .prominent))
- .padding(.horizontal)
} else {
Button("Cancel", action: {
dismissTop(stack.push())