-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
43 lines (38 loc) · 1.12 KB
/
App.tsx
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
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import HomeScreen from './screens/HomeScreen';
import CalendarScreen from './screens/CalendarScreen';
import { ThemeProvider, useTheme } from './context/ThemeContext';
import { lightTheme, darkTheme } from './styles/theme';
const Stack = createStackNavigator();
function AppNavigator() {
const { theme } = useTheme();
const colors = theme === 'light' ? lightTheme : darkTheme;
return (
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerStyle: {
backgroundColor: colors.background,
},
headerTintColor: colors.text,
headerTitleStyle: {
fontWeight: 'bold',
},
}}
>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Calendar" component={CalendarScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
function App() {
return (
<ThemeProvider>
<AppNavigator />
</ThemeProvider>
);
}
export default App;