Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history

RootNavigator.tsx

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

RootNavigator.tsxBlame69 lines · 1 contributor
9d7a803Claude1import React from 'react';
c53cf00Claude2import { NavigationContainer } from '@react-navigation/native';
3import { createNativeStackNavigator } from '@react-navigation/native-stack';
4import { View, ActivityIndicator } from 'react-native';
5import { colors } from '../theme/colors';
6import { AuthScreen } from '../screens/AuthScreen';
7import { MainTabNavigator } from './MainTabNavigator';
8import { useAuth } from '../hooks/useAuth';
9d7a803Claude9import { AuthContext } from './AuthContext';
c53cf00Claude10
9d7a803Claude11// Re-export AuthContext so callers can do: import { AuthContext } from '../navigation/RootNavigator'
12export { AuthContext };
13export type { AuthContextValue } from './AuthContext';
c53cf00Claude14
15// ─── Root param list ──────────────────────────────────────────────────────────
16
17type RootStackParamList = {
18 Auth: undefined;
19 Main: undefined;
20};
21
22const Stack = createNativeStackNavigator<RootStackParamList>();
23
24// ─── Navigator ────────────────────────────────────────────────────────────────
25
26export function RootNavigator() {
27 const auth = useAuth();
28
29 if (auth.loading) {
30 return (
31 <View style={{ flex: 1, backgroundColor: colors.bg, alignItems: 'center', justifyContent: 'center' }}>
32 <ActivityIndicator size="large" color={colors.accent} />
33 </View>
34 );
35 }
36
37 return (
9d7a803Claude38 <AuthContext.Provider
39 value={{
40 user: auth.user,
41 token: auth.token,
42 login: auth.login,
43 logout: auth.logout,
44 }}
45 >
c53cf00Claude46 <NavigationContainer
47 theme={{
48 dark: true,
49 colors: {
50 primary: colors.accent,
51 background: colors.bg,
52 card: colors.bgSecondary,
53 text: colors.text,
54 border: colors.border,
55 notification: colors.accent,
56 },
57 }}
58 >
59 <Stack.Navigator screenOptions={{ headerShown: false }}>
60 {auth.isAuthenticated ? (
61 <Stack.Screen name="Main" component={MainTabNavigator} />
62 ) : (
63 <Stack.Screen name="Auth" component={AuthScreen} />
64 )}
65 </Stack.Navigator>
66 </NavigationContainer>
67 </AuthContext.Provider>
68 );
69}