taler-ios

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

commit 86071d0fb484d953f759d1b493ae80f22df3904d
parent b714b11c889e10feded17792e9510324bad2f96f
Author: Marc Stibane <marc@taler.net>
Date:   Wed, 25 Feb 2026 17:28:59 +0100

Start work on Empty Wallet

Diffstat:
MTalerWallet1/Views/Main/WalletEmptyView.swift | 53+++++++++++++++++++++++++++++++++++++----------------
1 file changed, 37 insertions(+), 16 deletions(-)

diff --git a/TalerWallet1/Views/Main/WalletEmptyView.swift b/TalerWallet1/Views/Main/WalletEmptyView.swift @@ -1,5 +1,5 @@ /* - * This file is part of GNU Taler, ©2022-25 Taler Systems S.A. + * This file is part of GNU Taler, ©2022-26 Taler Systems S.A. * See LICENSE.md */ /** @@ -20,35 +20,56 @@ struct WalletEmptyView: View { @Environment(\.colorSchemeContrast) private var colorSchemeContrast @EnvironmentObject private var model: WalletModel @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic +#if DEBUG + @AppStorage("developerMode") var developerMode: Bool = true +#else + @AppStorage("developerMode") var developerMode: Bool = false +#endif @State private var withDrawStarted = false var body: some View { let list = List { -#if false // EMPTY - Section { - Text("There is no digital cash in your wallet yet.") - .talerFont(.title3) - } -#endif Section { + Text("Welcome to Taler Wallet!", comment: "") + .talerFont(.body) +#if TALER_WALLET let qrButton = Image(systemName: QRBUTTON) // 􀎻 "qrcode.viewfinder" let settings = Image(systemName: SETTINGS) // 􀍟 "gear" Text("Use «\(qrButton) Scan QR code» in the Actions menu to start a withdrawal if your bank already supports Taler payments.", comment: "« 􀎻 » 'qrcode.viewfinder'") .talerFont(.body) - .listRowSeparator(.hidden) Text("You can also add a payment service manually in the \(settings) Settings tab.", comment: "« 􀍟 » 'gear'") .talerFont(.body) +#else//if TALER_NIGHTLY + Text("To make your first payment please withdraw some digital cash.", comment: "") + .talerFont(.body) + + let title = String(localized: "LinkTitle_Withdraw", defaultValue: "Withdraw CHF") + Button(title) { + // TODO: go to withdraw view + } + .buttonStyle(TalerButtonStyle(type: .prominent, narrow: false, disabled: withDrawStarted, aligned: .center)) + .padding(.bottom) +#endif +#if DEBUG + if developerMode { + Text("Either deposit or send your money to a friend before you delete the app, or it will be lost.", comment: "") + .talerFont(.body) + } +#endif } header: { - let firstHeader = String(localized: "Withdraw digital cash", comment: "section header") + let firstHeader = EMPTYSTRING Text(firstHeader) - .talerFont(.title3) + .talerFont(.badge) + /// YIKES! when not specifying this color, the Text in the BarGraphHeader vanishes!!! .foregroundColor(WalletColors().secondary(colorScheme, colorSchemeContrast)) + .listRowInsets(EdgeInsets()) // << here !! } + .listRowSeparator(.hidden) Section { Text("Get digital cash to experience how to pay with the money of the future.") .talerFont(.body) .listRowSeparator(.hidden) - let title = String(localized: "LinkTitle_Test_Money", defaultValue: "Get demo money") + let title = String(localized: "LinkTitle_Test_Money", defaultValue: "Get demo cash") Button(title) { withDrawStarted = true // don't run twice Task { // runs on MainActor @@ -59,11 +80,11 @@ struct WalletEmptyView: View { } .buttonStyle(TalerButtonStyle(type: .prominent, narrow: false, disabled: withDrawStarted, aligned: .center)) .disabled(withDrawStarted) - } header: { - let secondHeader = String(localized: "Demo", comment: "section header") - Text(secondHeader) - .talerFont(.title3) - .foregroundColor(WalletColors().secondary(colorScheme, colorSchemeContrast)) +// } header: { +// let secondHeader = String(localized: "Demo", comment: "section header") +// Text(secondHeader) +// .talerFont(.title3) +// .foregroundColor(WalletColors().secondary(colorScheme, colorSchemeContrast)) } } .listStyle(myListStyle.style).anyView