|
|
@@ -13,17 +13,43 @@ struct SUIExamplesApp: App {
|
|
|
|
|
|
static let applicationCoordinator = ApplicationCoordinator()
|
|
|
|
|
|
- private let coordinator = applicationCoordinator
|
|
|
- @StateObject private var router: Router = applicationCoordinator.currentRouter
|
|
|
+ @StateObject private var mainRouter: Router = applicationCoordinator.mainCoordinator.currentRouter
|
|
|
+ @StateObject private var productsRouter: Router = applicationCoordinator.productsCoordinator.currentRouter
|
|
|
+ @StateObject private var feedbackRouter: Router = applicationCoordinator.feedbackCoordinator.currentRouter
|
|
|
+ @StateObject private var appCoordinator = applicationCoordinator
|
|
|
|
|
|
var body: some Scene {
|
|
|
WindowGroup {
|
|
|
- NavigationStack(path: $router.path) {
|
|
|
- coordinator.run()
|
|
|
- .navigationDestination(
|
|
|
- for: Route.self,
|
|
|
- destination: coordinator.buildDestination
|
|
|
- )
|
|
|
+ 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
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|