-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
53 lines (47 loc) · 1.46 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
import * as React from "react";
import { Text, View } from "react-native";
import HomeScreen from "./app/screens/HomeScreen";
import Safety from "./app/screens/safety";
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import Ionicons from "react-native-vector-icons/Ionicons";
function Screen() {
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Text>Settings!</Text>
</View>
);
}
const Tab = createBottomTabNavigator();
function MyTabs() {
return (
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === "Bezpieczeństwo") {
iconName = focused ? "ios-medkit" : "ios-medkit";
} else if (route.name === "Polska") {
iconName = focused ? "ios-home" : "ios-home";
}
// You can return any component that you like here!
return <Ionicons name={iconName} size={size} color={color} />;
},
})}
tabBarOptions={{
activeTintColor: "#fe484a",
inactiveTintColor: "gray",
}}
>
<Tab.Screen name="Polska" component={HomeScreen} />
<Tab.Screen name="Bezpieczeństwo" component={Safety} />
</Tab.Navigator>
);
}
export default function App() {
return (
<NavigationContainer>
<MyTabs />
</NavigationContainer>
);
}