-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.js
More file actions
147 lines (137 loc) · 4.38 KB
/
Copy pathApp.js
File metadata and controls
147 lines (137 loc) · 4.38 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import React, { useEffect } from 'react';
import './global.css';
import { StatusBar } from 'expo-status-bar';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { ActivityIndicator, Text, TextInput, View } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { useFonts, Inter_400Regular, Inter_500Medium, Inter_700Bold } from '@expo-google-fonts/inter';
// Import theme provider and hook
import { ThemeProvider } from './src/context/ThemeContext';
import { useAppTheme } from './src/hooks/useAppTheme';
// Import screens
import HomeScreen from './src/screens/HomeScreen';
import LocationDetailScreen from './src/screens/LocationDetailScreen';
import NewsDetailScreen from './src/screens/NewsDetailScreen';
import RestaurantsDetailScreen from './src/screens/RestaurantsDetailScreen';
import PlacesDetailScreen from './src/screens/PlacesDetailScreen';
import HolyPlacesDetailScreen from './src/screens/HolyPlacesDetailScreen';
import AccommodationDetailScreen from './src/screens/AccommodationDetailScreen';
import ServicesDetailScreen from './src/screens/ServicesDetailScreen';
import HistoryDetailScreen from './src/screens/HistoryDetailScreen';
const Stack = createStackNavigator();
// Create the app content component that uses theme
function AppContent() {
const { colors, isDarkMode } = useAppTheme();
return (
<NavigationContainer>
<StatusBar style={isDarkMode ? "light" : "dark"} backgroundColor={colors.background} />
<Stack.Navigator
initialRouteName="Home"
screenOptions={{
headerShown: false,
cardStyle: { backgroundColor: colors.background },
}}
>
<Stack.Screen
name="Home"
component={HomeScreen}
options={{
title: 'CurioCity',
}}
/>
<Stack.Screen
name="LocationDetail"
component={LocationDetailScreen}
options={{
title: 'Location Details',
}}
/>
<Stack.Screen
name="NewsDetail"
component={NewsDetailScreen}
options={{
title: 'Local News',
}}
/>
<Stack.Screen
name="RestaurantsDetail"
component={RestaurantsDetailScreen}
options={{
title: 'Restaurants',
}}
/>
<Stack.Screen
name="PlacesDetail"
component={PlacesDetailScreen}
options={{
title: 'Places to Visit',
}}
/>
<Stack.Screen
name="HolyPlacesDetail"
component={HolyPlacesDetailScreen}
options={{
title: 'Holy Places',
}}
/>
<Stack.Screen
name="AccommodationDetail"
component={AccommodationDetailScreen}
options={{
title: 'Accommodation',
}}
/>
<Stack.Screen
name="ServicesDetail"
component={ServicesDetailScreen}
options={{
title: 'Services & Amenities',
}}
/>
<Stack.Screen
name="HistoryDetail"
component={HistoryDetailScreen}
options={{
title: 'History & Culture',
}}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
export default function App() {
const [fontsLoaded] = useFonts({
Inter_400Regular,
Inter_500Medium,
Inter_700Bold,
});
useEffect(() => {
if (fontsLoaded) {
Text.defaultProps = Text.defaultProps || {};
Text.defaultProps.style = Text.defaultProps.style
? [Text.defaultProps.style, { fontFamily: 'Inter_400Regular' }]
: { fontFamily: 'Inter_400Regular' };
TextInput.defaultProps = TextInput.defaultProps || {};
TextInput.defaultProps.style = TextInput.defaultProps.style
? [TextInput.defaultProps.style, { fontFamily: 'Inter_400Regular' }]
: { fontFamily: 'Inter_400Regular' };
}
}, [fontsLoaded]);
if (!fontsLoaded) {
return (
<SafeAreaProvider>
<View className="flex-1 items-center justify-center bg-white">
<ActivityIndicator size="large" />
</View>
</SafeAreaProvider>
);
}
return (
<SafeAreaProvider>
<ThemeProvider>
<AppContent />
</ThemeProvider>
</SafeAreaProvider>
);
}