Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesPull RequestsActionsSecurityInsightsSettings
✨ AI
More
Blame · Line-by-line history

App.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.

App.tsxBlame57 lines · 1 contributor
9a8fbedClaude1import React from 'react';
2import { NavigationContainer, DefaultTheme } from '@react-navigation/native';
3import { SafeAreaProvider } from 'react-native-safe-area-context';
4import { StatusBar } from 'expo-status-bar';
5import { View, ActivityIndicator, StyleSheet } from 'react-native';
6import { AppNavigator } from './src/navigation/AppNavigator';
7import { AuthNavigator } from './src/navigation/AuthNavigator';
8import { useAuth } from './src/hooks/useAuth';
9import { colors } from './src/theme/colors';
10
11const NavTheme = {
12 ...DefaultTheme,
13 dark: true,
14 colors: {
15 ...DefaultTheme.colors,
16 primary: colors.accentBlue,
17 background: colors.bg,
18 card: colors.bgSecondary,
19 text: colors.text,
20 border: colors.border,
21 notification: colors.accentRed,
22 },
23};
24
25function RootNavigator(): React.ReactElement {
26 const { isAuthenticated, isLoading } = useAuth();
27
28 if (isLoading) {
29 return (
30 <View style={styles.splash}>
31 <ActivityIndicator size="large" color={colors.accentBlue} />
32 </View>
33 );
34 }
35
36 return isAuthenticated ? <AppNavigator /> : <AuthNavigator />;
37}
38
39export default function App(): React.ReactElement {
40 return (
41 <SafeAreaProvider>
42 <StatusBar style="light" />
43 <NavigationContainer theme={NavTheme}>
44 <RootNavigator />
45 </NavigationContainer>
46 </SafeAreaProvider>
47 );
48}
49
50const styles = StyleSheet.create({
51 splash: {
52 flex: 1,
53 backgroundColor: colors.bg,
54 alignItems: 'center',
55 justifyContent: 'center',
56 },
57});