|
|
@@ -37,7 +37,7 @@ final class MainCoordinator: BaseCoordinator {
|
|
|
func buildPresentation(_ route: Route) -> some View {
|
|
|
switch route {
|
|
|
case .products:
|
|
|
- ModalProductsNavigationView.build(with: ModalProductsCoordinator())
|
|
|
+ ModalProductsNavigationView(ModalProductsCoordinator())
|
|
|
case .cart:
|
|
|
showCartModule()
|
|
|
default:
|
|
|
@@ -129,7 +129,12 @@ struct MainNavigationView: View {
|
|
|
|
|
|
@StateObject private var coordinator: MainCoordinator
|
|
|
@StateObject private var router: Router
|
|
|
-
|
|
|
+
|
|
|
+ init(_ coordinator: MainCoordinator) {
|
|
|
+ _coordinator = StateObject(wrappedValue: coordinator)
|
|
|
+ _router = StateObject(wrappedValue: coordinator.currentRouter)
|
|
|
+ }
|
|
|
+
|
|
|
var body: some View {
|
|
|
NavigationStack(path: $router.path) {
|
|
|
coordinator.run()
|
|
|
@@ -143,8 +148,4 @@ struct MainNavigationView: View {
|
|
|
content: coordinator.buildPresentation
|
|
|
)
|
|
|
}
|
|
|
-
|
|
|
- static func build(with coordinator: MainCoordinator) -> some View {
|
|
|
- MainNavigationView(coordinator: coordinator, router: coordinator.currentRouter)
|
|
|
- }
|
|
|
}
|