gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 119/204: cleanup


From: gnunet
Subject: [taler-taler-ios] 119/204: cleanup
Date: Thu, 05 Dec 2024 23:51:27 +0100

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository taler-ios.

commit 6aef0c3b58db09b716fdfec3a10e18bb4407bd19
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sat Nov 9 11:02:50 2024 +0100

    cleanup
---
 .../Views/Balances/BalancesSectionView.swift       | 26 +++++++++-------------
 TalerWallet1/Views/HelperViews/Buttons.swift       | 23 +++++++++----------
 TalerWallet1/Views/HelperViews/IconBadge.swift     | 13 ++++++-----
 TalerWallet1/Views/Main/MainView.swift             |  2 +-
 TalerWallet1/Views/Settings/AboutView.swift        |  8 ++-----
 5 files changed, 31 insertions(+), 41 deletions(-)

diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift 
b/TalerWallet1/Views/Balances/BalancesSectionView.swift
index 233f68e..1d5f13a 100644
--- a/TalerWallet1/Views/Balances/BalancesSectionView.swift
+++ b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -41,7 +41,6 @@ struct BalancesSectionView {
     @State private var completedTransactions: [Transaction] = []
     @State private var recentTransactions: [Transaction] = []
     @State private var pendingTransactions: [Transaction] = []
-    @State private var currencyInfo = CurrencyInfo.zero(UNKNOWN)
 
     private static func className() -> String {"\(self)"}
 
@@ -96,23 +95,20 @@ extension BalancesSectionView: View {
         let _ = symLog.vlog()       // just to get the # to compare it with 
.onAppear & onDisappear
 #endif
         let scopeInfo = balance.scopeInfo
-        let currency = scopeInfo.currency
 
-        let balanceDest = TransactionsListView(stack: 
stack.push("\(Self.className())()"),
+      Group {
+            let balanceDest = TransactionsListView(stack: 
stack.push("\(Self.className())()"),
                                                    scope: scopeInfo,
-                               balance: balance,
-                       selectedBalance: $selectedBalance,
-                              navTitle: currency,   // String(localized: 
"Transactions", comment: "ViewTitle of TransactionList"),
-                          transactions: $completedTransactions,
-                       reloadAllAction: loadCompleted,
-                       reloadOneAction: reloadOneAction)
-
-        Section {
+                                                 balance: balance,
+                                         selectedBalance: $selectedBalance,
+                                                navTitle: nil,                 
 // will use scopeInfo.currency
+                                            transactions: 
$completedTransactions,
+                                         reloadAllAction: loadCompleted,
+                                         reloadOneAction: reloadOneAction)
+          Section {
             BalanceCellV(stack: stack.push("BalanceCell"),
                          scope: balance.scopeInfo,
                         amount: balance.available,
-//                sizeCategory: sizeCategory,
-//                   rowAction: { buttonSelected = 3 },     // trigger 
TransactionList NavigationLink
                    balanceDest: balanceDest)
 //            .listRowSeparator(.hidden)
 //            .border(.red)
@@ -133,9 +129,6 @@ extension BalancesSectionView: View {
             shouldReloadBalances: $shouldReloadBalances)
         }.id(sectionID)
         .listRowSeparator(.hidden)
-        .task(id: controller.currencyTicker) {
-            currencyInfo = controller.info2(for: currency, 
controller.currencyTicker)
-        }
         .task(id: shouldReloadBalances + 1_000_000) {
             symLog.log(".task for BalancesSectionView - load 
recent+completed+pending")
             await loadRecent(stack.push(".task - load recent"))
@@ -164,6 +157,7 @@ extension BalancesSectionView: View {
                 }
             }
         } // recent transactions
+      }
     } // body
 } // BalancesSectionView
 // MARK: -
diff --git a/TalerWallet1/Views/HelperViews/Buttons.swift 
b/TalerWallet1/Views/HelperViews/Buttons.swift
index 44b8c39..e0903cb 100644
--- a/TalerWallet1/Views/HelperViews/Buttons.swift
+++ b/TalerWallet1/Views/HelperViews/Buttons.swift
@@ -213,15 +213,14 @@ struct TalerButtonStyle: ButtonStyle {
 
     public func makeBody(configuration: ButtonStyle.Configuration) -> some 
View {
         //        configuration.role = type == .prominent ? .primary : .normal 
         Only on macOS
-        MyBigButton(//type: type,
-            foreColor: foreColor(type: type, pressed: configuration.isPressed, 
disabled: disabled),
-            backColor: backColor(type: type, pressed: configuration.isPressed, 
disabled: disabled),
-            dimmed: dimmed,
-            configuration: configuration,
-            disabled: disabled,
-            narrow: narrow,
-            aligned: aligned,
-            badge: badge)
+        MyBigButton(foreColor: foreColor(type: type, pressed: 
configuration.isPressed, disabled: disabled),
+                    backColor: backColor(type: type, pressed: 
configuration.isPressed, disabled: disabled),
+                       dimmed: dimmed,
+                configuration: configuration,
+                     disabled: disabled,
+                       narrow: narrow,
+                      aligned: aligned,
+                        badge: badge)
     }
 
     func foreColor(type: TalerButtonStyleType, pressed: Bool, disabled: Bool) 
-> Color {
@@ -284,9 +283,7 @@ struct TalerButtonStyle: ButtonStyle {
                                 .scaleEffect(configuration.isPressed ? 0.95 : 
1)
                                 .animation(.spring(response: 0.1), value: 
configuration.isPressed)
                                 .disabled(disabled)
-            if !hasBadge {
-                buttonLabel
-            } else {
+            if hasBadge {
                 let badgeV = Image(systemName: badge)
                                 .talerFont(.caption)
                 HStack(alignment: .top, spacing: 0) {
@@ -294,6 +291,8 @@ struct TalerButtonStyle: ButtonStyle {
                     buttonLabel
                     badgeV.foregroundColor(.red)
                 }
+            } else {
+                buttonLabel
             }
         }
     }
diff --git a/TalerWallet1/Views/HelperViews/IconBadge.swift 
b/TalerWallet1/Views/HelperViews/IconBadge.swift
index 6bffd21..ce36933 100644
--- a/TalerWallet1/Views/HelperViews/IconBadge.swift
+++ b/TalerWallet1/Views/HelperViews/IconBadge.swift
@@ -15,10 +15,10 @@ struct PendingIconBadge: View {
     let needsKYC: Bool
 
     var body: some View {
-        let image = incoming && done ? Image(DONE_INCOMING)         // 
"plus.circle.fill"
-                          : incoming ? Image(PENDING_INCOMING)      // "plus"
-        // since the money already left the wallet, show DONE and not 
PENDING_OUTGOING
-                                     : Image(DONE_OUTGOING)         // 
"minus.circle"
+        let image = incoming && done ? Image(systemName: DONE_INCOMING)        
 // "plus.circle.fill"
+                          : incoming ? Image(systemName: PENDING_INCOMING)     
 // "plus"
+        // since outgoing money already left the wallet, show DONE_ and not 
PENDING_OUTGOING
+                                     : Image(systemName: DONE_OUTGOING)        
 // "minus.circle"
         IconBadge(image: image,
                    done: false,
               foreColor: foreColor,
@@ -59,7 +59,7 @@ struct ButtonIconBadge: View {
           shouldConfirm: false,
                needsKYC: false,
                wideIcon: TransactionType.peerPushDebit.icon())
-                      // button never is payment or refund
+                      // button is send/receive/withdraw/deposit, never 
payment or refund
     }
 }
 // MARK: -
@@ -69,7 +69,8 @@ struct IconBadge: View {
     let foreColor:Color
     let shouldConfirm: Bool
     let needsKYC: Bool
-    let wideIcon: Image?
+    let wideIcon: Image?        // cheating: ZStack with widest icon to ensure 
all have the same width
+                                // TODO: EqualIconWidth...
 
     @ScaledMetric var spacing = 8       // relative to fontSize
 
diff --git a/TalerWallet1/Views/Main/MainView.swift 
b/TalerWallet1/Views/Main/MainView.swift
index 90cbfbf..8805fd1 100644
--- a/TalerWallet1/Views/Main/MainView.swift
+++ b/TalerWallet1/Views/Main/MainView.swift
@@ -97,7 +97,7 @@ struct MainView: View {
                                      urlToOpen: url))
             Sheet(stack: stack.push(), sheetView: sheet)
         }
-        .sheet(isPresented: $model.showError) {
+        .sheet(isPresented: $model.showError) {         // TODO: switch to 
alert/overlay
             model.setError(nil)
         } content: {
             if let error2 = model.error2 {
diff --git a/TalerWallet1/Views/Settings/AboutView.swift 
b/TalerWallet1/Views/Settings/AboutView.swift
index 47a7ffa..72da7d3 100644
--- a/TalerWallet1/Views/Settings/AboutView.swift
+++ b/TalerWallet1/Views/Settings/AboutView.swift
@@ -103,16 +103,12 @@ struct AboutView: View {
         .navigationTitle(navTitle)
         .task {
             onboarding = (tapped < TAPPED || dragged < DRAGGED)
+//            try? await Task.sleep(nanoseconds: 1_000_000_000 * UInt64(5))
+//            rotationEnabled.toggle()
         }
         .onAppear() {
             DebugViewC.shared.setViewID(VIEW_ABOUT, stack: stack.push())
         }
-        .onDisappear() {
-        }
-//        .task {
-//            try? await Task.sleep(nanoseconds: 1_000_000_000 * UInt64(5))
-//            rotationEnabled.toggle()
-//        }
     }
 }
 extension Bundle {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]