taler-ios

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

commit f405f30e71f48be06f57963bd28d7826f1d72da6
parent a30dc47d0371b52a361659e349afec0a8e96c80f
Author: Marc Stibane <marc@taler.net>
Date:   Thu,  8 Aug 2024 06:04:15 +0200

ShareButton title

Diffstat:
MTalerWallet1/Views/HelperViews/CopyShare.swift | 12+++++++++++-
MTalerWallet1/Views/Transactions/ManualDetailsV.swift | 6++++--
2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/TalerWallet1/Views/HelperViews/CopyShare.swift b/TalerWallet1/Views/HelperViews/CopyShare.swift @@ -48,6 +48,16 @@ struct CopyButton: View { struct ShareButton: View { private let symLog = SymLogV(0) let textToShare: String + let title: String + + init(textToShare: String) { + self.textToShare = textToShare + self.title = String(localized: "Share") + } + init(textToShare: String, title: String) { + self.textToShare = textToShare + self.title = title + } @Environment(\.isEnabled) private var isEnabled: Bool @EnvironmentObject private var controller: Controller @@ -63,7 +73,7 @@ struct ShareButton: View { HStack { Image(systemName: "square.and.arrow.up") .accessibility(hidden: true) - Text("Share") + Text(title) } } .talerFont(.body) diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift b/TalerWallet1/Views/Transactions/ManualDetailsV.swift @@ -332,9 +332,11 @@ struct ManualDetailsV: View { .accessibilityHidden(true) .foregroundColor(Color.clear) // Spacer() - ShareButton(textToShare: payto) + let title = String(localized: "Share the PayTo URL", comment: "VoiceOver") + let minTitle = String(localized: "Share PayTo", comment: "mini") + ShareButton(textToShare: payto, title: minimalistic ? minTitle : title) .frame(maxWidth: .infinity, alignment: .center) - .accessibilityLabel(Text("Share the PayTo URL", comment: "VoiceOver")) + .accessibilityLabel(Text(title)) .disabled(false) // Spacer() } .listRowSeparator(.automatic)