forked from Iteam1337/skaff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuyerNavigation.tsx
179 lines (174 loc) · 4.92 KB
/
BuyerNavigation.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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
import React from 'react'
import TenderRequests from './components/TenderRequests'
import TenderRequest from './components/TenderRequest'
import { createStackNavigator } from '@react-navigation/stack'
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs'
import Deal from './components/Deal'
import Deals from './components/Deals'
import ExploreNavigation from './ExploreNavigation'
import { IconButton, useTheme } from 'react-native-paper'
import BuyerProfile from './components/BuyerProfile'
import BottomNavigationIcon from './components/BottomNavigationIcon'
import CreateTenderRequest from './components/CreateTenderRequest'
import Notifications from './components/Notifications'
import { useNavigation } from '@react-navigation/native'
const Stack = createStackNavigator()
const TenderRequestsNavigation = () => {
const navigation = useNavigation()
return (
<>
<Stack.Navigator>
<Stack.Screen
name="ListTenderRequests"
options={{
title: 'Förfrågningar',
}}
component={TenderRequests}
/>
<Stack.Screen
name="TenderRequest"
options={{
title: 'Förfrågan',
}}
component={TenderRequest}
/>
<Stack.Screen
name="CreateTenderRequest"
options={{
title: 'Anbudsförfrågan',
}}
component={CreateTenderRequest}
/>
</Stack.Navigator>
</>
)
}
const DealsNavigation = () => {
return (
<>
<Stack.Navigator>
<Stack.Group>
<Stack.Screen
name="ListDeals"
options={({ navigation }) => ({
headerRight: () => (
<IconButton
icon="bell"
size={18}
onPress={() => navigation.navigate('Notifications')}
/>
),
title: 'Erbjudanden',
})}
component={Deals}
/>
<Stack.Screen
name="Deal"
options={{
title: 'Erbjudande',
}}
component={Deal}
/>
</Stack.Group>
<Stack.Group screenOptions={{ presentation: 'modal' }}>
<Stack.Screen name="Notifications" component={Notifications} />
</Stack.Group>
</Stack.Navigator>
</>
)
}
const BuyerProfileNavigation = () => {
const Stack = createStackNavigator()
return (
<>
<Stack.Navigator>
<Stack.Screen
name="BuyerProfile"
options={({ navigation }) => ({
title: 'Kvarnbergsskolan',
headerRight: () => (
<IconButton
icon="bell"
size={18}
onPress={() => navigation.navigate('Notifications')}
/>
),
})}
component={BuyerProfile}
/>
<Stack.Screen name="Notifications" component={Notifications} />
</Stack.Navigator>
</>
)
}
const BuyerNavigation = () => {
const Tab = createMaterialBottomTabNavigator()
const theme = useTheme()
return (
<Tab.Navigator
activeColor={theme.colors.primary}
inactiveColor={theme.colors.iconInactive}
barStyle={{ backgroundColor: theme.colors.background }}
theme={theme}
initialRouteName="Deals"
>
<Tab.Screen
name="Deals"
component={DealsNavigation}
options={{
tabBarLabel: 'Erbjudanden',
tabBarAccessibilityLabel: 'Erbjudanden',
tabBarIcon: ({ focused }) => (
<BottomNavigationIcon
name="corn"
focused={focused}
></BottomNavigationIcon>
),
}}
/>
<Tab.Screen
name="TenderRequests"
component={TenderRequestsNavigation}
options={{
tabBarLabel: 'Förfrågningar',
tabBarAccessibilityLabel: 'Förfrågningar',
tabBarIcon: ({ focused }) => (
<BottomNavigationIcon
name="cart"
focused={focused}
></BottomNavigationIcon>
),
}}
/>
<Tab.Screen
name="Explore"
component={ExploreNavigation}
options={{
tabBarLabel: 'Upptäck',
tabBarAccessibilityLabel: 'Upptäck',
tabBarIcon: ({ focused }) => (
<BottomNavigationIcon
name="compass"
focused={focused}
></BottomNavigationIcon>
),
}}
/>
<Tab.Screen
name="Profile"
component={BuyerProfileNavigation}
options={{
tabBarLabel: 'Mina sidor',
tabBarAccessibilityLabel: 'Mina sidor',
tabBarIcon: ({ focused }) => (
<BottomNavigationIcon
name="account"
focused={focused}
></BottomNavigationIcon>
),
}}
/>
</Tab.Navigator>
)
}
export default BuyerNavigation