ordering-ui-react-native 0.15.20 → 0.15.22-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -3
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessTypeFilter/index.tsx +12 -2
- package/src/components/BusinessTypeFilter/styles.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +0 -1
- package/src/components/LanguageSelector/index.tsx +1 -0
- package/src/components/OrderDetails/index.tsx +26 -5
- package/src/components/PaymentOptions/index.tsx +9 -16
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/StripeElementsForm/index.tsx +27 -48
- package/src/components/UserProfileForm/index.tsx +63 -6
- package/src/components/UserProfileForm/styles.tsx +8 -0
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/config.json +0 -2
- package/src/navigators/HomeNavigator.tsx +6 -0
- package/src/pages/BusinessProductsList.tsx +1 -0
- package/src/pages/BusinessesListing.tsx +1 -1
- package/src/pages/Checkout.tsx +1 -1
- package/src/pages/Sessions.tsx +22 -0
- package/src/types/index.tsx +3 -9
- package/src/utils/index.tsx +68 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +56 -8
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +5 -0
- package/themes/business/src/components/Chat/index.tsx +38 -86
- package/themes/business/src/components/Home/index.tsx +128 -55
- package/themes/business/src/components/Home/styles.tsx +8 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +59 -98
- package/themes/business/src/components/OrderDetails/Business.tsx +2 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +22 -13
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +151 -89
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +91 -17
- package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
- package/themes/business/src/components/OrdersListManager/index.tsx +874 -0
- package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
- package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
- package/themes/business/src/components/OrdersOption/index.tsx +53 -49
- package/themes/business/src/components/PreviousOrders/index.tsx +75 -22
- package/themes/business/src/types/index.tsx +2 -1
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
- package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
- package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +48 -21
- package/themes/kiosk/src/components/Cart/index.tsx +98 -24
- package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
- package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
- package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
- package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
- package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +6 -5
- package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
- package/themes/kiosk/src/components/Intro/index.tsx +13 -13
- package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +136 -41
- package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
- package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
- package/themes/kiosk/src/components/ProductForm/index.tsx +174 -125
- package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
- package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
- package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +178 -1
- package/themes/original/src/components/AddressForm/index.tsx +15 -10
- package/themes/original/src/components/AddressList/index.tsx +56 -18
- package/themes/original/src/components/AppleLogin/index.tsx +117 -78
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +96 -45
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
- package/themes/original/src/components/BusinessController/index.tsx +52 -22
- package/themes/original/src/components/BusinessController/styles.tsx +22 -0
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +4 -0
- package/themes/original/src/components/BusinessMenuList/index.tsx +11 -4
- package/themes/original/src/components/BusinessPreorder/index.tsx +141 -121
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +7 -5
- package/themes/original/src/components/BusinessProductsList/index.tsx +127 -20
- package/themes/original/src/components/BusinessProductsList/styles.tsx +29 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +92 -37
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/themes/original/src/components/BusinessesListing/index.tsx +48 -57
- package/themes/original/src/components/Cart/index.tsx +18 -14
- package/themes/original/src/components/CartContent/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +42 -27
- package/themes/original/src/components/CouponControl/index.tsx +1 -0
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
- package/themes/original/src/components/GoogleMap/index.tsx +1 -0
- package/themes/original/src/components/Help/index.tsx +21 -4
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +97 -89
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LastOrders/index.tsx +12 -1
- package/themes/original/src/components/LoginForm/index.tsx +73 -2
- package/themes/original/src/components/LoginForm/styles.tsx +6 -1
- package/themes/original/src/components/MessageListing/index.tsx +10 -1
- package/themes/original/src/components/Messages/index.tsx +34 -25
- package/themes/original/src/components/Messages/styles.tsx +1 -3
- package/themes/original/src/components/MomentOption/index.tsx +10 -1
- package/themes/original/src/components/MomentOption/styles.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +83 -42
- package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +4 -4
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
- package/themes/original/src/components/OrdersOption/index.tsx +25 -33
- package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +10 -4
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +9 -19
- package/themes/original/src/components/PreviousOrders/index.tsx +19 -13
- package/themes/original/src/components/ProductForm/index.tsx +40 -33
- package/themes/original/src/components/ProductForm/styles.tsx +2 -2
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +5 -3
- package/themes/original/src/components/Promotions/index.tsx +250 -0
- package/themes/original/src/components/Promotions/styles.tsx +60 -0
- package/themes/original/src/components/ReviewOrder/index.tsx +10 -9
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/Sessions/index.tsx +160 -0
- package/themes/original/src/components/Sessions/styles.tsx +15 -0
- package/themes/original/src/components/SingleProductCard/index.tsx +47 -21
- package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
- package/themes/original/src/components/TaxInformation/index.tsx +10 -4
- package/themes/original/src/components/UpsellingProducts/index.tsx +87 -71
- package/themes/original/src/components/UserDetails/index.tsx +4 -95
- package/themes/original/src/components/UserFormDetails/index.tsx +32 -31
- package/themes/original/src/components/UserProfile/index.tsx +62 -14
- package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
- package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
- package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
- package/themes/original/src/components/Wallets/index.tsx +75 -8
- package/themes/original/src/components/Wallets/styles.tsx +21 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
- package/themes/original/src/components/shared/index.tsx +2 -0
- package/themes/original/src/config/constants.tsx +6 -6
- package/themes/original/src/types/index.tsx +70 -25
- package/themes/original/src/utils/index.tsx +12 -2
- package/themes/single-business/src/components/AddressList/index.tsx +1 -1
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +6 -6
- package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +0 -168
|
@@ -0,0 +1,874 @@
|
|
|
1
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
+
import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Platform } from 'react-native';
|
|
3
|
+
import { useLanguage, OrderListGroups, useConfig } from 'ordering-components/native';
|
|
4
|
+
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
5
|
+
import FontistoIcon from 'react-native-vector-icons/Fontisto'
|
|
6
|
+
import FeatherIcon from 'react-native-vector-icons/Feather';
|
|
7
|
+
import SelectDropdown from 'react-native-select-dropdown'
|
|
8
|
+
import { useTheme } from 'styled-components/native';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
FiltersTab,
|
|
12
|
+
TabsContainer,
|
|
13
|
+
Tag,
|
|
14
|
+
IconWrapper,
|
|
15
|
+
ModalContainer,
|
|
16
|
+
ModalTitle,
|
|
17
|
+
TabPressable,
|
|
18
|
+
OrderStatus,
|
|
19
|
+
SlaOption,
|
|
20
|
+
SearchModalContent,
|
|
21
|
+
SlaSettingModalContent,
|
|
22
|
+
DeliveryStatusWrapper,
|
|
23
|
+
VerticalLine,
|
|
24
|
+
LeftSide,
|
|
25
|
+
RightSide,
|
|
26
|
+
Sides
|
|
27
|
+
} from './styles';
|
|
28
|
+
|
|
29
|
+
import { OText, OButton, OModal, OIconButton, OInput, OIcon } from '../shared';
|
|
30
|
+
import { NotFoundSource } from '../NotFoundSource';
|
|
31
|
+
import { useOrderUtils, StatusBlock, Timer } from './utils'
|
|
32
|
+
import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
|
|
33
|
+
import { NewOrderNotification } from '../NewOrderNotification';
|
|
34
|
+
import { PreviousOrders } from '../PreviousOrders';
|
|
35
|
+
import { OrdersOptionParams } from '../../types';
|
|
36
|
+
import { OrdersOptionCity } from '../OrdersOptionCity';
|
|
37
|
+
import { OrdersOptionBusiness } from '../OrdersOptionBusiness';
|
|
38
|
+
import { OrdersOptionDelivery } from '../OrdersOptionDelivery';
|
|
39
|
+
import { OrdersOptionPaymethod } from '../OrdersOptionPaymethod';
|
|
40
|
+
import { OrdersOptionDriver } from '../OrdersOptionDriver';
|
|
41
|
+
import { OrdersOptionDate } from '../OrdersOptionDate';
|
|
42
|
+
import { OrderDetailsBusiness } from '../OrderDetails/Business';
|
|
43
|
+
|
|
44
|
+
const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
|
|
45
|
+
|
|
46
|
+
const OrdersListManagerUI = (props: OrdersOptionParams) => {
|
|
47
|
+
const {
|
|
48
|
+
setCurrentFilters,
|
|
49
|
+
tabs,
|
|
50
|
+
currentTabSelected,
|
|
51
|
+
setCurrentTabSelected,
|
|
52
|
+
ordersGroup,
|
|
53
|
+
setOrdersGroup,
|
|
54
|
+
orderStatus,
|
|
55
|
+
loadOrders,
|
|
56
|
+
loadMoreOrders,
|
|
57
|
+
onNavigationRedirect,
|
|
58
|
+
onFiltered,
|
|
59
|
+
handleClickOrder,
|
|
60
|
+
isBusinessApp,
|
|
61
|
+
handleClickLogisticOrder,
|
|
62
|
+
logisticOrders,
|
|
63
|
+
loadLogisticOrders,
|
|
64
|
+
isLogisticActivated
|
|
65
|
+
} = props;
|
|
66
|
+
|
|
67
|
+
const theme = useTheme();
|
|
68
|
+
const [, t] = useLanguage();
|
|
69
|
+
const [{
|
|
70
|
+
calculateDate,
|
|
71
|
+
preorderTypeList,
|
|
72
|
+
defaultOrderTypes,
|
|
73
|
+
deliveryStatus,
|
|
74
|
+
defaultSearchList
|
|
75
|
+
}] = useOrderUtils()
|
|
76
|
+
const [orientationState] = useDeviceOrientation();
|
|
77
|
+
const [openSearchModal, setOpenSearchModal] = useState(false)
|
|
78
|
+
const [openSLASettingModal, setOpenSLASettingModal] = useState(false)
|
|
79
|
+
const [slaSettingTime, setSlaSettingTime] = useState(6000)
|
|
80
|
+
const [configState] = useConfig()
|
|
81
|
+
const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
|
|
82
|
+
const [search, setSearch] = useState(defaultSearchList)
|
|
83
|
+
const [selectedTabStatus, setSelectedTabStatus] = useState<any>([])
|
|
84
|
+
|
|
85
|
+
const HEIGHT_SCREEN = orientationState?.dimensions?.height
|
|
86
|
+
const IS_PORTRAIT = orientationState.orientation === PORTRAIT
|
|
87
|
+
|
|
88
|
+
const styles = StyleSheet.create({
|
|
89
|
+
header: {
|
|
90
|
+
marginBottom: isBusinessApp ? 10 : 20,
|
|
91
|
+
flexDirection: 'row',
|
|
92
|
+
justifyContent: 'space-between',
|
|
93
|
+
alignItems: 'center'
|
|
94
|
+
},
|
|
95
|
+
title: {
|
|
96
|
+
fontFamily: 'Poppins',
|
|
97
|
+
fontStyle: 'normal',
|
|
98
|
+
fontWeight: '600',
|
|
99
|
+
fontSize: 26,
|
|
100
|
+
color: theme.colors.textGray,
|
|
101
|
+
},
|
|
102
|
+
icons: {
|
|
103
|
+
flexDirection: 'row',
|
|
104
|
+
},
|
|
105
|
+
tab: {
|
|
106
|
+
fontFamily: 'Poppins',
|
|
107
|
+
fontStyle: 'normal',
|
|
108
|
+
fontSize: 14,
|
|
109
|
+
paddingBottom: 10,
|
|
110
|
+
marginBottom: -1,
|
|
111
|
+
zIndex: 100,
|
|
112
|
+
borderColor: theme.colors.textGray,
|
|
113
|
+
textTransform: 'capitalize'
|
|
114
|
+
},
|
|
115
|
+
icon: {
|
|
116
|
+
paddingBottom: 10,
|
|
117
|
+
zIndex: 100,
|
|
118
|
+
marginBottom: 5,
|
|
119
|
+
},
|
|
120
|
+
tagsContainer: {
|
|
121
|
+
marginBottom: 20,
|
|
122
|
+
height: '100%'
|
|
123
|
+
},
|
|
124
|
+
tag: {
|
|
125
|
+
fontFamily: 'Poppins',
|
|
126
|
+
fontStyle: 'normal',
|
|
127
|
+
fontWeight: 'normal',
|
|
128
|
+
fontSize: 14,
|
|
129
|
+
},
|
|
130
|
+
pressable: {
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
},
|
|
133
|
+
loadButton: {
|
|
134
|
+
borderRadius: 7.6,
|
|
135
|
+
height: 44,
|
|
136
|
+
marginRight: 10,
|
|
137
|
+
marginBottom: 10,
|
|
138
|
+
marginTop: 5,
|
|
139
|
+
},
|
|
140
|
+
loadButtonText: {
|
|
141
|
+
color: theme.colors.inputTextColor,
|
|
142
|
+
fontFamily: 'Poppins',
|
|
143
|
+
fontStyle: 'normal',
|
|
144
|
+
fontWeight: 'normal',
|
|
145
|
+
fontSize: 18,
|
|
146
|
+
},
|
|
147
|
+
inputStyle: {
|
|
148
|
+
width: '100%',
|
|
149
|
+
borderWidth: 1,
|
|
150
|
+
borderColor: '#DEE2E6',
|
|
151
|
+
borderRadius: 7.6,
|
|
152
|
+
marginBottom: 24
|
|
153
|
+
},
|
|
154
|
+
SLAwrapper: {
|
|
155
|
+
flexDirection: 'row',
|
|
156
|
+
marginBottom: 15
|
|
157
|
+
},
|
|
158
|
+
selectOption: {
|
|
159
|
+
alignItems: 'center',
|
|
160
|
+
justifyContent: 'space-between',
|
|
161
|
+
minHeight: 40,
|
|
162
|
+
width: '100%',
|
|
163
|
+
paddingHorizontal: 15,
|
|
164
|
+
backgroundColor: theme.colors.inputChat,
|
|
165
|
+
borderRadius: 7.6,
|
|
166
|
+
},
|
|
167
|
+
buttonTextStyle: {
|
|
168
|
+
textAlign: 'left',
|
|
169
|
+
marginHorizontal: 0,
|
|
170
|
+
fontSize: 16,
|
|
171
|
+
lineHeight: 24,
|
|
172
|
+
color: '#748194'
|
|
173
|
+
},
|
|
174
|
+
dropdownStyle: {
|
|
175
|
+
borderWidth: 1,
|
|
176
|
+
borderRadius: 8,
|
|
177
|
+
paddingTop: 5,
|
|
178
|
+
backgroundColor: '#fff',
|
|
179
|
+
borderColor: theme.colors.lightGray,
|
|
180
|
+
overflow: 'hidden',
|
|
181
|
+
minHeight: 155
|
|
182
|
+
},
|
|
183
|
+
rowStyle: {
|
|
184
|
+
display: 'flex',
|
|
185
|
+
borderBottomWidth: 0,
|
|
186
|
+
height: 36,
|
|
187
|
+
alignItems: 'center',
|
|
188
|
+
paddingHorizontal: 10
|
|
189
|
+
},
|
|
190
|
+
acceptButtonStyle: {
|
|
191
|
+
borderRadius: 7.6,
|
|
192
|
+
width: 130,
|
|
193
|
+
height: 42,
|
|
194
|
+
},
|
|
195
|
+
errorMessage: {
|
|
196
|
+
marginBottom: 10,
|
|
197
|
+
color: theme.colors.error,
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const scrollRef = useRef() as React.MutableRefObject<ScrollView>;
|
|
202
|
+
const scrollListRef = useRef() as React.MutableRefObject<ScrollView>;
|
|
203
|
+
const scrollRefTab = useRef() as React.MutableRefObject<ScrollView>;
|
|
204
|
+
|
|
205
|
+
const [refreshing] = useState(false);
|
|
206
|
+
const [currentOrderSelected, setCurrentOrderSelected] = useState<any>(null)
|
|
207
|
+
|
|
208
|
+
const [tagsState, setTags] = useState<any>({ values: [] })
|
|
209
|
+
|
|
210
|
+
const tagsList = ordersGroup[currentTabSelected]?.defaultFilter ?? []
|
|
211
|
+
const currentOrdersGroup = ordersGroup[currentTabSelected]
|
|
212
|
+
|
|
213
|
+
const isEqual = (array1: any, array2: any) => {
|
|
214
|
+
return array1?.every((item: any) => array2.includes(item)) && array2?.every((item: any) => array1.includes(item))
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const getOrderStatus = (key: number) => {
|
|
218
|
+
return orderStatus.find((status: any) => status?.key === key)?.text;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const applyFilters = () => {
|
|
222
|
+
setOrdersGroup({
|
|
223
|
+
...ordersGroup,
|
|
224
|
+
[currentTabSelected]: {
|
|
225
|
+
...ordersGroup[currentTabSelected],
|
|
226
|
+
orders: []
|
|
227
|
+
}
|
|
228
|
+
})
|
|
229
|
+
const dateRange = calculateDate(search.date.type, search.date.from, search.date.to)
|
|
230
|
+
onFiltered && onFiltered({ ...search, date: { ...dateRange } })
|
|
231
|
+
setOpenSearchModal(false)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const handleTagSelected = (tag: any) => {
|
|
235
|
+
const tags = tagsState?.values.includes(tag)
|
|
236
|
+
? tagsState?.values.filter((t: any) => t !== tag)
|
|
237
|
+
: [...tagsState?.values, tag]
|
|
238
|
+
|
|
239
|
+
setCurrentFilters(!tags.length ? tagsList : tags)
|
|
240
|
+
setTags({ values: isEqual(tags, tagsList) ? [] : tags })
|
|
241
|
+
|
|
242
|
+
setOrdersGroup({
|
|
243
|
+
...ordersGroup,
|
|
244
|
+
[currentTabSelected]: {
|
|
245
|
+
...ordersGroup[currentTabSelected],
|
|
246
|
+
currentFilter: !tags.length ? tagsList : tags
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const handleAllSelect = () => {
|
|
252
|
+
setCurrentFilters(tagsList)
|
|
253
|
+
setTags({ values: [] })
|
|
254
|
+
setOrdersGroup({
|
|
255
|
+
...ordersGroup,
|
|
256
|
+
[currentTabSelected]: {
|
|
257
|
+
...ordersGroup[currentTabSelected],
|
|
258
|
+
currentFilter: tagsList
|
|
259
|
+
}
|
|
260
|
+
})
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const onClickSetting = () => {
|
|
264
|
+
setOpenSLASettingModal(true)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const handleClose = () => {
|
|
268
|
+
setOpenSearchModal(false)
|
|
269
|
+
setOpenSLASettingModal(false)
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
useEffect(() => {
|
|
273
|
+
setCurrentFilters(null)
|
|
274
|
+
onFiltered && onFiltered(null)
|
|
275
|
+
setSearch(defaultSearchList)
|
|
276
|
+
scrollRefTab.current?.scrollTo({ animated: true });
|
|
277
|
+
scrollListRef.current?.scrollTo({ animated: true });
|
|
278
|
+
scrollRef.current?.scrollTo({ y: 0, animated: true });
|
|
279
|
+
}, [currentTabSelected])
|
|
280
|
+
|
|
281
|
+
useEffect(() => {
|
|
282
|
+
setSelectedTabStatus(deliveryStatus)
|
|
283
|
+
}, [])
|
|
284
|
+
|
|
285
|
+
useEffect(() => {
|
|
286
|
+
if (currentOrdersGroup?.orders?.length > 0 && !tagsList.includes(currentOrderSelected?.status)) {
|
|
287
|
+
setCurrentOrderSelected(currentOrdersGroup?.orders[0])
|
|
288
|
+
}
|
|
289
|
+
}, [currentOrdersGroup?.orders, currentTabSelected])
|
|
290
|
+
|
|
291
|
+
return (
|
|
292
|
+
<>
|
|
293
|
+
<View style={styles.header}>
|
|
294
|
+
<OText style={styles.title}>{t('MY_ORDERS', 'My orders')}</OText>
|
|
295
|
+
<IconWrapper>
|
|
296
|
+
<FeatherIcon
|
|
297
|
+
name='refresh-cw'
|
|
298
|
+
color={theme.colors.backgroundDark}
|
|
299
|
+
size={24}
|
|
300
|
+
onPress={() => {
|
|
301
|
+
currentTabSelected === 'logisticOrders'
|
|
302
|
+
? loadLogisticOrders && loadLogisticOrders()
|
|
303
|
+
: loadOrders && loadOrders({ newFetch: true })
|
|
304
|
+
}}
|
|
305
|
+
style={{ marginRight: 20 }}
|
|
306
|
+
/>
|
|
307
|
+
<FontistoIcon
|
|
308
|
+
name='search'
|
|
309
|
+
color={theme.colors.backgroundDark}
|
|
310
|
+
size={24}
|
|
311
|
+
onPress={() => setOpenSearchModal(true)}
|
|
312
|
+
/>
|
|
313
|
+
</IconWrapper>
|
|
314
|
+
</View>
|
|
315
|
+
{configState?.configs?.order_deadlines_enabled?.value === '1' && (
|
|
316
|
+
<View style={styles.SLAwrapper}>
|
|
317
|
+
<View style={{ flex: 0.5 }}>
|
|
318
|
+
<OButton
|
|
319
|
+
text={t('SLA_SETTING', 'SLA’s Settings')}
|
|
320
|
+
textStyle={{ color: theme.colors.backArrow }}
|
|
321
|
+
imgRightSrc={null}
|
|
322
|
+
style={{
|
|
323
|
+
backgroundColor: theme.colors.inputChat,
|
|
324
|
+
borderRadius: 7.6,
|
|
325
|
+
zIndex: 10,
|
|
326
|
+
borderWidth: 0,
|
|
327
|
+
minHeight: 40
|
|
328
|
+
}}
|
|
329
|
+
onClick={onClickSetting}
|
|
330
|
+
/>
|
|
331
|
+
</View>
|
|
332
|
+
<View style={{ width: 10, height: '100%' }} />
|
|
333
|
+
<View style={{ flex: 0.5, justifyContent: 'center' }}>
|
|
334
|
+
<SelectDropdown
|
|
335
|
+
defaultButtonText={t('SLA', 'SLA\'s')}
|
|
336
|
+
data={preorderTypeList}
|
|
337
|
+
onSelect={(selectedItem, index) => {
|
|
338
|
+
onFiltered && onFiltered({ ...search, timeStatus: selectedItem?.key })
|
|
339
|
+
}}
|
|
340
|
+
buttonTextAfterSelection={(selectedItem, index) => {
|
|
341
|
+
return selectedItem.name
|
|
342
|
+
}}
|
|
343
|
+
rowTextForSelection={(item, index) => {
|
|
344
|
+
return item.key
|
|
345
|
+
}}
|
|
346
|
+
buttonStyle={styles.selectOption}
|
|
347
|
+
buttonTextStyle={styles.buttonTextStyle}
|
|
348
|
+
renderDropdownIcon={isOpened => {
|
|
349
|
+
return <FeatherIcon name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#444'} size={18} />;
|
|
350
|
+
}}
|
|
351
|
+
dropdownStyle={styles.dropdownStyle}
|
|
352
|
+
dropdownOverlayColor='transparent'
|
|
353
|
+
rowStyle={styles.rowStyle}
|
|
354
|
+
renderCustomizedRowChild={(item, index) => {
|
|
355
|
+
return (
|
|
356
|
+
<SlaOption>
|
|
357
|
+
{index !== 0 && <OrderStatus timeState={item?.key} />}
|
|
358
|
+
<View><OText size={14} color={'#748194'} >{item?.name}</OText></View>
|
|
359
|
+
</SlaOption>
|
|
360
|
+
);
|
|
361
|
+
}}
|
|
362
|
+
/>
|
|
363
|
+
</View>
|
|
364
|
+
</View>
|
|
365
|
+
)}
|
|
366
|
+
|
|
367
|
+
<Sides>
|
|
368
|
+
<LeftSide>
|
|
369
|
+
<FiltersTab>
|
|
370
|
+
<ScrollView
|
|
371
|
+
ref={scrollRefTab}
|
|
372
|
+
showsVerticalScrollIndicator={false}
|
|
373
|
+
showsHorizontalScrollIndicator={false}
|
|
374
|
+
horizontal
|
|
375
|
+
nestedScrollEnabled={true}
|
|
376
|
+
>
|
|
377
|
+
<TabsContainer>
|
|
378
|
+
{(isLogisticActivated && !isBusinessApp) && (
|
|
379
|
+
<Pressable
|
|
380
|
+
style={styles.pressable}
|
|
381
|
+
onPress={() => setCurrentTabSelected('logisticOrders')}>
|
|
382
|
+
<OIcon
|
|
383
|
+
src={theme.images?.general?.chronometer}
|
|
384
|
+
borderBottomWidth={currentTabSelected === 'logisticOrders' ? 1 : 0}
|
|
385
|
+
width={currentTabSelected === 'logisticOrders' ? 26 : 24}
|
|
386
|
+
height={currentTabSelected === 'logisticOrders' ? 26 : 24}
|
|
387
|
+
color={
|
|
388
|
+
currentTabSelected === 'logisticOrders'
|
|
389
|
+
? theme.colors.textGray
|
|
390
|
+
: theme.colors.unselectText
|
|
391
|
+
}
|
|
392
|
+
style={styles.icon}
|
|
393
|
+
/>
|
|
394
|
+
</Pressable>
|
|
395
|
+
)}
|
|
396
|
+
{tabs.map((tab: any) => (
|
|
397
|
+
<TabPressable
|
|
398
|
+
key={tab.key}
|
|
399
|
+
onPress={() => setCurrentTabSelected(tab?.title)}
|
|
400
|
+
isSelected={tab.title === currentTabSelected ? 1 : 0}
|
|
401
|
+
>
|
|
402
|
+
<OText
|
|
403
|
+
style={{
|
|
404
|
+
...styles.tab,
|
|
405
|
+
fontSize: tab.title === currentTabSelected ? 16 : 14,
|
|
406
|
+
borderBottomWidth: Platform.OS === 'ios' && tab.title === currentTabSelected ? 1 : 0,
|
|
407
|
+
}}
|
|
408
|
+
color={
|
|
409
|
+
tab.title === currentTabSelected
|
|
410
|
+
? theme.colors.textGra
|
|
411
|
+
: theme.colors.unselectText
|
|
412
|
+
}
|
|
413
|
+
weight={tab.title === currentTabSelected ? '600' : 'normal'}
|
|
414
|
+
>
|
|
415
|
+
{tab.text}
|
|
416
|
+
</OText>
|
|
417
|
+
</TabPressable>
|
|
418
|
+
))}
|
|
419
|
+
</TabsContainer>
|
|
420
|
+
</ScrollView>
|
|
421
|
+
</FiltersTab>
|
|
422
|
+
|
|
423
|
+
{currentTabSelected !== 'logisticOrders' && (
|
|
424
|
+
<View
|
|
425
|
+
style={{
|
|
426
|
+
display: 'flex',
|
|
427
|
+
flexDirection: 'row',
|
|
428
|
+
alignContent: 'center',
|
|
429
|
+
alignItems: 'center',
|
|
430
|
+
}}
|
|
431
|
+
>
|
|
432
|
+
{tagsList && tagsList?.length > 1 && (
|
|
433
|
+
<View style={{ marginBottom: 20 }}>
|
|
434
|
+
<Tag
|
|
435
|
+
onPress={() => handleAllSelect()}
|
|
436
|
+
isSelected={
|
|
437
|
+
isEqual(currentOrdersGroup.currentFilter, tagsList)
|
|
438
|
+
? theme.colors.primary
|
|
439
|
+
: theme.colors.tabBar
|
|
440
|
+
}>
|
|
441
|
+
<OText
|
|
442
|
+
style={styles.tag}
|
|
443
|
+
color={
|
|
444
|
+
isEqual(currentOrdersGroup.currentFilter, tagsList)
|
|
445
|
+
? theme.colors.white
|
|
446
|
+
: theme.colors.black
|
|
447
|
+
}>
|
|
448
|
+
{t('All', 'All')}
|
|
449
|
+
</OText>
|
|
450
|
+
</Tag>
|
|
451
|
+
</View>
|
|
452
|
+
)}
|
|
453
|
+
<ScrollView
|
|
454
|
+
ref={scrollRef}
|
|
455
|
+
showsVerticalScrollIndicator={false}
|
|
456
|
+
showsHorizontalScrollIndicator={false}
|
|
457
|
+
contentContainerStyle={styles.tagsContainer}
|
|
458
|
+
horizontal
|
|
459
|
+
>
|
|
460
|
+
{tagsList && tagsList.map((key: number) => (
|
|
461
|
+
<Tag
|
|
462
|
+
key={key}
|
|
463
|
+
onPress={() => !currentOrdersGroup.loading && handleTagSelected(key)}
|
|
464
|
+
isSelected={
|
|
465
|
+
currentOrdersGroup.currentFilter.includes(key) &&
|
|
466
|
+
!isEqual(currentOrdersGroup.currentFilter, tagsList)
|
|
467
|
+
? theme.colors.primary
|
|
468
|
+
: theme.colors.tabBar
|
|
469
|
+
}>
|
|
470
|
+
<OText
|
|
471
|
+
style={styles.tag}
|
|
472
|
+
color={
|
|
473
|
+
currentOrdersGroup.currentFilter.includes(key) &&
|
|
474
|
+
!isEqual(currentOrdersGroup.currentFilter, tagsList)
|
|
475
|
+
? theme.colors.white
|
|
476
|
+
: theme.colors.black
|
|
477
|
+
}>
|
|
478
|
+
{getOrderStatus(key)}
|
|
479
|
+
{
|
|
480
|
+
currentOrdersGroup.currentFilter.includes(key) &&
|
|
481
|
+
!isEqual(currentOrdersGroup.currentFilter, tagsList) &&
|
|
482
|
+
' X'
|
|
483
|
+
}
|
|
484
|
+
</OText>
|
|
485
|
+
</Tag>
|
|
486
|
+
))}
|
|
487
|
+
</ScrollView>
|
|
488
|
+
</View>
|
|
489
|
+
)}
|
|
490
|
+
|
|
491
|
+
<View style={{ paddingBottom: 220 }}>
|
|
492
|
+
<ScrollView
|
|
493
|
+
ref={scrollListRef}
|
|
494
|
+
showsVerticalScrollIndicator={false}
|
|
495
|
+
nestedScrollEnabled={true}
|
|
496
|
+
refreshControl={
|
|
497
|
+
<RefreshControl
|
|
498
|
+
refreshing={refreshing}
|
|
499
|
+
onRefresh={() => {
|
|
500
|
+
currentTabSelected === 'logisticOrders'
|
|
501
|
+
? loadLogisticOrders && loadLogisticOrders()
|
|
502
|
+
: loadOrders && loadOrders({ newFetch: true })
|
|
503
|
+
}}
|
|
504
|
+
/>
|
|
505
|
+
}
|
|
506
|
+
>
|
|
507
|
+
{!currentOrdersGroup?.error?.length &&
|
|
508
|
+
currentOrdersGroup?.orders?.length > 0 &&
|
|
509
|
+
currentTabSelected !== 'logisticOrders' &&
|
|
510
|
+
(
|
|
511
|
+
<PreviousOrders
|
|
512
|
+
orders={currentOrdersGroup?.orders}
|
|
513
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
514
|
+
getOrderStatus={getOrderStatus}
|
|
515
|
+
handleClickOrder={handleClickOrder}
|
|
516
|
+
slaSettingTime={slaSettingTime}
|
|
517
|
+
currentTabSelected={currentTabSelected}
|
|
518
|
+
handleClickEvent={setCurrentOrderSelected}
|
|
519
|
+
currentOrdenSelected={currentOrderSelected?.id}
|
|
520
|
+
/>
|
|
521
|
+
)}
|
|
522
|
+
{!logisticOrders?.error?.length &&
|
|
523
|
+
logisticOrders && logisticOrders?.orders?.length > 0 &&
|
|
524
|
+
currentTabSelected === 'logisticOrders' && (
|
|
525
|
+
<PreviousOrders
|
|
526
|
+
orders={logisticOrders?.orders?.filter((order: any) => !order?.expired).map((order: any) => ({ ...order, isLogistic: true }))}
|
|
527
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
528
|
+
getOrderStatus={getOrderStatus}
|
|
529
|
+
handleClickLogisticOrder={handleClickLogisticOrder}
|
|
530
|
+
isLogisticOrder
|
|
531
|
+
handleClickEvent={setCurrentOrderSelected}
|
|
532
|
+
currentOrdenSelected={currentOrderSelected?.id}
|
|
533
|
+
/>
|
|
534
|
+
)
|
|
535
|
+
}
|
|
536
|
+
{((currentOrdersGroup?.loading ||
|
|
537
|
+
currentOrdersGroup?.pagination?.total === null) ||
|
|
538
|
+
(logisticOrders?.loading)) &&
|
|
539
|
+
(
|
|
540
|
+
<>
|
|
541
|
+
<View>
|
|
542
|
+
{[...Array(8)].map((_, i) => (
|
|
543
|
+
<Placeholder key={i} Animation={Fade}>
|
|
544
|
+
<View
|
|
545
|
+
style={{
|
|
546
|
+
width: '100%',
|
|
547
|
+
flexDirection: 'row',
|
|
548
|
+
marginBottom: 10,
|
|
549
|
+
}}>
|
|
550
|
+
<PlaceholderLine
|
|
551
|
+
width={IS_PORTRAIT ? 22 : 11}
|
|
552
|
+
height={74}
|
|
553
|
+
style={{
|
|
554
|
+
marginRight: 20,
|
|
555
|
+
marginBottom: 20,
|
|
556
|
+
borderRadius: 7.6,
|
|
557
|
+
}}
|
|
558
|
+
/>
|
|
559
|
+
<Placeholder>
|
|
560
|
+
<PlaceholderLine width={30} style={{ marginTop: 5 }} />
|
|
561
|
+
<PlaceholderLine width={50} />
|
|
562
|
+
<PlaceholderLine width={20} />
|
|
563
|
+
</Placeholder>
|
|
564
|
+
</View>
|
|
565
|
+
</Placeholder>
|
|
566
|
+
))}
|
|
567
|
+
</View>
|
|
568
|
+
</>
|
|
569
|
+
)}
|
|
570
|
+
|
|
571
|
+
{!currentOrdersGroup?.error?.length &&
|
|
572
|
+
!currentOrdersGroup?.loading &&
|
|
573
|
+
currentOrdersGroup?.pagination?.totalPages &&
|
|
574
|
+
currentOrdersGroup?.pagination?.currentPage < currentOrdersGroup?.pagination?.totalPages &&
|
|
575
|
+
currentOrdersGroup?.orders?.length > 0 &&
|
|
576
|
+
(
|
|
577
|
+
<OButton
|
|
578
|
+
onClick={() => loadMoreOrders && loadMoreOrders()}
|
|
579
|
+
text={t('LOAD_MORE_ORDERS', 'Load more orders')}
|
|
580
|
+
imgRightSrc={null}
|
|
581
|
+
textStyle={styles.loadButtonText}
|
|
582
|
+
style={styles.loadButton}
|
|
583
|
+
bgColor={theme.colors.primary}
|
|
584
|
+
borderColor={theme.colors.primary}
|
|
585
|
+
/>
|
|
586
|
+
)}
|
|
587
|
+
|
|
588
|
+
{((!currentOrdersGroup?.loading &&
|
|
589
|
+
(currentOrdersGroup?.error?.length ||
|
|
590
|
+
currentOrdersGroup?.orders?.length === 0)) ||
|
|
591
|
+
(currentTabSelected === 'logisticOrders' &&
|
|
592
|
+
(logisticOrders && logisticOrders?.error?.length > 0 || logisticOrders?.orders?.length === 0 || !logisticOrders?.orders?.some(order => !order?.expired)))
|
|
593
|
+
) &&
|
|
594
|
+
(
|
|
595
|
+
<NotFoundSource
|
|
596
|
+
content={
|
|
597
|
+
((currentTabSelected !== 'logisticOrders' && !currentOrdersGroup?.error?.length) ||
|
|
598
|
+
(currentTabSelected === 'logisticOrders' && (!logisticOrders?.error?.length || (logisticOrders?.orders?.length > 0 && !logisticOrders?.orders?.some(order => !order?.expired)))))
|
|
599
|
+
? t('NO_RESULTS_FOUND', 'Sorry, no results found')
|
|
600
|
+
: currentOrdersGroup?.error?.[0]?.message ||
|
|
601
|
+
currentOrdersGroup?.error?.[0] ||
|
|
602
|
+
(currentTabSelected === 'logisticOrders' && logisticOrders?.error) ||
|
|
603
|
+
t('NETWORK_ERROR', 'Network Error')
|
|
604
|
+
}
|
|
605
|
+
image={theme.images.general.notFound}
|
|
606
|
+
conditioned={false}
|
|
607
|
+
/>
|
|
608
|
+
)}
|
|
609
|
+
</ScrollView>
|
|
610
|
+
</View>
|
|
611
|
+
</LeftSide>
|
|
612
|
+
|
|
613
|
+
<RightSide style={{ paddingBottom: 110, paddingHorizontal: 20 }}>
|
|
614
|
+
{currentOrderSelected && (
|
|
615
|
+
<OrderDetailsBusiness {...props.orderDetailsProps} order={currentOrderSelected} isCustomView />
|
|
616
|
+
)}
|
|
617
|
+
</RightSide>
|
|
618
|
+
</Sides>
|
|
619
|
+
|
|
620
|
+
<NewOrderNotification />
|
|
621
|
+
{(openSearchModal || openSLASettingModal) && (
|
|
622
|
+
<OModal open={openSearchModal || openSLASettingModal} entireModal customClose>
|
|
623
|
+
<ModalContainer
|
|
624
|
+
nestedScrollEnabled={true}
|
|
625
|
+
>
|
|
626
|
+
<OIconButton
|
|
627
|
+
icon={theme.images.general.arrow_left}
|
|
628
|
+
borderColor={theme.colors.clear}
|
|
629
|
+
iconColor={theme.colors.backArrow}
|
|
630
|
+
iconStyle={{ width: 20, height: 13 }}
|
|
631
|
+
style={{
|
|
632
|
+
maxWidth: 40,
|
|
633
|
+
height: 35,
|
|
634
|
+
justifyContent: 'flex-end',
|
|
635
|
+
marginBottom: 30,
|
|
636
|
+
marginTop: 30
|
|
637
|
+
}}
|
|
638
|
+
onClick={() => handleClose()}
|
|
639
|
+
/>
|
|
640
|
+
{openSearchModal && (
|
|
641
|
+
<SearchModalContent>
|
|
642
|
+
<ModalTitle>{t('SEARCH_ORDERS', 'Search orders')}</ModalTitle>
|
|
643
|
+
<OInput
|
|
644
|
+
value={search.id}
|
|
645
|
+
onChange={(value: any) => setSearch({ ...search, id: value })}
|
|
646
|
+
style={styles.inputStyle}
|
|
647
|
+
placeholder={t('ORDER_NUMBER', 'Order number')}
|
|
648
|
+
autoCorrect={false}
|
|
649
|
+
/>
|
|
650
|
+
<OrdersOptionDate
|
|
651
|
+
{...props}
|
|
652
|
+
search={search}
|
|
653
|
+
onSearch={setSearch}
|
|
654
|
+
/>
|
|
655
|
+
<OrdersOptionCity
|
|
656
|
+
{...props}
|
|
657
|
+
search={search}
|
|
658
|
+
onSearch={setSearch}
|
|
659
|
+
/>
|
|
660
|
+
{isBusinessApp && (
|
|
661
|
+
<>
|
|
662
|
+
<OrdersOptionBusiness
|
|
663
|
+
{...props}
|
|
664
|
+
search={search}
|
|
665
|
+
onSearch={setSearch}
|
|
666
|
+
/>
|
|
667
|
+
<OrdersOptionDelivery
|
|
668
|
+
{...props}
|
|
669
|
+
search={search}
|
|
670
|
+
onSearch={setSearch}
|
|
671
|
+
/>
|
|
672
|
+
<OrdersOptionDriver
|
|
673
|
+
{...props}
|
|
674
|
+
search={search}
|
|
675
|
+
onSearch={setSearch}
|
|
676
|
+
/>
|
|
677
|
+
<OrdersOptionPaymethod
|
|
678
|
+
{...props}
|
|
679
|
+
search={search}
|
|
680
|
+
onSearch={setSearch}
|
|
681
|
+
/>
|
|
682
|
+
</>
|
|
683
|
+
)}
|
|
684
|
+
<OButton
|
|
685
|
+
text={t('SEARCH', 'Search')}
|
|
686
|
+
textStyle={{ color: theme.colors.white }}
|
|
687
|
+
imgRightSrc={null}
|
|
688
|
+
style={{
|
|
689
|
+
borderRadius: 7.6,
|
|
690
|
+
marginBottom: 70,
|
|
691
|
+
marginTop: 60,
|
|
692
|
+
zIndex: 12
|
|
693
|
+
}}
|
|
694
|
+
onClick={applyFilters}
|
|
695
|
+
/>
|
|
696
|
+
|
|
697
|
+
</SearchModalContent>
|
|
698
|
+
)}
|
|
699
|
+
{openSLASettingModal && (
|
|
700
|
+
<SlaSettingModalContent>
|
|
701
|
+
<ModalTitle>{t('SLA_SETTINGS', 'SLA’s Settings')}</ModalTitle>
|
|
702
|
+
<FiltersTab>
|
|
703
|
+
<ScrollView
|
|
704
|
+
ref={scrollRefTab}
|
|
705
|
+
showsVerticalScrollIndicator={false}
|
|
706
|
+
showsHorizontalScrollIndicator={false}
|
|
707
|
+
horizontal
|
|
708
|
+
nestedScrollEnabled={true}
|
|
709
|
+
>
|
|
710
|
+
<TabsContainer>
|
|
711
|
+
{defaultOrderTypes && defaultOrderTypes.map((tab: any) => (
|
|
712
|
+
<TabPressable
|
|
713
|
+
key={tab.key}
|
|
714
|
+
onPress={() => setCurrentDeliveryType(tab?.name)}
|
|
715
|
+
isSelected={tab.name.toUpperCase() === currentDeliveryType.toUpperCase() ? 1 : 0}
|
|
716
|
+
>
|
|
717
|
+
<OText
|
|
718
|
+
style={{
|
|
719
|
+
...styles.tab,
|
|
720
|
+
fontSize: tab.name.toUpperCase() === currentDeliveryType.toUpperCase() ? 14 : 12,
|
|
721
|
+
borderBottomWidth: Platform.OS === 'ios' && tab.name.toUpperCase() === currentDeliveryType.toUpperCase() ? 1 : 0,
|
|
722
|
+
}}
|
|
723
|
+
color={
|
|
724
|
+
tab.name.toUpperCase() === currentDeliveryType.toUpperCase()
|
|
725
|
+
? theme.colors.textGray
|
|
726
|
+
: theme.colors.unselectText
|
|
727
|
+
}
|
|
728
|
+
weight={tab.name.toUpperCase() === currentDeliveryType ? '600' : 'normal'}
|
|
729
|
+
>
|
|
730
|
+
{tab.name}
|
|
731
|
+
</OText>
|
|
732
|
+
</TabPressable>
|
|
733
|
+
))}
|
|
734
|
+
</TabsContainer>
|
|
735
|
+
</ScrollView>
|
|
736
|
+
</FiltersTab>
|
|
737
|
+
<DeliveryStatusWrapper>
|
|
738
|
+
{selectedTabStatus && selectedTabStatus.length > 0 && selectedTabStatus.map((item: any, i: any) => (
|
|
739
|
+
<StatusBlock
|
|
740
|
+
key={i}
|
|
741
|
+
item={item}
|
|
742
|
+
last={i + 1 === selectedTabStatus.length}
|
|
743
|
+
/>
|
|
744
|
+
))}
|
|
745
|
+
<VerticalLine />
|
|
746
|
+
</DeliveryStatusWrapper>
|
|
747
|
+
</SlaSettingModalContent>
|
|
748
|
+
)}
|
|
749
|
+
</ModalContainer>
|
|
750
|
+
</OModal>
|
|
751
|
+
)}
|
|
752
|
+
</>
|
|
753
|
+
);
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
export const OrdersListManager = (props: OrdersOptionParams) => {
|
|
758
|
+
const [, t] = useLanguage();
|
|
759
|
+
const ordersProps = {
|
|
760
|
+
...props,
|
|
761
|
+
UIComponent: OrdersListManagerUI,
|
|
762
|
+
useDefualtSessionManager: true,
|
|
763
|
+
asDashboard: true,
|
|
764
|
+
isIos: Platform.OS === 'ios',
|
|
765
|
+
orderStatus: [
|
|
766
|
+
{ key: 0, text: t('PENDING', 'Pending') },
|
|
767
|
+
{ key: 1, text: t('COMPLETED', 'Completed') },
|
|
768
|
+
{ key: 2, text: t('REJECTED', 'Rejected') },
|
|
769
|
+
{ key: 3, text: t('DRIVER_IN_BUSINESS', 'Driver in business') },
|
|
770
|
+
{ key: 4, text: t('READY_FOR_PICKUP', 'Ready for pickup') },
|
|
771
|
+
{ key: 5, text: t('REJECTED_BY_BUSINESS', 'Rejected by business') },
|
|
772
|
+
{ key: 6, text: t('REJECTED_BY_DRIVER', 'Rejected by Driver') },
|
|
773
|
+
{ key: 7, text: t('ACCEPTED_BY_BUSINESS', 'Accepted by business') },
|
|
774
|
+
{ key: 8, text: t('ACCEPTED_BY_DRIVER', 'Accepted by driver') },
|
|
775
|
+
{
|
|
776
|
+
key: 9,
|
|
777
|
+
text: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
key: 10,
|
|
781
|
+
text: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
key: 11,
|
|
785
|
+
text: t('DELIVERY_COMPLETED_BY_DRIVER', 'Delivery completed by driver'),
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
key: 12,
|
|
789
|
+
text: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
|
|
790
|
+
},
|
|
791
|
+
{ key: 13, text: t('PREORDER', 'Preorder') },
|
|
792
|
+
{ key: 14, text: t('ORDER_NOT_READY', 'Order not ready') },
|
|
793
|
+
{
|
|
794
|
+
key: 15,
|
|
795
|
+
text: t(
|
|
796
|
+
'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
797
|
+
'Order picked up completed by customer',
|
|
798
|
+
),
|
|
799
|
+
},
|
|
800
|
+
{ key: 16, text: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer') },
|
|
801
|
+
{
|
|
802
|
+
key: 17,
|
|
803
|
+
text: t(
|
|
804
|
+
'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
805
|
+
'Order not picked up by customer',
|
|
806
|
+
),
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
key: 18,
|
|
810
|
+
text: t(
|
|
811
|
+
'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
|
|
812
|
+
'Driver almost arrived to business',
|
|
813
|
+
),
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
key: 19,
|
|
817
|
+
text: t(
|
|
818
|
+
'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
|
|
819
|
+
'Driver almost arrived to customer',
|
|
820
|
+
),
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
key: 20,
|
|
824
|
+
text: t(
|
|
825
|
+
'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
826
|
+
'Customer almost arrived to business',
|
|
827
|
+
),
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
key: 21,
|
|
831
|
+
text: t(
|
|
832
|
+
'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
833
|
+
'Customer arrived to business',
|
|
834
|
+
),
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
key: 22,
|
|
838
|
+
text: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver')
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
key: 23,
|
|
842
|
+
text: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
|
|
843
|
+
}
|
|
844
|
+
],
|
|
845
|
+
tabs: [
|
|
846
|
+
{
|
|
847
|
+
key: 0,
|
|
848
|
+
text: t('PENDING', 'Pending'),
|
|
849
|
+
tags: props?.orderGroupStatusCustom?.pending ?? [0, 13],
|
|
850
|
+
title: 'pending'
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
key: 1,
|
|
854
|
+
text: t('IN_PROGRESS', 'In Progress'),
|
|
855
|
+
tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23],
|
|
856
|
+
title: 'inProgress',
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
key: 2,
|
|
860
|
+
text: t('COMPLETED', 'Completed'),
|
|
861
|
+
tags: props?.orderGroupStatusCustom?.completed ?? [1, 11, 15],
|
|
862
|
+
title: 'completed',
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
key: 3,
|
|
866
|
+
text: t('CANCELLED', 'Cancelled'),
|
|
867
|
+
tags: props?.orderGroupStatusCustom?.cancelled ?? [2, 5, 6, 10, 12, 16, 17],
|
|
868
|
+
title: 'cancelled',
|
|
869
|
+
},
|
|
870
|
+
]
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
return <OrderListGroups {...ordersProps} />;
|
|
874
|
+
};
|