-
Notifications
You must be signed in to change notification settings - Fork 5
/
App.js
80 lines (73 loc) · 2.6 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
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 React, { Component } from "react";
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { Text } from "react-native";
import Icon from "react-native-vector-icons/Entypo";
import home from "./Screens/Home";
import distance from "./Screens/Distance";
import stateDist from "./Screens/Map";
import precautions from "./Screens/Precautions";
import analysis from "./Screens/Analysis";
import {
widthPercentageToDP as wp,
heightPercentageToDP as hp
} from "react-native-responsive-screen";
const Tab = createBottomTabNavigator();
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
logo: true,
flag: false
};
}
render() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === 'Home') {
iconName = "home";
} else if (route.name === 'StateWise') {
iconName = "news";
} else if (route.name === 'Distance') {
iconName = "location"
} else if (route.name === "Precautions") {
iconName = "thumbs-up"
} else if (route.name === "Analysis") {
iconName = "line-graph"
}
return (<Icon name={iconName} size={23} color={color} />);
},
tabBarLabel: ({ focused }) => {
return focused ? (<Text style={{ fontWeight: "500", fontFamily: "Oxanium", color: "#fff", fontSize: wp("3%"), marginBottom: hp("1%") }}>{route.name}</Text>) : null;
},
})}
tabBarOptions={{
activeTintColor: '#fff',
showLabel: true,
labelPosition: "below-icon",
keyboardHidesTabBar: false,
style: {
backgroundColor: "#1c1c1c",
borderTopLeftRadius: wp("7%"),
borderTopRightRadius: wp("7%"),
overflow: "hidden",
height: hp("7%"),
padding: hp("1%"),
elevation: 10
}
}}
>
<Tab.Screen name="Home" component={home} />
<Tab.Screen name="StateWise" component={stateDist} />
<Tab.Screen name="Distance" component={distance} />
<Tab.Screen name="Analysis" component={analysis} />
<Tab.Screen name="Precautions" component={precautions} />
</Tab.Navigator>
</NavigationContainer>
);
}
}