-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
52 lines (49 loc) · 2.02 KB
/
App.js
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
/* eslint-disable prettier/prettier */
import 'react-native-gesture-handler';
import * as React from 'react';
import {Dimensions,StatusBar} from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import HomeScreen from './src/screens/HomeScreen';
import SettingsScreen from './src/screens/SettingsScreen';
import BookmarkScreen from './src/screens/BookmarkScreen';
import Icon from 'react-native-vector-icons/Ionicons';
import {Provider} from './src/context/Context';
let WIDTH_RATIO = Dimensions.get('window').width / 392.72727272727275;
const Tab = createBottomTabNavigator();
const App = ()=>{
return <NavigationContainer>
<StatusBar backgroundColor= "#000000" barStyle="light-content" />
<Tab.Navigator
initialRouteName = "Home"
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color }) => {
let iconName;
if (route.name === 'Home') {
iconName = 'md-home';
} else if (route.name === 'Settings') {
iconName = 'md-settings';
}
else if (route.name === 'Bookmark')
{
iconName = 'md-bookmark';
}
return <Icon name={iconName} size={!focused ? 30 * WIDTH_RATIO : 35 * WIDTH_RATIO} color={color} />;
},
})}
tabBarOptions={{
activeBackgroundColor : '#131313',
inactiveBackgroundColor :'#131313',
activeTintColor: '#02CC99',
inactiveTintColor: '#C4C4C4',
showLabel : false,
style : {height : '8%'},
}}
>
<Tab.Screen name = "Home" component ={HomeScreen}/>
<Tab.Screen name = "Bookmark" component ={BookmarkScreen}/>
<Tab.Screen name = "Settings" component ={SettingsScreen}/>
</Tab.Navigator>
</NavigationContainer>;
};
export default ()=>{return <Provider><App/></Provider>;};