-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
104 lines (94 loc) · 2.82 KB
/
App.tsx
File metadata and controls
104 lines (94 loc) · 2.82 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React, {useState, useEffect, useCallback} from 'react';
import {
StatusBar,
StyleSheet,
useColorScheme,
View,
Platform,
} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {Provider} from 'react-redux';
import store from './redux/store';
import HomeScreen from './components/HomeScreen';
import Settings from './components/Settings';
import Notifications from './components/Notifications';
import Goals from './components/Goals';
import Themes from './components/Themes';
import {themes} from './helpers/colors';
import ImportExport from './components/ImportExport';
import Synchronization from './components/Synchronization';
import PeriodicStats from './components/PeriodicStats';
const Stack = createNativeStackNavigator();
const App: React.FC = () => {
const isDarkMode = useColorScheme() === 'dark';
const theme = isDarkMode ? themes.dark : themes.light;
return (
<Provider store={store}>
<View style={[theme.basic, styles.app]}>
<StatusBar {...theme.status} />
<NavigationContainer>
<Stack.Navigator initialRouteName="HomeScreen">
<Stack.Screen
name="HomeScreen"
component={HomeScreen}
options={{headerShown: false}}
/>
<Stack.Screen
name="PeriodicStats"
component={PeriodicStats}
options={{headerShown: false}}
/>
<Stack.Screen
name="Settings"
component={Settings}
options={{headerShown: false}}
/>
<Stack.Screen
name="Notifications"
component={Notifications}
options={{headerShown: false}}
/>
<Stack.Screen
name="Goals"
component={Goals}
options={{headerShown: false}}
/>
<Stack.Screen
name="ImportExport"
component={ImportExport}
options={{headerShown: false}}
/>
<Stack.Screen
name="Synchronization"
component={Synchronization}
options={{headerShown: false}}
/>
<Stack.Screen
name="Themes"
component={Themes}
options={{headerShown: false}}
/>
</Stack.Navigator>
</NavigationContainer>
</View>
</Provider>
);
};
const styles = StyleSheet.create({
app: {
...Platform.select({
android: {
paddingTop: Number(Platform.Version) > 34 ? StatusBar.currentHeight : 0,
flex: 1,
},
}),
},
});
export default App;