-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTab.js
More file actions
42 lines (34 loc) · 1.85 KB
/
Tab.js
File metadata and controls
42 lines (34 loc) · 1.85 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
import React from 'react';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {Calendar, DiaryList, Chart, Settings} from '../screens/Tabscreens';
import {MaterialCommunityIcons} from '@expo/vector-icons';
import { StyleSheet, Text, View } from 'react-native';
const TabIcon = ({name, size, color}) => {
return <MaterialCommunityIcons name = {name} size = {size} color = {color} />;
};
const Tab = createBottomTabNavigator();
const TabNavigation = () => {
return (
<Tab.Navigator
screenOptions = {({route}) => ({tabBarStyle : {backgroundColor : '#F4E8D1'},})}>
<Tab.Screen name = "Calendar"
//static navigationOptions = {{tabBarIcon : props => TabIcon({...props, name : 'calendar'}), }}
component = {Calendar}
options = {{headerStyle : {backgroundColor : '#F4E8D1'}, fontWeight : "bold",
tabBarIcon : props => TabIcon({...props, name : 'calendar'}), }}/>
<Tab.Screen name = "DiaryList"
component = {DiaryList}
options = {{headerStyle : {backgroundColor : '#F4E8D1'},fontWeight : "bold",
tabBarIcon : props => TabIcon({...props, name : 'file-document-outline'}), }}/>
<Tab.Screen name = "Chart"
component = {Chart}
options = {{headerStyle : {backgroundColor : '#F4E8D1'},fontWeight : "bold",
tabBarIcon : props => TabIcon({...props, name : 'chart-bar'}), }}/>
<Tab.Screen name = "Settings"
component = {Settings}
options = {{headerStyle : {backgroundColor : '#F4E8D1'},fontWeight : "bold",
tabBarIcon : props => TabIcon({...props, name : 'account-cog'}), }}/>
</Tab.Navigator>
);
};
export default TabNavigation;