@@ -21,23 +21,9 @@ struct MainApp: Scene {
21
21
unitTestView ( )
22
22
} else {
23
23
if isLoggedIn {
24
- homeRoute ( )
25
- . onOpenURL { url in
26
- // You can test deep links by setting the URL Scheme to "testlink".
27
- // Example: testlink://
[email protected] &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 ( )
32
25
} else {
33
- authRoute ( )
34
- . onOpenURL { url in
35
- // You can test deep links by setting the URL Scheme to "testlink".
36
- // Example: testlink://
[email protected] &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 ( )
41
27
}
42
28
}
43
29
}
@@ -52,22 +38,32 @@ struct MainApp: Scene {
52
38
. frame ( maxWidth: . infinity, maxHeight: . infinity)
53
39
. preferredColorScheme ( isDarkMode ? . dark : . light)
54
40
}
41
+ }
55
42
56
- // MARK: - Auth
43
+ private struct AuthRoute : View {
57
44
private let linkNavigator = SingleLinkNavigator (
58
45
routeBuilderItemList: AuthRouteGroup ( ) . routers,
59
46
dependency: NavigatorDependency ( ) )
60
47
61
- @ViewBuilder
62
- func authRoute( ) -> some View {
48
+ var body : some View {
63
49
LinkNavigationView (
64
50
linkNavigator: linkNavigator,
65
51
item: . init( routePath: Defaults [ . isOnboardingCompleted] ? RoutePath . login : RoutePath . onboarding)
66
52
)
67
53
. 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://
[email protected] &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
+ }
68
61
}
62
+ }
63
+
64
+ private struct HomeRoute : View {
65
+ @Default ( . language) var language
69
66
70
- // MARK: - Home
71
67
private let tabLinkNavigator = TabLinkNavigator (
72
68
routeBuilderItemList: HomeRouteGroup ( ) . routers,
73
69
dependency: NavigatorDependency ( ) )
@@ -87,9 +83,8 @@ struct MainApp: Scene {
87
83
linkItem: . init( routePath: . settings) )
88
84
]
89
85
90
- @ViewBuilder
91
- func homeRoute( ) -> some View {
92
- TabLinkNavigationView (
86
+ var body : some View {
87
+ return TabLinkNavigationView (
93
88
linkNavigator: tabLinkNavigator,
94
89
isHiddenDefaultTabbar: false ,
95
90
tabItemList: tabItems,
0 commit comments