taler-ios

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

commit da2fe9b573e9287c007cf3d0b1e1e633319ee259
parent 820783b5be6156eb5441917af632282d359d4c14
Author: Marc Stibane <marc@taler.net>
Date:   Sun, 19 Nov 2023 22:06:32 +0100

cleanup

Diffstat:
MTalerWallet1/Helper/CurrencySpecification.swift | 3++-
MTalerWallet1/Views/Balances/PendingRowView.swift | 2--
MTalerWallet1/Views/Exchange/ManualWithdraw.swift | 7++-----
MTalerWallet1/Views/HelperViews/AmountRowV.swift | 19++++++++-----------
MTalerWallet1/Views/Transactions/TransactionDetailView.swift | 1-
5 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/TalerWallet1/Helper/CurrencySpecification.swift b/TalerWallet1/Helper/CurrencySpecification.swift @@ -90,11 +90,12 @@ public struct CurrencyInfo { return nil } + // TODO: use valueAsDecimalTuple instead of valueAsFloatTuple func string(for valueTuple: (Double, Double), useSymbol: Bool = true) -> String { formatter.setUseSymbol(useSymbol) let (integer, fraction) = valueTuple if let integerStr = formatter.string(for: integer) { - if fraction == 0 { return integerStr } // TODO: add trailing zeroes + if fraction == 0 { return integerStr } // formatter already added trailing zeroes if let fractionStr = formatter.string(for: fraction) { if let decimalSeparator = formatter.currencyDecimalSeparator { if let fractionIndex = fractionStr.endIndex(of: decimalSeparator) { diff --git a/TalerWallet1/Views/Balances/PendingRowView.swift b/TalerWallet1/Views/Balances/PendingRowView.swift @@ -30,8 +30,6 @@ struct PendingRowView: View { let pendingColor = WalletColors().pendingColor(incoming) let imageName = incoming ? "plus.diamond" // goforward.plus circle : "minus.diamond" // - let badgeName = needsKYC ? "star.fill" - : "circle.fill" let iconBadge = IconBadge(imageName: imageName, foreColor: pendingColor, shouldConfirm: shouldConfirm, needsKYC: needsKYC) let inTitle = iconOnly ? inTitle0 : inTitle1 diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift b/TalerWallet1/Views/Exchange/ManualWithdraw.swift @@ -32,8 +32,7 @@ struct ManualWithdraw: View { let navTitle = String(localized: "NavTitle_Withdraw (currency)", defaultValue: "Withdraw \(currency)") // let agePicker = AgePicker(ageMenuList: $ageMenuList, selectedAge: $selectedAge) - ScrollView { - VStack { + ScrollView { VStack { CurrencyInputView(amount: $amountToTransfer, available: nil, title: iconOnly ? String(localized: "How much:") @@ -75,9 +74,7 @@ struct ManualWithdraw: View { } } } // disabled - Spacer() - } - } + } } // ScrollVStack .frame(maxWidth: .infinity, alignment: .leading) .padding(.horizontal) .background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all)) diff --git a/TalerWallet1/Views/HelperViews/AmountRowV.swift b/TalerWallet1/Views/HelperViews/AmountRowV.swift @@ -19,26 +19,23 @@ struct AmountRowV<Content: View>: View { var content: () -> Content - var body: some View { + let text = Text(amountStr) + .foregroundColor(amountColor) + .accessibilityFont(largeAmountFont ? .title : .title2) + .monospacedDigit() if fitsHorizontal { HStack(alignment: vertAlignment, spacing: 0) { content() Spacer(minLength: 0) - Text(amountStr) - .foregroundColor(amountColor) - .accessibilityFont(largeAmountFont ? .title : .title2) - .monospacedDigit() + text } } else { VStack(alignment: .leading, spacing: 0) { content() HStack { Spacer(minLength: 0) - Text(amountStr) - .foregroundColor(amountColor) - .accessibilityFont(largeAmountFont ? .title : .title2) - .monospacedDigit() + text } } } @@ -47,7 +44,7 @@ struct AmountRowV<Content: View>: View { // MARK: - #if DEBUG -struct SectionWithAmountRow: View { +struct PreviewSectionWithAmountRow: View { @Environment(\.sizeCategory) var sizeCategory @Environment(\.colorSchemeContrast) private var colorSchemeContrast @@ -92,6 +89,6 @@ struct SectionWithAmountRow: View { } #Preview { - SectionWithAmountRow() + PreviewSectionWithAmountRow() } #endif diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift b/TalerWallet1/Views/Transactions/TransactionDetailView.swift @@ -26,7 +26,6 @@ struct TransactionDetailView: View { let stack: CallStack let transactionId: String let reloadAction: ((_ transactionId: String) async throws -> Transaction) - let navTitle: String? let doneAction: (() -> Void)? let abortAction: ((_ transactionId: String) async throws -> Void)?