Skip to content

Commit 65052f9

Browse files
committed
Fix
1 parent 91c0086 commit 65052f9

File tree

1 file changed

+23
-35
lines changed

1 file changed

+23
-35
lines changed

src/navigation/ZKMarket.tsx

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
import * as React from 'react';
22
import { createNativeStackNavigator } from '@react-navigation/native-stack';
3+
import { useConnectionContext } from '../providers/ConnectionProvider';
4+
import { Splash } from '../components/Splash';
5+
import { SCREEN_NAMES } from './screenNames';
6+
7+
// Screen Imports
38
import OnBoardingHome from '../screens/Onboarding/OnBoardingHome';
49
import CreateWallet from '../screens/Onboarding/CreateWallet';
5-
import { SCREEN_NAMES } from './screenNames'; // Ensure this import is correct
610
import ConfirmSeed from '../screens/Onboarding/ConfirmSeed';
711
import PinSetup from '../screens/Onboarding/PinSetup';
812
import ConfirmPin from '../screens/Onboarding/ConfirmPin';
913
import Dashboard from '../screens/Home/Dashboard';
10-
import { useConnectionContext } from '../providers/ConnectionProvider';
11-
import { Splash } from '../components/Splash';
1214
import VerifyPin from '../screens/Home/VerifyPin';
13-
import Dashboard from '../screens/Home/Dashboard';
14-
import { useConnectionContext } from '../providers/ConnectionProvider';
15-
import { Splash } from '../components/Splash';
16-
import VerifyPin from '../screens/Home/VerifyPin';
17-
import ZKPoolEnter from '../navigation/ZKPoolEnter'; // New screen for ZK pool entry
18-
import ZKPoolExit from '../navigation/ZKPoolExit'; // New screen for ZK pool exit
15+
import ZKPoolEnter from './ZKPoolEnter'; // Adjusted path if needed
16+
import ZKPoolExit from './ZKPoolExit'; // Adjusted path if needed
1917

2018
export type RootStackParamList = {
2119
OnboardingHome: undefined;
@@ -25,78 +23,68 @@ export type RootStackParamList = {
2523
ConfirmPin: { words: string[]; walletPin: number[] };
2624
Dashboard: undefined;
2725
VerifyPin: undefined;
28-
ZKPoolEnter: undefined; // New route for entering ZK pool
29-
ZKPoolExit: undefined; // New route for exiting ZK pool
26+
ZKPoolEnter: undefined;
27+
ZKPoolExit: undefined;
3028
};
3129

3230
const Stack = createNativeStackNavigator<RootStackParamList>();
3331

34-
function OnBoardingNavigation() {
32+
const OnBoardingNavigation = () => {
3533
const { loading, isWalletConnected } = useConnectionContext();
36-
34+
3735
if (loading) {
3836
return <Splash />;
3937
}
4038

4139
return (
42-
<Stack.Navigator>
40+
<Stack.Navigator screenOptions={{ headerShown: false }}>
41+
{/* Authenticated User Flow */}
4342
{isWalletConnected ? (
4443
<Stack.Group>
45-
{/* Verify Pin and Dashboard for authenticated users */}
4644
<Stack.Screen
47-
options={{ headerShown: false }}
4845
name={SCREEN_NAMES.VerifyPin}
4946
component={VerifyPin}
5047
/>
5148
<Stack.Screen
52-
options={{ headerShown: false }}
5349
name={SCREEN_NAMES.Dashboard}
5450
component={Dashboard}
5551
/>
52+
<Stack.Screen
53+
name={SCREEN_NAMES.ZKPoolEnter}
54+
component={ZKPoolEnter}
55+
/>
56+
<Stack.Screen
57+
name={SCREEN_NAMES.ZKPoolExit}
58+
component={ZKPoolExit}
59+
/>
5660
</Stack.Group>
5761
) : (
62+
/* Onboarding Flow for New Users */
5863
<Stack.Group>
59-
{/* Onboarding screens for users without a wallet */}
6064
<Stack.Screen
61-
options={{ headerShown: false }}
6265
name={SCREEN_NAMES.OnboardingHome}
6366
component={OnBoardingHome}
6467
/>
6568
<Stack.Screen
66-
options={{ headerShown: false }}
6769
name={SCREEN_NAMES.CreateWallet}
6870
component={CreateWallet}
6971
/>
7072
<Stack.Screen
71-
options={{ headerShown: false }}
7273
name={SCREEN_NAMES.ConfirmSeed}
7374
component={ConfirmSeed}
7475
/>
7576
<Stack.Screen
76-
options={{ headerShown: false }}
7777
name={SCREEN_NAMES.PinSetup}
7878
component={PinSetup}
7979
/>
8080
<Stack.Screen
81-
options={{ headerShown: false }}
8281
name={SCREEN_NAMES.ConfirmPin}
8382
component={ConfirmPin}
8483
/>
8584
</Stack.Group>
8685
)}
87-
{/* ZK Pool Entry and Exit Screens, common to both authenticated and unauthenticated users */}
88-
<Stack.Screen
89-
options={{ headerShown: false }}
90-
name={SCREEN_NAMES.ZKPoolEnter}
91-
component={ZKPoolEnter}
92-
/>
93-
<Stack.Screen
94-
options={{ headerShown: false }}
95-
name={SCREEN_NAMES.ZKPoolExit}
96-
component={ZKPoolExit}
97-
/>
9886
</Stack.Navigator>
9987
);
100-
}
88+
};
10189

10290
export default OnBoardingNavigation;

0 commit comments

Comments
 (0)