@@ -53,12 +53,10 @@ private struct MainTabView: View {
5353 }
5454
5555 private var categoriesTab : some View {
56- NavigationStack {
57- CategoriesNavigationView ( )
58- }
59- . tabItem {
60- Label ( " Categories " , systemImage: " list.bullet " )
61- }
56+ CategoriesNavigationView ( )
57+ . tabItem {
58+ Label ( " Categories " , systemImage: " list.bullet " )
59+ }
6260 }
6361
6462 private var searchTab : some View {
@@ -108,27 +106,29 @@ private struct CategoriesNavigationView: View {
108106 @State private var path = NavigationPath ( )
109107
110108 var body : some View {
111- CategoriesScreen ( onCategoryClick: { categoryId, categoryName in
112- path. append ( CategoryFaqListRoute ( categoryId: categoryId, categoryName: categoryName) )
113- } )
114- . navigationDestination ( for: CategoryFaqListRoute . self) { route in
115- FaqListScreen (
116- categoryId: route. categoryId,
117- categoryName: route. categoryName,
118- onFaqClick: { faqId in
119- path. append ( FaqRoute ( categoryId: route. categoryId, faqId: faqId) )
120- }
121- )
122- }
123- . navigationDestination ( for: FaqRoute . self) { route in
124- FaqDetailScreen (
125- categoryId: route. categoryId,
126- faqId: route. faqId,
127- onPaywall: { path. append ( PaywallRoute ( ) ) }
128- )
129- }
130- . navigationDestination ( for: PaywallRoute . self) { _ in
131- PaywallScreen ( )
109+ NavigationStack ( path: $path) {
110+ CategoriesScreen ( onCategoryClick: { categoryId, categoryName in
111+ path. append ( CategoryFaqListRoute ( categoryId: categoryId, categoryName: categoryName) )
112+ } )
113+ . navigationDestination ( for: CategoryFaqListRoute . self) { route in
114+ FaqListScreen (
115+ categoryId: route. categoryId,
116+ categoryName: route. categoryName,
117+ onFaqClick: { faqId in
118+ path. append ( FaqRoute ( categoryId: route. categoryId, faqId: faqId) )
119+ }
120+ )
121+ }
122+ . navigationDestination ( for: FaqRoute . self) { route in
123+ FaqDetailScreen (
124+ categoryId: route. categoryId,
125+ faqId: route. faqId,
126+ onPaywall: { path. append ( PaywallRoute ( ) ) }
127+ )
128+ }
129+ . navigationDestination ( for: PaywallRoute . self) { _ in
130+ PaywallScreen ( )
131+ }
132132 }
133133 }
134134}
0 commit comments