-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
82 lines (78 loc) · 2.16 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
81
82
import React from "react";
import { Text, View } from "react-native";
import { Icon } from "native-base";
import { createAppContainer } from "react-navigation";
import { createBottomTabNavigator } from "react-navigation-tabs";
import { createStackNavigator } from "react-navigation-stack";
import HomeScreen from "./src/views/HomeScreen.js";
import DetailsScreen from "./src/views/DetailsScreen";
import ScanScreen from "./src/views/ScanScreenFlash";
import HistoryScreen from "./src/views/HistoryScreen";
import AddButton from "./src/components/AddButton";
const HomeStack = createStackNavigator({
FoodApp: { screen: HomeScreen },
Details: { screen: DetailsScreen }
});
const ScanStack = createStackNavigator({
Scan: { screen: ScanScreen }
});
const HistoryStack = createStackNavigator({
Historique: { screen: HistoryScreen }
});
const BaseNavigator = createBottomTabNavigator(
{
Home: {
screen: HomeStack,
navigationOptions: () => ({
tabBarIcon: ({ tintColor }) => (
<Icon
type="MaterialCommunityIcons"
name="home"
color={tintColor}
size={24}
style={{ color: tintColor }}
/>
)
})
},
Scan: {
screen: ScanStack,
navigationOptions: () => ({
tabBarIcon: ({ tintColor }) => (
<Icon
type="MaterialCommunityIcons"
name="barcode-scan"
color={tintColor}
size={24}
style={{ color: tintColor }}
/>
)
})
},
History: {
screen: HistoryStack,
navigationOptions: () => ({
tabBarIcon: ({ tintColor }) => (
<Icon
type="MaterialCommunityIcons"
name="history"
color={tintColor}
size={24}
style={{ color: tintColor }}
/>
)
})
}
},
{
tabBarOptions: {
showLabel: false, // hide labels
activeTintColor: "#FFFFFF", // active icon color
inactiveTintColor: "#BF8A49", // inactive icon color
style: {
backgroundColor: "#FCB65F" // TabBar background
}
}
}
);
export default createAppContainer(BaseNavigator);