gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 34/36: Previews


From: gnunet
Subject: [taler-taler-ios] 34/36: Previews
Date: Mon, 13 Nov 2023 21:27:39 +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 e55bb0473a4b88a34ec55cbd47243c7b07a92f35
Author: Marc Stibane <marc@taler.net>
AuthorDate: Mon Nov 13 21:10:58 2023 +0100

    Previews
---
 TalerWallet1/Views/Balances/BalanceRowView.swift |  1 +
 TalerWallet1/Views/Balances/PendingRowView.swift | 19 +++++++++++++++++--
 TalerWallet1/Views/Peer2peer/SendAmount.swift    | 24 ++++++++++++++++--------
 3 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/TalerWallet1/Views/Balances/BalanceRowView.swift 
b/TalerWallet1/Views/Balances/BalanceRowView.swift
index 6cecada..1c78853 100644
--- a/TalerWallet1/Views/Balances/BalanceRowView.swift
+++ b/TalerWallet1/Views/Balances/BalanceRowView.swift
@@ -101,6 +101,7 @@ struct BalanceRowView: View {
 #if  DEBUG
 
 struct BalanceRowView_Previews: PreviewProvider {
+    @MainActor
   struct StateContainer: View {
     var body: some View {
         let test = Amount(currency: TESTCURRENCY, cent: 123)
diff --git a/TalerWallet1/Views/Balances/PendingRowView.swift 
b/TalerWallet1/Views/Balances/PendingRowView.swift
index be2bb01..9549c40 100644
--- a/TalerWallet1/Views/Balances/PendingRowView.swift
+++ b/TalerWallet1/Views/Balances/PendingRowView.swift
@@ -121,8 +121,9 @@ func PreviewCurrencyInfo(_ currency: String, digits: Int) 
-> CurrencyInfo {
     return CurrencyInfo(scope: scope, specs: specs, formatter: formatter)
 }
 
-struct PendingRowView_Previews: PreviewProvider {
-    static var previews: some View {
+@MainActor
+fileprivate struct Preview_Content: View {
+    var body: some View {
         let test = Amount(currency: TESTCURRENCY, cent: 123)
         let demo = Amount(currency: DEMOCURRENCY, cent: 123456)
         List {
@@ -131,4 +132,18 @@ struct PendingRowView_Previews: PreviewProvider {
         }
     }
 }
+fileprivate struct Previews: PreviewProvider {
+    @MainActor
+    struct StateContainer: View {
+//        @StateObject private var controller = Controller.shared
+        var body: some View {
+            Text("Hello")
+//            Preview_Content()
+//                .environmentObject(controller)
+        }
+    }
+    static var previews: some View {
+        StateContainer()
+    }
+}
 #endif
diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift 
b/TalerWallet1/Views/Peer2peer/SendAmount.swift
index bf1b8c9..f9d58ee 100644
--- a/TalerWallet1/Views/Peer2peer/SendAmount.swift
+++ b/TalerWallet1/Views/Peer2peer/SendAmount.swift
@@ -100,12 +100,12 @@ struct SendAmount: View {
 }
 // MARK: -
 #if DEBUG
-struct SendAmount_Container : View {
-    @State private var amountToTransfer = Amount(currency: DEMOCURRENCY, cent: 
510)
+fileprivate struct Preview_Content: View {
+    @State private var amountToTransfer = Amount(currency: TESTCURRENCY, cent: 
510)
     @State private var summary: String = ""
 
     var body: some View {
-        let amount = Amount(currency: LONGCURRENCY, integer: 10, fraction: 0)
+        let amount = Amount(currency: TESTCURRENCY, integer: 10, fraction: 0)
         SendAmount(stack: CallStack("Preview"),
          amountAvailable: amount,
         amountToTransfer: $amountToTransfer,
@@ -113,9 +113,17 @@ struct SendAmount_Container : View {
     }
 }
 
-//struct SendAmount_Previews: PreviewProvider {
-//    static var previews: some View {
-//        SendAmount_Container()
-//    }
-//}
+fileprivate struct Previews: PreviewProvider {
+    @MainActor
+    struct StateContainer: View {
+        @StateObject private var controller = Controller.shared
+        var body: some View {
+            Preview_Content()
+                .environmentObject(controller)
+        }
+    }
+    static var previews: some View {
+        StateContainer()
+    }
+}
 #endif

-- 
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]