-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
87 lines (78 loc) · 2.24 KB
/
App.tsx
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
// Modules
import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
// Screens
import HomeRoute from "./routes/HomeRoute";
import ListRecordedTimesRoutes from "./routes/ListRecordedTimesRoutes";
// Contexts
import { DataProvider } from "./contexts/DataContext";
// Styles
import colors from "./styles/colors";
// Icons
import { Ionicons } from '@expo/vector-icons';
import { MaterialIcons } from '@expo/vector-icons';
export type InitialRouteBottomTab = {
home: undefined;
listRecordedTimes: undefined;
}
const BottomTab = createBottomTabNavigator<InitialRouteBottomTab>();
export default function App() {
return (
<NavigationContainer>
<DataProvider>
<BottomTab.Navigator
screenOptions={{
headerShown: false,
tabBarStyle: {
backgroundColor: colors.primary_level_2,
position: "absolute",
bottom: 24,
left: 24,
right: 24,
borderRadius: 8,
borderTopWidth: 0,
},
tabBarShowLabel: false
}}
>
<BottomTab.Screen
name="home"
component={HomeRoute}
options={{
tabBarIcon: ({ focused }) => (
<Ionicons
name="md-home"
size={32}
color={focused
?
colors.primary_level_3
:
colors.primary_level_1
}
/>
),
}}
/>
<BottomTab.Screen
name="listRecordedTimes"
component={ListRecordedTimesRoutes}
options={{
tabBarIcon: ({ focused }) => (
<MaterialIcons
name="view-list"
size={32}
color={focused
?
colors.primary_level_3
:
colors.primary_level_1
}
/>
),
}}
/>
</BottomTab.Navigator>
</DataProvider>
</NavigationContainer>
);
}