1
1
import * as React from 'react' ;
2
- import { createNativeStackNavigator } from '@react-navigation/native-stack' ;
3
- import OnBoardingHome from '../screens/Onboarding/OnBoardingHome' ;
4
- import CreateWallet from '../screens/Onboarding/CreateWallet' ;
5
- import { SCREEN_NAMES } from './screenNames' ;
6
- import ConfirmSeed from '../screens/Onboarding/ConfirmSeed' ;
7
- import PinSetup from '../screens/Onboarding/PinSetup' ;
8
- import ConfirmPin from '../screens/Onboarding/ConfirmPin' ;
2
+ import { createNativeStackNavigator } from '@react-navigation/native-stack' ;
3
+ import { useConnectionContext } from '../providers/ConnectionProvider' ;
4
+ import { Splash } from '../components/Splash' ;
5
+
6
+ // Onboarding screens
7
+ import OnBoardingHome from '../screens/Onboarding' ;
8
+ import CreateWallet from '../screens/onboarding/CreateWallet' ;
9
+ import ConfirmSeed from '../screens/onboarding/ConfirmSeed' ;
10
+ import PinSetup from '../screens/onboarding/PinSetup' ;
11
+ import ConfirmPin from '../screens/onboarding/ConfirmPin' ;
12
+
13
+ // Main app screens
9
14
import Dashboard from '../screens/Home/Dashboard' ;
10
- import { useConnectionContext } from '../providers/ConnectionProvider' ;
11
- import { Splash } from '../components/Splash' ;
12
15
import VerifyPin from '../screens/Home/VerifyPin' ;
13
- import CreateWallet from '../screens/Onboarding/CreateWallet' ; // Already included
16
+
17
+ // Screen name constants
18
+ import { SCREEN_NAMES } from './screenNames' ;
14
19
15
20
export type RootStackParamList = {
16
21
OnboardingHome : undefined ;
17
22
CreateWallet : undefined ;
18
- ConfirmSeed : { words : string [ ] } ;
19
- PinSetup : { words : string [ ] } ;
20
- ConfirmPin : { words : string [ ] ; walletPin : number [ ] } ;
23
+ ConfirmSeed : { words : string [ ] } ;
24
+ PinSetup : { words : string [ ] } ;
25
+ ConfirmPin : { words : string [ ] ; walletPin : number [ ] } ;
21
26
Dashboard : undefined ;
22
27
VerifyPin : undefined ;
23
28
ZKPool : undefined ;
@@ -31,66 +36,52 @@ export type RootStackParamList = {
31
36
const Stack = createNativeStackNavigator < RootStackParamList > ( ) ;
32
37
33
38
function OnBoardingNavigation ( ) {
34
- const { loading, isWalletConnected} = useConnectionContext ( ) ;
39
+ const { loading, isWalletConnected } = useConnectionContext ( ) ;
40
+
35
41
if ( loading ) {
36
42
return < Splash /> ;
37
43
}
44
+
38
45
return (
39
- < Stack . Navigator >
46
+ < Stack . Navigator screenOptions = { { headerShown : false } } >
40
47
{ isWalletConnected ? (
41
- < Stack . Group >
42
- < Stack . Screen
43
- options = { { headerShown : false } }
44
- name = { SCREEN_NAMES . VerifyPin }
45
- component = { VerifyPin }
46
- />
47
- < Stack . Screen
48
- options = { { headerShown : false } }
49
- name = { SCREEN_NAMES . Dashboard }
50
- component = { Dashboard }
51
- />
52
- </ Stack . Group >
48
+ // Logged-in / wallet connected flow
49
+ < >
50
+ < Stack . Screen name = { SCREEN_NAMES . VerifyPin } component = { VerifyPin } />
51
+ < Stack . Screen name = { SCREEN_NAMES . Dashboard } component = { Dashboard } />
52
+ </ >
53
53
) : (
54
- < Stack . Group >
54
+ // Onboarding flow
55
+ < >
55
56
< Stack . Screen
56
- options = { { headerShown : false } }
57
57
name = { SCREEN_NAMES . OnboardingHome }
58
58
component = { OnBoardingHome }
59
59
/>
60
60
< Stack . Screen
61
- options = { { headerShown : false } }
62
61
name = { SCREEN_NAMES . CreateWallet }
63
62
component = { CreateWallet }
64
63
/>
65
64
< Stack . Screen
66
- options = { { headerShown : false } }
67
65
name = { SCREEN_NAMES . ConfirmSeed }
68
66
component = { ConfirmSeed }
69
67
/>
70
68
< Stack . Screen
71
- options = { { headerShown : false } }
72
69
name = { SCREEN_NAMES . PinSetup }
73
70
component = { PinSetup }
74
71
/>
75
72
< Stack . Screen
76
- options = { { headerShown : false } }
77
73
name = { SCREEN_NAMES . ConfirmPin }
78
74
component = { ConfirmPin }
79
75
/>
80
76
< Stack . Screen
81
- options = { { headerShown : false } }
82
77
name = { SCREEN_NAMES . Dashboard }
83
78
component = { Dashboard }
84
79
/>
85
- < Stack . Screen
86
- options = { { headerShown : false } }
87
- name = { SCREEN_NAMES . CreateWallet }
88
- component = { CreateWallet }
89
- />
90
- </ Stack . Group >
80
+ </ >
91
81
) }
92
82
</ Stack . Navigator >
93
83
) ;
94
84
}
95
85
96
86
export default OnBoardingNavigation ;
87
+
0 commit comments