|
|
@@ -13,10 +13,6 @@ struct SUIExamplesApp: App {
|
|
|
|
|
|
static let applicationCoordinator = ApplicationCoordinator()
|
|
|
|
|
|
- @StateObject private var mainCoordinator = applicationCoordinator.mainCoordinator
|
|
|
- @StateObject private var mainRouter = applicationCoordinator.mainCoordinator.currentRouter
|
|
|
-
|
|
|
- @StateObject private var productsRouter = applicationCoordinator.productsCoordinator.currentRouter
|
|
|
@StateObject private var feedbackRouter = applicationCoordinator.feedbackCoordinator.currentRouter
|
|
|
@StateObject private var appCoordinator = applicationCoordinator
|
|
|
|
|
|
@@ -24,38 +20,15 @@ struct SUIExamplesApp: App {
|
|
|
WindowGroup {
|
|
|
TabView(selection: $appCoordinator.tabSelection) {
|
|
|
Tab(ApplicationTab.main.rawValue, systemImage: "tray.and.arrow.down.fill", value: ApplicationTab.main) {
|
|
|
- NavigationStack(path: $mainRouter.path) {
|
|
|
- appCoordinator.mainCoordinator.run()
|
|
|
- .navigationDestination(
|
|
|
- for: Route.self,
|
|
|
- destination: appCoordinator.mainCoordinator.buildDestination
|
|
|
- )
|
|
|
- }
|
|
|
- .sheet(
|
|
|
- item: $mainCoordinator.presentation,
|
|
|
- onDismiss: mainCoordinator.onDismissPresentation,
|
|
|
- content: mainCoordinator.buildPresentation
|
|
|
- )
|
|
|
+ MainNavigationView.build(with: appCoordinator.mainCoordinator)
|
|
|
}
|
|
|
|
|
|
Tab(ApplicationTab.products.rawValue, systemImage: "tray.and.arrow.down.fill", value: ApplicationTab.products) {
|
|
|
- NavigationStack(path: $productsRouter.path) {
|
|
|
- appCoordinator.productsCoordinator.run()
|
|
|
- .navigationDestination(
|
|
|
- for: Route.self,
|
|
|
- destination: appCoordinator.productsCoordinator.buildDestination
|
|
|
- )
|
|
|
- }
|
|
|
+ ProductsNavigationView.build(with: appCoordinator.productsCoordinator)
|
|
|
}
|
|
|
|
|
|
Tab(ApplicationTab.feedback.rawValue, systemImage: "tray.and.arrow.down.fill", value: ApplicationTab.feedback) {
|
|
|
- NavigationStack(path: $feedbackRouter.path) {
|
|
|
- appCoordinator.feedbackCoordinator.run()
|
|
|
- .navigationDestination(
|
|
|
- for: Route.self,
|
|
|
- destination: appCoordinator.feedbackCoordinator.buildDestination
|
|
|
- )
|
|
|
- }
|
|
|
+ FeedbackNavigationView.build(with: appCoordinator.feedbackCoordinator)
|
|
|
}
|
|
|
}
|
|
|
}
|