-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
67 lines (61 loc) · 2.08 KB
/
App.js
File metadata and controls
67 lines (61 loc) · 2.08 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
import { StatusBar } from 'expo-status-bar';
import { Text, View } from 'react-native';
import Login from './screens/Login';
import Registration from './screens/Registration';
import HomePage from './screens/HomePage';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import EditProfile from './screens/EditProfile';
import { Ionicons } from '@expo/vector-icons';
import Task from './screens/Task';
const Stack = createNativeStackNavigator();
const Tab = createBottomTabNavigator();
function getTabBarIcon(iconName) {
return ({ focused, color, size }) => (
<Ionicons
name={iconName}
size={size}
color={focused ? color : 'gray'}
/>
);
}
function Home() {
return (
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === 'Planer') {
iconName = focused ? 'home' : 'home-outline';
} else if (route.name === 'Profil') {
iconName = focused ? 'person' : 'person-outline';
}
return getTabBarIcon(iconName)({ focused, color, size });
},
headerShown: false,
tabBarActiveTintColor: 'black',
tabBarInactiveTintColor: 'gray',
tabBarLabelStyle: {
fontSize: 13
}
})}
>
<Tab.Screen name="Planer" component={HomePage} />
<Tab.Screen name="Profil" component={EditProfile} />
</Tab.Navigator>
);
}
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Registration" component={Registration} />
<Stack.Screen name="HomePage" component={Home} />
<Stack.Screen name="EditProfile" component={EditProfile} />
<Stack.Screen name="Task" component={Task} />
</Stack.Navigator>
</NavigationContainer>
);
}