Pavel Yurchenko 1 год назад
Родитель
Сommit
3405277b2e

+ 0 - 1
SUIExamples/Application/SUIExamplesApp.swift

@@ -22,7 +22,6 @@ struct SUIExamplesApp: App {
                     for: Route.self,
                     for: Route.self,
                     destination: applicationCoordinator.buildDestination
                     destination: applicationCoordinator.buildDestination
                 )
                 )
-                
             }
             }
         }
         }
     }
     }

+ 11 - 1
SUIExamples/Flows/MainCoordinator.swift

@@ -28,7 +28,10 @@ final class MainCoordinator: BaseCoordinator {
             showProductModule(with: id)
             showProductModule(with: id)
         case .cart:
         case .cart:
             showCartModule()
             showCartModule()
-        default: EmptyView()
+        case .feedback:
+            showFeedbackModule()
+        default:
+            fatalError("This should not happen!")
         }
         }
     }
     }
 
 
@@ -45,6 +48,9 @@ final class MainCoordinator: BaseCoordinator {
                 },
                 },
                 onCart: { [weak self] in
                 onCart: { [weak self] in
                     self?.currentRouter.push(Route.cart)
                     self?.currentRouter.push(Route.cart)
+                },
+                onFeedback: { [weak self] in
+                    self?.currentRouter.push(Route.feedback)
                 }
                 }
             )
             )
         )
         )
@@ -86,4 +92,8 @@ final class MainCoordinator: BaseCoordinator {
             )
             )
         )
         )
     }
     }
+
+    private func showFeedbackModule() -> some View {
+        FeedbackBuilder().build(with: .init())
+    }
 }
 }

+ 22 - 0
SUIExamples/Modules/Feedback/FeedbackBuilder.swift

@@ -0,0 +1,22 @@
+//
+//  FeedbackBuilder.swift
+//  SUIExamples
+//
+//  Created by Pavel Yurchenko on 27.11.2024.
+//
+
+import SwiftUI
+
+struct FeedbackBuilder {
+
+    typealias Output = FeedbackVM.Output
+
+    func build(with output: Output) -> some View {
+        FeedbackView()
+            .environment(
+                FeedbackVM(
+                    output: output
+                )
+            )
+    }
+}

+ 22 - 0
SUIExamples/Modules/Feedback/FeedbackVM.swift

@@ -0,0 +1,22 @@
+//
+//  FeedbackVM.swift
+//  SUIExamples
+//
+//  Created by Pavel Yurchenko on 27.11.2024.
+//
+
+import SwiftUI
+
+@Observable
+final class FeedbackVM {
+
+    struct Output {
+
+    }
+
+    let output: Output
+
+    init(output: Output) {
+        self.output = output
+    }
+}

+ 23 - 0
SUIExamples/Modules/Feedback/FeedbackView.swift

@@ -0,0 +1,23 @@
+//
+//  FeedbackView.swift
+//  SUIExamples
+//
+//  Created by Pavel Yurchenko on 17.08.2024.
+//
+
+import SwiftUI
+
+struct FeedbackView: View {
+    @Environment(FeedbackVM.self) private var vm
+
+    var body: some View {
+        VStack {
+            Text("Feedback")
+        }
+        .padding()
+    }
+}
+
+#Preview {
+    FeedbackBuilder().build(with: .init())
+}