-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
80 lines (67 loc) · 3.02 KB
/
Copy pathApp.js
File metadata and controls
80 lines (67 loc) · 3.02 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
import * as React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { NavigationContainer } from '@react-navigation/native';
import { SafeAreaView, StatusBar } from 'react-native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import RatingProvider from './src/context/RatingContext';
import LoginScreen from './src/screens/LoginScreen';
import TrendingScreen from './src/screens/TrendingScreen';
import MoviesScreen from './src/screens/MoviesScreen';
import RatingScreen from './src/screens/RatingScreen';
import ProfileScreen from './src/screens/ProfileScreen';
import DetailsScreen from './src/screens/DetailsScreen';
import { AuthProvider } from './src/context/AuthContext';
import { navigationRef } from './RootNavigation';
import Ionicons from 'react-native-vector-icons/Ionicons';
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
function HomeScreen() {
const insets = useSafeAreaInsets();
return (
<Tab.Navigator screenOptions={({ route }) => ({
tabBarIcon: ({ color, size }) => {
let iconName;
if (route.name === 'Trending') iconName = 'flame-outline';
if (route.name === 'Movies') iconName = 'videocam-outline';
if (route.name === 'Rating') iconName = 'star-outline';
if (route.name === 'Profile') iconName = 'person-outline';
return <Ionicons name={iconName} size={size} color={color} />;
},
headerShown: false,
tabBarActiveBackgroundColor: '#363636',
tabBarInactiveBackgroundColor: '#363636',
tabBarActiveTintColor: 'white',
tabBarInactiveTintColor: '#808080',
tabBarLabelStyle: { fontSize: 15 },
})}>
<Tab.Screen name="Trending" component={TrendingScreen} options={{ title: 'Em alta' }}/>
<Tab.Screen name="Movies" component={MoviesScreen} options={{ title: 'Filmes' }}/>
<Tab.Screen name="Rating" component={RatingScreen} options={{ title: 'Favoritos' }}/>
<Tab.Screen name="Profile" component={ProfileScreen} options={{ title: 'Perfil' }}/>
</Tab.Navigator>
);
}
function App() {
return (
<AuthProvider>
<RatingProvider>
<SafeAreaProvider>
<StatusBar barStyle="light-content" />
<NavigationContainer ref={navigationRef}>
<Stack.Navigator>
<Stack.Screen name="Login" component={LoginScreen} options={{ headerShown: false }} />
<Stack.Screen name="Home" component={HomeScreen} options={{ headerShown: false }} />
<Stack.Screen name="Details" component={DetailsScreen} options={{
title: 'Sobre o Filme', headerTintColor: '#DCDCDC',
headerStyle: { backgroundColor: '#000000' }
}} />
</Stack.Navigator>
</NavigationContainer>
</SafeAreaProvider>
</RatingProvider>
</AuthProvider>
);
}
export default App;