-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
53 lines (48 loc) · 1.54 KB
/
App.js
File metadata and controls
53 lines (48 loc) · 1.54 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
import React, { useEffect } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { ThemeProvider } from './src/context/ThemeContext';
import { registerForPushNotificationsAsync } from './src/utils/notifications';
import WelcomeScreen from './src/screens/WelcomeScreen';
import HomeScreen from './src/screens/HomeScreen';
import AddSubscriptionScreen from './src/screens/AddSubscriptionScreen';
import { StatusBar } from 'expo-status-bar';
import { useTheme } from './src/context/ThemeContext';
const Stack = createStackNavigator();
const AppContent = () => {
const { isDarkMode } = useTheme();
return (
<>
<StatusBar style={isDarkMode ? 'light' : 'dark'} />
<NavigationContainer>
<Stack.Navigator initialRouteName="Welcome">
<Stack.Screen
name="Welcome"
component={WelcomeScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Home"
component={HomeScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="AddSubscription"
component={AddSubscriptionScreen}
options={{ headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
</>
);
};
export default function App() {
useEffect(() => {
registerForPushNotificationsAsync();
}, []);
return (
<ThemeProvider>
<AppContent />
</ThemeProvider>
);
}