1
1
import React from 'react' ;
2
+ import { StyleSheet , View } from 'react-native' ;
2
3
import { createStackNavigator } from '@react-navigation/stack' ;
3
4
import { createDrawerNavigator } from '@react-navigation/drawer' ;
4
- import { createMaterialBottomTabNavigator } from '@react-navigation/material- bottom-tabs' ;
5
+ import { createBottomTabNavigator } from '@react-navigation/bottom-tabs' ;
5
6
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons' ;
6
7
import MaterialIcons from 'react-native-vector-icons/MaterialIcons' ;
7
8
import Ionicons from 'react-native-vector-icons/Ionicons' ;
@@ -23,10 +24,11 @@ import AvailableSellers from '../screens/buyer/AvailableSellers';
23
24
import SellerProfileForBuyer from '../screens/buyer/SellerProfile' ;
24
25
import RequestDetails from '../screens/buyer/RequestDetails' ;
25
26
import BidsOnBuyerRequest from '../screens/buyer/BidsOnBuyerRequests' ;
27
+ import { TouchableOpacity } from 'react-native' ;
26
28
27
29
const Stack = createStackNavigator ( ) ;
28
30
const Drawer = createDrawerNavigator ( ) ;
29
- const Tab = createMaterialBottomTabNavigator ( ) ;
31
+ const Tab = createBottomTabNavigator ( ) ;
30
32
31
33
const BuyerStack = ( myProps ) => {
32
34
return (
@@ -37,58 +39,124 @@ const BuyerStack = (myProps) => {
37
39
) ;
38
40
} ;
39
41
42
+ const CustomTabBarButtom = ( { children, onPress, focused} ) => (
43
+ < TouchableOpacity
44
+ style = { {
45
+ top : - 20 ,
46
+ justifyContent : 'center' ,
47
+ alignItems : 'center' ,
48
+ ...styles . shadow ,
49
+ } }
50
+ onPress = { onPress } >
51
+ < View
52
+ style = { {
53
+ width : 60 ,
54
+ height : 60 ,
55
+ borderRadius : 35 ,
56
+ backgroundColor : '#b33aa3' ,
57
+ } } >
58
+ { children }
59
+ </ View >
60
+ </ TouchableOpacity >
61
+ ) ;
62
+
40
63
const MainBottomTabStack = ( ) => {
41
64
return (
42
65
< Tab . Navigator
43
- initialRouteName = "Home"
44
- activeColor = "#291F28"
45
- inactiveColor = "#D8BFD6"
46
- style = { { backgroundColor : 'tomato' } } >
66
+ // initialRouteName="Home"
67
+ // activeColor="#291F28"
68
+ // inactiveColor="#D8BFD6"
69
+ tabBarOptions = { {
70
+ showLabel : false ,
71
+
72
+ style : {
73
+ position : 'absolute' ,
74
+ elevation : 0 ,
75
+ border : 4 ,
76
+ height : 55 ,
77
+ // backgroundColor: '#FFFFFF',
78
+
79
+ // borderColor: '#000000',
80
+ borderRadius : 25 ,
81
+ // backgroundColor: 'red',
82
+ ...styles . shadow ,
83
+ } ,
84
+ } } >
47
85
< Tab . Screen
48
86
name = "Home"
49
87
component = { HomeStackScreen }
50
88
options = { {
51
- tabBarLabel : 'Home' ,
89
+ // tabBarLabel: 'Home',
52
90
// tabBarColor: '#FF9900',
53
- tabBarColor : '#FFFFFF' ,
54
- tabBarIcon : ( { color} ) => (
55
- < MaterialCommunityIcons name = "home" color = { color } size = { 26 } />
91
+ // tabBarColor: '#FFFFFF',
92
+ // tabBarOptions: {showLabel: false},
93
+ tabBarIcon : ( { color, focused} ) => (
94
+ < MaterialCommunityIcons
95
+ name = "home"
96
+ color = { focused ? '#000000' : '#D8BFD6' }
97
+ size = { 26 }
98
+ />
56
99
) ,
57
100
} }
58
101
/>
59
102
< Tab . Screen
60
103
name = "ChatStackScreen"
61
104
component = { ChatStackScreen }
62
105
options = { {
63
- tabBarLabel : 'Chats' ,
106
+ // tabBarLabel: 'Chats',
64
107
// tabBarColor: '#CC0000',
65
- tabBarColor : '#FFFFFF' ,
66
- tabBarIcon : ( { color} ) => (
67
- < Ionicons name = "chatbox-ellipses-outline" color = { color } size = { 26 } />
108
+ // tabBarColor: '#FFFFFF',
109
+ tabBarIcon : ( { color, focused} ) => (
110
+ < Ionicons
111
+ name = "chatbox-ellipses"
112
+ color = { focused ? '#000000' : '#D8BFD6' }
113
+ size = { 26 }
114
+ />
115
+ ) ,
116
+ } }
117
+ />
118
+ < Tab . Screen
119
+ name = "PostRequestStack"
120
+ component = { PostRequestStack }
121
+ options = { {
122
+ // tabBarLabel: 'Updates',
123
+ // tabBarColor: '#FF6699',
124
+ // tabBarColor: '#FFFFFF',
125
+ tabBarIcon : ( { color, focused} ) => (
126
+ < MaterialCommunityIcons name = "plus" color = { '#D8BFD6' } size = { 26 } />
68
127
) ,
128
+ tabBarButton : ( props ) => < CustomTabBarButtom { ...props } /> ,
69
129
} }
70
130
/>
71
131
< Tab . Screen
72
132
name = "YourRequestsStackScreen"
73
133
component = { YourRequestsStackScreen }
74
134
options = { {
75
- tabBarLabel : 'Requests' ,
135
+ // tabBarLabel: 'Requests',
76
136
// tabBarColor: '#FF6699',
77
- tabBarColor : '#FFFFFF' ,
78
- tabBarIcon : ( { color} ) => (
79
- < FontAwesome5 name = "file-alt" color = { color } size = { 26 } />
137
+ // tabBarColor: '#FFFFFF',
138
+ tabBarIcon : ( { color, focused} ) => (
139
+ < MaterialCommunityIcons
140
+ name = "clipboard-list"
141
+ color = { focused ? '#000000' : '#D8BFD6' }
142
+ size = { 26 }
143
+ />
80
144
) ,
81
145
} }
82
146
/>
83
147
< Tab . Screen
84
148
name = "ProfileStackScreen"
85
149
component = { ProfileStackScreen }
86
150
options = { {
87
- tabBarLabel : 'Profile' ,
151
+ // tabBarLabel: 'Profile',
88
152
// tabBarColor: '#CC33FF',
89
- tabBarColor : '#FFFFFF' ,
90
- tabBarIcon : ( { color} ) => (
91
- < MaterialCommunityIcons name = "account" color = { color } size = { 26 } />
153
+ // tabBarColor: '#FFFFFF',
154
+ tabBarIcon : ( { color, focused} ) => (
155
+ < MaterialCommunityIcons
156
+ name = "account"
157
+ color = { focused ? '#000000' : '#D8BFD6' }
158
+ size = { 26 }
159
+ />
92
160
) ,
93
161
} }
94
162
/>
@@ -124,7 +192,17 @@ const ChatStackScreen = () => {
124
192
</ Stack . Navigator >
125
193
) ;
126
194
} ;
127
-
195
+ const PostRequestStack = ( ) => {
196
+ return (
197
+ < Stack . Navigator
198
+ screenOptions = { {
199
+ headerShown : false ,
200
+ } } >
201
+ < Stack . Screen name = "BuyerRequests" component = { BuyerRequests } />
202
+ { /* <Stack.Screen name="Explorer" component={Explorer} /> */ }
203
+ </ Stack . Navigator >
204
+ ) ;
205
+ } ;
128
206
const YourRequestsStackScreen = ( ) => {
129
207
return (
130
208
< Stack . Navigator
@@ -149,5 +227,17 @@ const ProfileStackScreen = () => {
149
227
</ Stack . Navigator >
150
228
) ;
151
229
} ;
230
+ const styles = StyleSheet . create ( {
231
+ shadow : {
232
+ shadowColor : '#7F5Df0' ,
233
+ shadowOffset : {
234
+ width : 0 ,
235
+ height : 10 ,
236
+ } ,
237
+ shadowOpacity : 0.25 ,
238
+ shadowRadius : 3.5 ,
239
+ elevation : 5 ,
240
+ } ,
241
+ } ) ;
152
242
153
243
export default BuyerStack ;
0 commit comments