@@ -21,23 +21,9 @@ struct MainApp: Scene {
2121 unitTestView ( )
2222 } else {
2323 if isLoggedIn {
24- homeRoute ( )
25- . onOpenURL { url in
26- // You can test deep links by setting the URL Scheme to "testlink".
27- // Example: testlink://host?email=foo@gmail.com&password=Aa@12345
28- let action = ActionButton ( title: " OK " , style: . cancel)
29- let alert = Alert ( title: " Deeplink URL: " , message: url. absoluteString, buttons: [ action] , flagType: . error)
30- tabLinkNavigator. selectedTabPartialNavigator. alert ( model: alert)
31- }
24+ HomeRoute ( )
3225 } else {
33- authRoute ( )
34- . onOpenURL { url in
35- // You can test deep links by setting the URL Scheme to "testlink".
36- // Example: testlink://host?email=foo@gmail.com&password=Aa@12345
37- let action = ActionButton ( title: " OK " , style: . cancel)
38- let alert = Alert ( title: " Deeplink URL: " , message: url. absoluteString, buttons: [ action] , flagType: . error)
39- linkNavigator. alert ( target: . root, model: alert)
40- }
26+ AuthRoute ( )
4127 }
4228 }
4329 }
@@ -52,22 +38,32 @@ struct MainApp: Scene {
5238 . frame ( maxWidth: . infinity, maxHeight: . infinity)
5339 . preferredColorScheme ( isDarkMode ? . dark : . light)
5440 }
41+ }
5542
56- // MARK: - Auth
43+ private struct AuthRoute : View {
5744 private let linkNavigator = SingleLinkNavigator (
5845 routeBuilderItemList: AuthRouteGroup ( ) . routers,
5946 dependency: NavigatorDependency ( ) )
6047
61- @ViewBuilder
62- func authRoute( ) -> some View {
48+ var body : some View {
6349 LinkNavigationView (
6450 linkNavigator: linkNavigator,
6551 item: . init( routePath: Defaults [ . isOnboardingCompleted] ? RoutePath . login : RoutePath . onboarding)
6652 )
6753 . background ( Color ( R . color. backgroundPrimary) )
54+ . onOpenURL { url in
55+ // You can test deep links by setting the URL Scheme to "testlink".
56+ // Example: testlink://host?email=foo@gmail.com&password=Aa@12345
57+ let action = ActionButton ( title: " OK " , style: . cancel)
58+ let alert = Alert ( title: " Deeplink URL: " , message: url. absoluteString, buttons: [ action] , flagType: . error)
59+ linkNavigator. alert ( target: . root, model: alert)
60+ }
6861 }
62+ }
63+
64+ private struct HomeRoute : View {
65+ @Default ( . language) var language
6966
70- // MARK: - Home
7167 private let tabLinkNavigator = TabLinkNavigator (
7268 routeBuilderItemList: HomeRouteGroup ( ) . routers,
7369 dependency: NavigatorDependency ( ) )
@@ -87,9 +83,8 @@ struct MainApp: Scene {
8783 linkItem: . init( routePath: . settings) )
8884 ]
8985
90- @ViewBuilder
91- func homeRoute( ) -> some View {
92- TabLinkNavigationView (
86+ var body : some View {
87+ return TabLinkNavigationView (
9388 linkNavigator: tabLinkNavigator,
9489 isHiddenDefaultTabbar: false ,
9590 tabItemList: tabItems,
0 commit comments