-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
133 lines (124 loc) · 4.26 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import FirstScreen from './src/Screens/FirstScreen/FirstScreen';
import {StyleSheet, Text, View, Image} from 'react-native';
import StorageBook from './src/Screens/FavoriteBook/StorageBook';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
import AntDesign from 'react-native-vector-icons/AntDesign';
import Icon from 'react-native-vector-icons/Ionicons';
import Ionicons from 'react-native-vector-icons/Ionicons';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import Fontisto from 'react-native-vector-icons/Fontisto';
const Tab = createBottomTabNavigator();
const Stack = createNativeStackNavigator();
const App = () => {
return (
<NavigationContainer>
<Tab.Navigator
// screenOptions={({route}) => ({
// tabBarIcon: ({focused, color, size}) => {
// let iconName;
// if (route.name === 'FirstScreen') {
// iconName = focused ? 'home' : 'home-outline';
// } else if (route.name === 'StorageBook') {
// iconName = focused ? 'heart' : 'heart-outline';
// }
// // You can return any component that you like here!
// return <Ionicons name={iconName} size={size} color={color} />;
// },
// })}
// tabBarOptions={{
// activeTintColor: 'red',
// inactiveTintColor: 'black',
// }}
// initialRouteName="Home">
>
<Tab.Screen
name="Home"
component={FirstScreen}
options={{
tabBarIcon: ({focused}) => {
const image = focused
? require('./src/assets/homeBlue.png')
: require('./src/assets/home.png');
return focused ? (
<View
style={{
borderTopColor: 'white',
borderTopWidth: 0,
// borderBottomRadius: 4,
}}>
<Image
source={image}
style={{marginVertical: 8, height: 21, width: 24}}
/>
</View>
) : (
<View style={{borderTopWidth: 0}}>
<Image
source={image}
style={{marginVertical: 8, height: 21, width: 23}}
/>
</View>
);
},
}}
/>
<Tab.Screen
name="Favorite"
component={StorageBook}
options={{
tabBarIcon: ({focused}) => {
const image = focused
? require('./src/assets/heartBlue.png')
: require('./src/assets/heart.png');
return focused ? (
<View
style={{
borderTopColor: 'white',
borderTopWidth: 0,
// borderBottomRadius: 4,
}}>
<Image
source={image}
style={{marginVertical: 8, height: 21, width: 24}}
/>
</View>
) : (
<View style={{borderTopWidth: 0}}>
<Image
source={image}
style={{marginVertical: 8, height: 21, width: 23}}
/>
</View>
);
},
}}
// options={{
// tabBarLabel: 'Favorite',
// tabBarIcon: ({color, size}) => (
// <Icon name="heart" color={color} size={size} />
// ),
// }}
/>
</Tab.Navigator>
{/* <Stack.Navigator initialRouteName="FirstScreen">
<Stack.Screen
name="FirstScreen"
component={FirstScreen}
options={{headerShown: true}}
/>
<Stack.Screen
name="StorageBook"
component={StorageBook}
options={{headerShown: true}}
/>
</Stack.Navigator> */}
</NavigationContainer>
);
};
// const styles = StyleSheet.create({
// });
export default App;