aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Stibane <marc@taler.net>2023-11-18 17:25:32 +0100
committerMarc Stibane <marc@taler.net>2023-11-18 19:21:56 +0100
commit5d877d3c8824d7f769f2b37aa50393cdba967dbd (patch)
tree833ef78ed386d57d7dd7236639aba8e25f296aae
parentf7750a60188e34ddedcae0cf763a926d913afba0 (diff)
downloadtaler-ios-5d877d3c8824d7f769f2b37aa50393cdba967dbd.tar.gz
taler-ios-5d877d3c8824d7f769f2b37aa50393cdba967dbd.tar.bz2
taler-ios-5d877d3c8824d7f769f2b37aa50393cdba967dbd.zip
ScrollVStack
-rw-r--r--TalerWallet1/Views/Peer2peer/SendAmount.swift66
1 files changed, 33 insertions, 33 deletions
diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift b/TalerWallet1/Views/Peer2peer/SendAmount.swift
index 5759aea..7eef7c7 100644
--- a/TalerWallet1/Views/Peer2peer/SendAmount.swift
+++ b/TalerWallet1/Views/Peer2peer/SendAmount.swift
@@ -51,42 +51,40 @@ struct SendAmount: View {
let current = amountToTransfer.string(currencyInfo)
let insufficientLabel = String(localized: "You don't have enough \(currency).")
let insufficientLabel2 = String(localized: "but you only have \(available) to send.")
- ScrollView {
- VStack(alignment: .trailing) {
-// let _ = print("available: \(available)")
- Text("Available:\t\(available)")
- .accessibilityFont(.title3)
- .padding(.bottom, 2)
- CurrencyInputView(amount: $amountToTransfer,
- title: iconOnly ? String(localized: "How much:")
- : String(localized: "Amount to send:"),
- shortcutLabel: String(localized: "Send", comment: "VoiceOver: Send $50,$25,$10,$5 shortcut buttons"))
- let disabled = insufficient || amountToTransfer.isZero
- Text(insufficient ? insufficientLabel
- : feeLabel)
- .accessibilityFont(.body)
- .foregroundColor(.red)
- .padding(4)
- NavigationLink(destination: LazyView {
- SendPurpose(stack: stack.push(),
- amountAvailable: amountAvailable,
- amountToTransfer: amountToTransfer,
- fee: fee,
- summary: $summary,
- expireDays: $expireDays)
- }) {
- Text("Next")
- } .buttonStyle(TalerButtonStyle(type: .prominent))
- .disabled(disabled)
- Spacer()
- }
- }
+ ScrollView { VStack(alignment: .trailing) {
+// let _ = print("available: \(available)")
+ Text("Available:\t\(available)")
+ .accessibilityFont(.title3)
+ .padding(.bottom, 2)
+ CurrencyInputView(amount: $amountToTransfer,
+ title: iconOnly ? String(localized: "How much:")
+ : String(localized: "Amount to send:"),
+ shortcutLabel: String(localized: "Send", comment: "VoiceOver: Send $50,$25,$10,$5 shortcut buttons"))
+ let disabled = insufficient || amountToTransfer.isZero
+ Text(insufficient ? insufficientLabel
+ : feeLabel)
+ .accessibilityFont(.body)
+ .foregroundColor(.red)
+ .padding(4)
+
+ NavigationLink(destination: LazyView {
+ SendPurpose(stack: stack.push(),
+ amountAvailable: amountAvailable,
+ amountToTransfer: amountToTransfer,
+ fee: fee,
+ summary: $summary,
+ expireDays: $expireDays)
+ }) { Text("Next") }
+ .buttonStyle(TalerButtonStyle(type: .prominent))
+ .disabled(disabled)
+ Spacer()
+ } } // ScrollVStack
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal)
.background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
.navigationTitle(navTitle)
- .onAppear { // make CurrencyField show the keyboard
+ .onAppear {
DebugViewC.shared.setViewID(VIEW_SEND_P2P, stack: stack.push())
symLog.log("❗️Yikes SendAmount onAppear")
}
@@ -104,7 +102,9 @@ struct SendAmount: View {
if insufficient {
announce(this: "\(current), \(insufficientLabel2)")
- } else if !amountToTransfer.isZero {
+ } else if amountToTransfer.isZero {
+ fee = EMPTYSTRING
+ } else {
do {
let ppCheck = try await model.checkPeerPushDebitM(amountToTransfer)
peerPushCheck = ppCheck
@@ -112,7 +112,7 @@ struct SendAmount: View {
// agePicker.setAges(ages: peerPushCheck?.ageRestrictionOptions)
if let feeAmount = fee(ppCheck: peerPushCheck) {
fee = feeAmount.string(currencyInfo)
- } else { fee = "" }
+ } else { fee = EMPTYSTRING }
announce(this: "\(current), \(feeLabel)")
} catch { // TODO: error
symLog.log(error.localizedDescription)