-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
60 lines (54 loc) · 1.76 KB
/
Copy pathApp.js
File metadata and controls
60 lines (54 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import 'react-native-gesture-handler';
import 'react-native-url-polyfill/auto';
import React, { useEffect } from 'react';
import { NavigationContainer, DefaultTheme } from '@react-navigation/native';
import { StatusBar } from 'expo-status-bar';
import { TextInput } from 'react-native';
import { AuthProvider } from './src/context/AuthContext';
import { OperationalProvider } from './src/context/OperationalContext';
import AppNavigator from './src/navigation/AppNavigator';
import ErrorBoundary from './src/components/ErrorBoundary';
import { installGlobalErrorHandlers } from './src/utils/errorHandler';
import { installConsoleCapture } from './src/utils/logger';
import { ThemeProvider, useTheme } from './src/theme/ThemeProvider';
function ThemedNav() {
const { theme } = useTheme();
const navTheme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
background: theme.colors.bg,
card: theme.colors.card,
border: theme.colors.border,
text: theme.colors.text,
primary: theme.colors.accent,
},
};
return (
<NavigationContainer theme={navTheme}>
<StatusBar style={theme.mode === 'dark' ? 'light' : 'dark'} />
<AppNavigator />
</NavigationContainer>
);
}
export default function App() {
useEffect(() => {
TextInput.defaultProps = TextInput.defaultProps || {};
if (!TextInput.defaultProps.placeholderTextColor) {
TextInput.defaultProps.placeholderTextColor = '#6b7280';
}
if (__DEV__) installConsoleCapture();
installGlobalErrorHandlers();
}, []);
return (
<ErrorBoundary>
<ThemeProvider>
<AuthProvider>
<OperationalProvider>
<ThemedNav />
</OperationalProvider>
</AuthProvider>
</ThemeProvider>
</ErrorBoundary>
);
}