-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
85 lines (67 loc) · 2.32 KB
/
Copy pathApp.js
File metadata and controls
85 lines (67 loc) · 2.32 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
import React from 'react';
import 'react-native-gesture-handler';
import { Platform, StyleSheet, Text, View } from 'react-native';
import {MaterialIcons }from '@expo/vector-icons';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import {reducer} from './src/components/reducers/reducer';
import {Provider} from 'react-redux';
import { createStore } from 'redux'
import HomeScreen from './src/screen/homeScreen';
import SearchScreen from './src/screen/SearchScreen';
import Explore from './src/screen/Explore';
import Subscribe from './src/screen/Subscribe';
import VideoPlayer from './src/screen/VideoPlayer';
import constant from 'expo-constants';
const store = createStore(reducer);
const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();
const RootHome = () => {
return(
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ color}) => {
let iconName;
if (route.name === 'Home') {
iconName ='home';
} else if (route.name === 'Explore') {
iconName = 'explore';
}else if (route.name === 'Subscribe') {
iconName = 'subscriptions';
}
// You can return any component that you like here!
return <MaterialIcons name={iconName} size={32} color={color}/>;
},
})}
tabBarOptions={{
activeTintColor: 'red',
inactiveTintColor: 'gray',
}}
>
<Tab.Screen name="Home" component={HomeScreen} />
<Tab.Screen name="Explore" component={Explore} />
<Tab.Screen name="Subscribe" component={Subscribe} />
</Tab.Navigator>
)
}
function App() {
return (
<Provider store={store}>
<NavigationContainer>
<Stack.Navigator headerMode="none">
<Stack.Screen name="RootHome" component={RootHome} />
<Stack.Screen name="Search" component={SearchScreen} />
<Stack.Screen name="VideoPlayer" component={VideoPlayer} />
</Stack.Navigator>
</NavigationContainer>
</Provider>
);
}
export default App;
const styles = StyleSheet.create({
container: {
flex: 1,
// marginTop:constant.statusBarHeight,
},
});