commit 271802c56b65cadde4641cb96f32f2c2fe715325
parent 2f9add49bf756274f0cbc5e6e846edba3d90edc6
Author: Marc Stibane <marc@taler.net>
Date: Wed, 16 Jul 2025 08:14:37 +0200
Zip+Town
Diffstat:
3 files changed, 75 insertions(+), 13 deletions(-)
diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
@@ -198,6 +198,9 @@ struct ManualDetailsV: View {
let wireDetails = ManualDetailsWireV(stack: stack.push(),
reservePub: details.reservePub,
receiverStr: receiverStr,
+// receiverAux: payto.receiverAux,
+ receiverZip: payto.postalCode,
+ receiverTown: payto.town,
iban: payto.iban,
xTaler: payto.xTaler ?? EMPTYSTRING,
amountValue: amountValue,
diff --git a/TalerWallet1/Views/Transactions/ManualDetailsWireV.swift b/TalerWallet1/Views/Transactions/ManualDetailsWireV.swift
@@ -79,6 +79,9 @@ struct ManualDetailsWireV: View {
let stack: CallStack
let reservePub: String
let receiverStr: String
+// let receiverAux: String?
+ let receiverZip: String?
+ let receiverTown: String?
let iban: String?
let xTaler: String
let amountValue: String // string representation of the value, formatted as "`integer`.`fraction`"
@@ -101,6 +104,47 @@ struct ManualDetailsWireV: View {
: String(localized: "Finish the wire transfer of \(amountNBS) in your banking app or website, then this withdrawal will proceed automatically.") + "\n" + bePatient
}
+// func buildReceiver() -> String {
+// if let receiverAux {
+// return receiverStr + ", " + receiverAux
+// }
+// return receiverStr
+// }
+
+ @ViewBuilder func payeeZip() -> some View {
+ HStack {
+ VStack(alignment: .leading) {
+ Text("Zip code:")
+ .talerFont(.subheadline)
+ Text(receiverZip ?? EMPTYSTRING)
+ .monospacedDigit()
+ .padding(.leading)
+ } .frame(maxWidth: .infinity, alignment: .leading)
+ .accessibilityElement(children: .combine)
+ .accessibilityLabel(Text("Zip code", comment: "a11y"))
+ CopyButton(textToCopy: receiverZip ?? EMPTYSTRING, vertical: true)
+ .accessibilityLabel(Text("Copy the zip code", comment: "a11y"))
+ .disabled(false)
+ } .padding(.top, -8)
+ }
+
+ @ViewBuilder func payeeTown() -> some View {
+ HStack {
+ VStack(alignment: .leading) {
+ Text("City:")
+ .talerFont(.subheadline)
+ Text(receiverTown ?? EMPTYSTRING)
+ .monospacedDigit()
+ .padding(.leading)
+ } .frame(maxWidth: .infinity, alignment: .leading)
+ .accessibilityElement(children: .combine)
+ .accessibilityLabel(Text("City", comment: "a11y"))
+ CopyButton(textToCopy: receiverTown ?? EMPTYSTRING, vertical: true)
+ .accessibilityLabel(Text("Copy the city", comment: "a11y"))
+ .disabled(false)
+ } .padding(.top, -8)
+ }
+
var body: some View {
List {
let cryptocode = HStack {
@@ -119,10 +163,16 @@ struct ManualDetailsWireV: View {
Text(receiverStr)
.monospacedDigit()
.padding(.leading)
+// if let receiverAux {
+// Text(receiverAux)
+// .monospacedDigit()
+// .padding(.leading)
+// }
} .frame(maxWidth: .infinity, alignment: .leading)
.accessibilityElement(children: .combine)
.accessibilityLabel(Text("Recipient", comment: "a11y"))
CopyButton(textToCopy: receiverStr, vertical: true)
+// CopyButton(textToCopy: buildReceiver(), vertical: true)
.accessibilityLabel(Text("Copy the recipient", comment: "a11y"))
.disabled(false)
} .padding(.top, -8)
@@ -139,7 +189,7 @@ struct ManualDetailsWireV: View {
CopyButton(textToCopy: iban ?? EMPTYSTRING, vertical: true)
.accessibilityLabel(Text("Copy the IBAN", comment: "a11y"))
.disabled(false)
- } .padding(.top, -8)
+ } // .padding(.top, -8)
let amountCode = HStack {
VStack(alignment: .leading) {
Text("Amount:")
@@ -154,7 +204,7 @@ struct ManualDetailsWireV: View {
CopyButton(textToCopy: amountValue, vertical: true) // only digits + separator, no currency name or symbol
.accessibilityLabel(Text("Copy the amount", comment: "a11y"))
.disabled(false)
- }// .padding(.top, -8)
+ } .padding(.top, -8)
let xTalerCode = HStack {
VStack(alignment: .leading) {
Text("Account:")
@@ -203,24 +253,30 @@ struct ManualDetailsWireV: View {
debitIBAN: debitIBAN,
restrictions: account.creditRestrictions)
.listRowSeparator(.visible)
- step1.listRowSeparator(.hidden)
+ step1
if !minimalistic {
mandatory
}
- cryptocode.listRowSeparator(.hidden)
+ cryptocode
if iban != nil {
- step2i.listRowSeparator(.hidden)
- payeeCode.listRowSeparator(.hidden)
- ibanCode.listRowSeparator(.hidden)
+ step2i
+ payeeCode
+ if let receiverZip {
+ payeeZip()
+ }
+ if let receiverTown {
+ payeeTown()
+ }
+ ibanCode
} else {
- step2x.listRowSeparator(.hidden)
- payeeCode.listRowSeparator(.hidden)
- xTalerCode.listRowSeparator(.hidden)
+ step2x
+ payeeCode
+ xTalerCode
}
- amountCode.listRowSeparator(.hidden)
- .padding(.top)
+ amountCode
+// .padding(.top)
step3 // .padding(.top, 6)
- }
+ }.listRowSeparator(.hidden)
}
.navigationTitle(navTitle)
.onAppear() {
diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift
@@ -375,6 +375,9 @@ struct TransactionSummaryV: View {
let wireDetails = ManualDetailsWireV(stack: stack.push(),
reservePub: info.accountPub,
receiverStr: receiverStr,
+// receiverAux: payto.receiverAux,
+ receiverZip: payto.postalCode,
+ receiverTown: payto.town,
iban: payto.iban,
xTaler: payto.xTaler ?? EMPTYSTRING,
amountValue: amountValue,