-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.jsx
111 lines (94 loc) · 3.84 KB
/
App.jsx
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import * as React from 'react';
import { Dimensions } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import Ionicons from 'react-native-vector-icons/Ionicons';
import HomeScreen from './screens/home';
import UploadScreen from './screens/upload';
import SecurityScreen from './screens/security';
import newUploadScreen from './screens/newUpload';
import PointsScreen from './screens/points';
import InfosScreen from './screens/infos';
import { RootSiblingParent } from 'react-native-root-siblings';
const HomeStack = createStackNavigator();
function HomeStackScreen() {
return (
<HomeStack.Navigator>
<HomeStack.Screen name="Planning" component={HomeScreen} options={{headerShown :false}}/>
</HomeStack.Navigator>
);
}
const UploadStack = createStackNavigator();
function UploadStackScreen() {
return (
<UploadStack.Navigator options={{headerShown :false}}>
<UploadStack.Screen name="Upload" component={UploadScreen} options={{headerShown :false}}/>
<UploadStack.Screen name="Envoi de défi" component={newUploadScreen} options={{headerShown :false}}/>
</UploadStack.Navigator>
);
}
const VerifStack = createStackNavigator();
function VerifStackScreen() {
return (
<VerifStack.Navigator options={{headerShown :false}}>
<VerifStack.Screen name="Verif" component={SecurityScreen} options={{headerShown :false}}/>
</VerifStack.Navigator>
);
}
const InfosStack = createStackNavigator();
function InfosStackScreen(){
return(
<InfosStack.Navigator options={{headerShown: false}}>
<InfosStack.Screen name="Infos" component={InfosScreen} options={{headerShown: false}}/>
</InfosStack.Navigator>
);
}
const tabBarIconGap = Dimensions.get('window').height > 810 ? 0 : -7;
const tabBarHeight = Dimensions.get('window').height > 810 ? 80 : 60;
const Tab = createBottomTabNavigator();
export default function App() {
return (
<RootSiblingParent>
<NavigationContainer>
<Tab.Navigator
initialRouteName='Points'
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === 'Planning') {
iconName = focused ? 'ios-calendar' : 'ios-calendar-outline';
} else if (route.name === 'Upload') {
iconName = focused ? 'cloud-upload' : 'cloud-upload-outline';
} else if (route.name === "Verif") {
iconName = focused ? "checkmark-circle" : "checkmark-circle-outline";
} else if (route.name === "Points"){
iconName = focused ? "podium": "podium-outline";
} else if (route.name === 'Infos'){
iconName = focused ? "information-circle": "information-circle-outline";
}
return <Ionicons name={iconName} size={size} color={color} style={{backgroundColor: "#2C2C2C"}}/>;
}
})}
tabBarOptions={{
activeTintColor: '#EA8BDE',
inactiveTintColor: 'white',
style: {
height: tabBarHeight,
backgroundColor:"#2C2C2C"
},
labelStyle:{
transform: [{translateY: tabBarIconGap}]
},
}}
>
<Tab.Screen name="Infos" component={InfosStackScreen} />
<Tab.Screen name="Planning" component={HomeStackScreen} />
<Tab.Screen name="Points" component={PointsScreen}/>
<Tab.Screen name="Upload" component={UploadStackScreen} />
<Tab.Screen name="Verif" component={VerifStackScreen} />
</Tab.Navigator>
</NavigationContainer>
</RootSiblingParent>
);
}