taler-ios

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

commit 5090aad727eb51154142d403eaf15bbfbae94860
parent e64eb9dc1662f0e366dea93b216391d73b5a37dc
Author: Marc Stibane <marc@taler.net>
Date:   Wed,  7 Oct 2026 15:32:43 +0200

more TokenViews

Diffstat:
MTalerWallet1/Views/Sheets/Payment/ChoicesView.swift | 37+++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+), 0 deletions(-)

diff --git a/TalerWallet1/Views/Sheets/Payment/ChoicesView.swift b/TalerWallet1/Views/Sheets/Payment/ChoicesView.swift @@ -59,6 +59,43 @@ struct TokenView: View, Sendable { } } +struct OutputTokenView: View, Sendable { + let outputs: [ContractOutputAny] + let tokenFamilies: [String: ContractTokenFamily] // token_family_slug: String + + var body: some View { + ForEach(outputs, id: \.self) { output in + switch output { + case .token(let token): + if let slug = token.tokenFamilySlug { + let count = token.count ?? 1 + TokenView(count: count > 1 ? count : nil, + slug: slug, + tokenFamilies: tokenFamilies) + } + case .taxReceipt(let taxReceipt): + let amount = taxReceipt.amount + // TODO: taxReceipt + case .unknown(let string): + let _ = print("❗️❗️ChoicesView: Unknown output type: \(string)") + } + } + } +} +struct InputTokenView: View, Sendable { + let inputs: [ContractInput] + let tokenFamilies: [String: ContractTokenFamily] // token_family_slug: String + + var body: some View { + ForEach(inputs, id: \.self) { input in + if let slug = input.tokenFamilySlug { + let count = input.count ?? 1 + TokenView(count: count, slug: slug, tokenFamilies: tokenFamilies) + } + } + } +} +// MARK: - struct ChoicesView: View, Sendable { let stack: CallStack let choiceTriple: [ChoiceTriple]