Repository navigation
Expand file tree
/
Copy pathApp.js
More file actions
60 lines (55 loc) · 1.55 KB
/
Copy pathApp.js
File metadata and controls
60 lines (55 loc) · 1.55 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 from 'react';
import {StatusBar, StyleSheet} from 'react-native';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {
DarkTheme,
DefaultTheme,
NavigationContainer,
} from '@react-navigation/native';
import RootNavigator from './src/navigation/RootNavigator';
import {navigationRef} from './src/navigation/navigationRef';
import {AppStateProvider} from './src/state/AppState';
import {ThemeProvider, useTheme} from './src/theme';
const AppContent = () => {
const {colors, mode} = useTheme();
const base = mode === 'dark' ? DarkTheme : DefaultTheme;
const navigationTheme = {
...base,
colors: {
...base.colors,
background: colors.background,
border: colors.border,
card: colors.background,
primary: colors.accent,
text: colors.text,
},
};
return (
<NavigationContainer ref={navigationRef} theme={navigationTheme}>
<StatusBar
backgroundColor={colors.background}
barStyle={mode === 'dark' ? 'light-content' : 'dark-content'}
/>
<RootNavigator />
</NavigationContainer>
);
};
const App = () => (
<GestureHandlerRootView style={styles.root}>
<SafeAreaProvider>
<ThemeProvider>
<AppStateProvider>
<AppContent />
</AppStateProvider>
</ThemeProvider>
</SafeAreaProvider>
</GestureHandlerRootView>
);
const styles = StyleSheet.create({
root: {
flex: 1,
},
});
export default App;