ordering-ui-react-native 0.14.87 → 0.14.88-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 +6 -3
- package/src/DeliveryApp.tsx +34 -2
- package/src/assets/images/no-network.png +0 -0
- package/src/components/BusinessTypeFilter/index.tsx +9 -2
- package/src/components/BusinessTypeFilter/styles.tsx +1 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Cart/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +0 -1
- package/src/components/Home/index.tsx +3 -5
- package/src/components/LanguageSelector/index.tsx +65 -97
- package/src/components/LanguageSelector/styles.tsx +4 -17
- package/src/components/Messages/index.tsx +38 -30
- package/src/components/MomentOption/index.tsx +3 -1
- package/src/components/OrderDetails/index.tsx +26 -5
- package/src/components/PaymentOptions/index.tsx +7 -16
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/ProductForm/index.tsx +1 -1
- package/src/components/ProductForm/styles.tsx +1 -0
- package/src/components/StripeElementsForm/index.tsx +27 -48
- package/src/components/UserProfileForm/index.tsx +35 -1
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/config.json +0 -2
- package/src/pages/Checkout.tsx +1 -1
- package/src/providers/AlertProvider.tsx +4 -1
- package/src/theme.json +2 -1
- package/src/types/index.tsx +2 -9
- package/src/utils/index.tsx +128 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/Chat/index.tsx +32 -31
- package/themes/business/src/components/NetworkError/index.tsx +61 -0
- package/themes/business/src/components/NetworkError/styles.tsx +11 -0
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
- package/themes/business/src/components/OrdersListManager/index.tsx +871 -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 +351 -59
- package/themes/business/src/components/OrdersOption/styles.tsx +95 -7
- package/themes/business/src/components/PreviousOrders/index.tsx +65 -46
- package/themes/business/src/components/PreviousOrders/styles.tsx +5 -10
- package/themes/business/src/components/ReviewCustomer/index.tsx +5 -1
- package/themes/business/src/types/index.tsx +4 -0
- 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/index.tsx +2 -0
- 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 +51 -24
- package/themes/kiosk/src/components/Cart/index.tsx +1 -1
- 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 +7 -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/NetworkError/index.tsx +60 -0
- package/themes/kiosk/src/components/NetworkError/styles.tsx +11 -0
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
- 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 +172 -124
- 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 +4 -0
- package/themes/original/index.tsx +24 -6
- package/themes/original/src/components/AddressForm/index.tsx +15 -10
- package/themes/original/src/components/AddressList/index.tsx +27 -1
- package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +11 -7
- package/themes/original/src/components/BusinessController/index.tsx +3 -3
- package/themes/original/src/components/BusinessMenuList/index.tsx +4 -2
- package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +50 -6
- package/themes/original/src/components/BusinessProductsListing/index.tsx +13 -10
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
- package/themes/original/src/components/BusinessesListing/index.tsx +23 -22
- package/themes/original/src/components/Cart/index.tsx +43 -10
- package/themes/original/src/components/CartContent/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +54 -30
- package/themes/original/src/components/Checkout/styles.tsx +7 -0
- package/themes/original/src/components/CouponControl/index.tsx +1 -0
- package/themes/original/src/components/DriverTips/index.tsx +1 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +9 -2
- package/themes/original/src/components/LoginForm/index.tsx +83 -68
- package/themes/original/src/components/Messages/index.tsx +24 -21
- package/themes/original/src/components/Messages/styles.tsx +1 -3
- package/themes/original/src/components/MomentOption/index.tsx +127 -152
- package/themes/original/src/components/MomentOption/styles.tsx +42 -18
- package/themes/original/src/components/NetworkError/index.tsx +61 -0
- package/themes/original/src/components/NetworkError/styles.tsx +11 -0
- package/themes/original/src/components/OrderDetails/index.tsx +103 -124
- package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +2 -3
- package/themes/original/src/components/OrderSummary/index.tsx +35 -2
- package/themes/original/src/components/OrdersOption/index.tsx +16 -40
- package/themes/original/src/components/OrdersOption/styles.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +21 -24
- package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
- package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
- package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
- package/themes/original/src/components/PreviousOrders/index.tsx +4 -0
- package/themes/original/src/components/ProductForm/index.tsx +154 -105
- package/themes/original/src/components/ProductForm/styles.tsx +5 -3
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +6 -1
- package/themes/original/src/components/ReviewDriver/index.tsx +9 -9
- package/themes/original/src/components/ReviewOrder/index.tsx +9 -27
- package/themes/original/src/components/SignupForm/index.tsx +173 -154
- package/themes/original/src/components/SingleProductCard/index.tsx +6 -13
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductReview/index.tsx +8 -8
- package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
- package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
- package/themes/original/src/components/UserDetails/index.tsx +4 -95
- package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
- package/themes/original/src/components/UserProfile/index.tsx +16 -9
- package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
- 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/shared/HeaderTitle.tsx +20 -0
- package/themes/original/src/components/shared/index.tsx +2 -0
- package/themes/original/src/types/index.tsx +18 -8
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +0 -163
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
-
import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Linking, Platform } from 'react-native';
|
|
3
|
-
import { useLanguage, useUtils, OrderListGroups } from 'ordering-components/native';
|
|
2
|
+
import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Linking, Platform, TextInput } from 'react-native';
|
|
3
|
+
import { useLanguage, useUtils, useToast, ToastType, OrderListGroups, useConfig } from 'ordering-components/native';
|
|
4
|
+
import SelectDropdown from 'react-native-select-dropdown'
|
|
4
5
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
5
6
|
import FeatherIcon from 'react-native-vector-icons/Feather';
|
|
6
7
|
import FontistoIcon from 'react-native-vector-icons/Fontisto'
|
|
@@ -18,7 +19,20 @@ import {
|
|
|
18
19
|
ModalContainer,
|
|
19
20
|
ModalTitle,
|
|
20
21
|
FilterBtnWrapper,
|
|
21
|
-
TabPressable
|
|
22
|
+
TabPressable,
|
|
23
|
+
OrderStatus,
|
|
24
|
+
SlaOption,
|
|
25
|
+
SearchModalContent,
|
|
26
|
+
SlaSettingModalContent,
|
|
27
|
+
DeliveryStatusWrapper,
|
|
28
|
+
VerticalLine,
|
|
29
|
+
StatusItems,
|
|
30
|
+
ItemHeader,
|
|
31
|
+
ItemStatus,
|
|
32
|
+
ItemContent,
|
|
33
|
+
TimerInputWrapper,
|
|
34
|
+
OverLine,
|
|
35
|
+
Actions
|
|
22
36
|
} from './styles';
|
|
23
37
|
import { PreviousOrders } from '../PreviousOrders';
|
|
24
38
|
import { OrdersOptionParams } from '../../types';
|
|
@@ -85,6 +99,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
85
99
|
delivery_type: '',
|
|
86
100
|
paymethod: '',
|
|
87
101
|
driver: '',
|
|
102
|
+
timeStatus: '',
|
|
88
103
|
date: {
|
|
89
104
|
from: '',
|
|
90
105
|
to: '',
|
|
@@ -96,12 +111,59 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
96
111
|
const [, t] = useLanguage();
|
|
97
112
|
const [{ parseDate }] = useUtils()
|
|
98
113
|
const [orientationState] = useDeviceOrientation();
|
|
99
|
-
const [
|
|
114
|
+
const [, { showToast }] = useToast();
|
|
115
|
+
const [openSearchModal, setOpenSearchModal] = useState(false)
|
|
116
|
+
const [openSLASettingModal, setOpenSLASettingModal] = useState(false)
|
|
117
|
+
const [slaSettingTime, setSlaSettingTime] = useState(6000)
|
|
118
|
+
const [currentDeliveryType, setCurrentDeliveryType] = useState('Delivery')
|
|
100
119
|
const [search, setSearch] = useState(defaultSearchList)
|
|
120
|
+
const [selectedTabStatus, setSelectedTabStatus] = useState([])
|
|
121
|
+
const [hour, setHour] = useState(0)
|
|
122
|
+
const [minute, setMinute] = useState(0)
|
|
123
|
+
|
|
101
124
|
const WIDTH_SCREEN = orientationState?.dimensions?.width
|
|
102
125
|
const HEIGHT_SCREEN = orientationState?.dimensions?.height
|
|
103
126
|
const IS_PORTRAIT = orientationState.orientation === PORTRAIT
|
|
104
127
|
|
|
128
|
+
const preorderTypeList = [
|
|
129
|
+
{ key: null, name: t('SLA', 'SLA\'s') },
|
|
130
|
+
{ key: 'in_time', name: t('OK', 'Ok') },
|
|
131
|
+
{ key: 'at_risk', name: t('AT_RISK', 'At Risk') },
|
|
132
|
+
{ key: 'delayed', name: t('DELAYED', 'Delayed') }
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
const defaultOrderTypes = [
|
|
136
|
+
{ key: 1, name: t('DELIVERY', 'Delivery') },
|
|
137
|
+
{ key: 2, name: t('PICKUP', 'Pickup') },
|
|
138
|
+
{ key: 3, name: t('EAT_IN', 'Eat in') },
|
|
139
|
+
{ key: 4, name: t('CURBSIDE', 'Curbside') },
|
|
140
|
+
{ key: 5, name: t('DRIVE_THRU', 'Drive thru') }
|
|
141
|
+
]
|
|
142
|
+
|
|
143
|
+
const deliveryStatus = [
|
|
144
|
+
{
|
|
145
|
+
key: t('OK', 'Ok'),
|
|
146
|
+
des: t('DELIVERY_OK_STATUS_DESC', 'Get delivery time from the businesses.'),
|
|
147
|
+
timmer: false,
|
|
148
|
+
icon: theme.images.general?.clock1,
|
|
149
|
+
backColor: '#00D27A'
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
key: t('AT_RISK', 'At risk'),
|
|
153
|
+
des: t('DELIVERY_ATRISK_STATUS_DESC', 'Is the time between delivery time of busines and the delayed time.'),
|
|
154
|
+
timmer: false,
|
|
155
|
+
icon: theme.images.general?.clockRisk,
|
|
156
|
+
backColor: '#FFC700'
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
key: t('DELAYED', 'Delayed'),
|
|
160
|
+
des: t('DELIVERY_DELAYED_STATUS_DESC', 'If this time is exceeded, the order will be delayed.'),
|
|
161
|
+
timmer: true,
|
|
162
|
+
icon: theme.images.general?.clockDelayed,
|
|
163
|
+
backColor: '#E63757'
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
|
|
105
167
|
const styles = StyleSheet.create({
|
|
106
168
|
header: {
|
|
107
169
|
marginBottom: isBusinessApp ? 10 : 20,
|
|
@@ -127,6 +189,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
127
189
|
marginBottom: -1,
|
|
128
190
|
zIndex: 100,
|
|
129
191
|
borderColor: theme.colors.textGray,
|
|
192
|
+
textTransform: 'capitalize'
|
|
130
193
|
},
|
|
131
194
|
icon: {
|
|
132
195
|
paddingBottom: 10,
|
|
@@ -165,6 +228,51 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
165
228
|
borderColor: '#DEE2E6',
|
|
166
229
|
borderRadius: 7.6,
|
|
167
230
|
marginBottom: 24
|
|
231
|
+
},
|
|
232
|
+
SLAwrapper: {
|
|
233
|
+
flexDirection: 'row',
|
|
234
|
+
marginBottom: 15
|
|
235
|
+
},
|
|
236
|
+
selectOption: {
|
|
237
|
+
alignItems: 'center',
|
|
238
|
+
justifyContent: 'space-between',
|
|
239
|
+
minHeight: 40,
|
|
240
|
+
width: '100%',
|
|
241
|
+
paddingHorizontal: 15,
|
|
242
|
+
backgroundColor: theme.colors.inputChat,
|
|
243
|
+
borderRadius: 7.6,
|
|
244
|
+
},
|
|
245
|
+
buttonTextStyle: {
|
|
246
|
+
textAlign: 'left',
|
|
247
|
+
marginHorizontal: 0,
|
|
248
|
+
fontSize: 16,
|
|
249
|
+
lineHeight: 24,
|
|
250
|
+
color: '#748194'
|
|
251
|
+
},
|
|
252
|
+
dropdownStyle: {
|
|
253
|
+
borderWidth: 1,
|
|
254
|
+
borderRadius: 8,
|
|
255
|
+
paddingTop: 5,
|
|
256
|
+
backgroundColor: '#fff',
|
|
257
|
+
borderColor: theme.colors.lightGray,
|
|
258
|
+
overflow: 'hidden',
|
|
259
|
+
minHeight: 155
|
|
260
|
+
},
|
|
261
|
+
rowStyle: {
|
|
262
|
+
display: 'flex',
|
|
263
|
+
borderBottomWidth: 0,
|
|
264
|
+
height: 36,
|
|
265
|
+
alignItems: 'center',
|
|
266
|
+
paddingHorizontal: 10
|
|
267
|
+
},
|
|
268
|
+
acceptButtonStyle: {
|
|
269
|
+
borderRadius: 7.6,
|
|
270
|
+
width: 130,
|
|
271
|
+
height: 42,
|
|
272
|
+
},
|
|
273
|
+
errorMessage: {
|
|
274
|
+
marginBottom: 10,
|
|
275
|
+
color: theme.colors.error,
|
|
168
276
|
}
|
|
169
277
|
});
|
|
170
278
|
|
|
@@ -201,7 +309,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
201
309
|
})
|
|
202
310
|
const dateRange = calculateDate(search.date.type, search.date.from, search.date.to)
|
|
203
311
|
onFiltered && onFiltered({ ...search, date: { ...dateRange } })
|
|
204
|
-
|
|
312
|
+
setOpenSearchModal(false)
|
|
205
313
|
}
|
|
206
314
|
|
|
207
315
|
const handleTagSelected = (tag: any) => {
|
|
@@ -283,6 +391,15 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
283
391
|
}
|
|
284
392
|
}
|
|
285
393
|
|
|
394
|
+
const onClickSetting = () => {
|
|
395
|
+
setOpenSLASettingModal(true)
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const handleClose = () => {
|
|
399
|
+
setOpenSearchModal(false)
|
|
400
|
+
setOpenSLASettingModal(false)
|
|
401
|
+
}
|
|
402
|
+
|
|
286
403
|
useEffect(() => {
|
|
287
404
|
setCurrentFilters(null)
|
|
288
405
|
onFiltered && onFiltered(null)
|
|
@@ -292,6 +409,10 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
292
409
|
scrollRef.current?.scrollTo({ y: 0, animated: true });
|
|
293
410
|
}, [currentTabSelected])
|
|
294
411
|
|
|
412
|
+
useEffect(() => {
|
|
413
|
+
setSelectedTabStatus(deliveryStatus)
|
|
414
|
+
}, [])
|
|
415
|
+
|
|
295
416
|
return (
|
|
296
417
|
// <GestureRecognizer
|
|
297
418
|
// onSwipeLeft={onSwipeLeft}
|
|
@@ -314,10 +435,59 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
314
435
|
name='search'
|
|
315
436
|
color={theme.colors.backgroundDark}
|
|
316
437
|
size={24}
|
|
317
|
-
onPress={() =>
|
|
438
|
+
onPress={() => setOpenSearchModal(true)}
|
|
318
439
|
/>
|
|
319
440
|
</IconWrapper>
|
|
320
441
|
</View>
|
|
442
|
+
<View style={styles.SLAwrapper}>
|
|
443
|
+
<View style={{ flex: 0.5 }}>
|
|
444
|
+
<OButton
|
|
445
|
+
text={t('SLA_SETTING', 'SLA’s Settings')}
|
|
446
|
+
textStyle={{ color: theme.colors.backArrow }}
|
|
447
|
+
imgRightSrc={null}
|
|
448
|
+
style={{
|
|
449
|
+
backgroundColor: theme.colors.inputChat,
|
|
450
|
+
borderRadius: 7.6,
|
|
451
|
+
zIndex: 10,
|
|
452
|
+
borderWidth: 0,
|
|
453
|
+
minHeight: 40
|
|
454
|
+
}}
|
|
455
|
+
onClick={onClickSetting}
|
|
456
|
+
/>
|
|
457
|
+
</View>
|
|
458
|
+
<View style={{ width: 10, height: '100%' }} />
|
|
459
|
+
<View style={{ flex: 0.5, justifyContent: 'center' }}>
|
|
460
|
+
<SelectDropdown
|
|
461
|
+
defaultButtonText={t('SLA', 'SLA\'s')}
|
|
462
|
+
data={preorderTypeList}
|
|
463
|
+
onSelect={(selectedItem, index) => {
|
|
464
|
+
onFiltered && onFiltered({ ...search, timeStatus: selectedItem?.key })
|
|
465
|
+
}}
|
|
466
|
+
buttonTextAfterSelection={(selectedItem, index) => {
|
|
467
|
+
return selectedItem.name
|
|
468
|
+
}}
|
|
469
|
+
rowTextForSelection={(item, index) => {
|
|
470
|
+
return item.key
|
|
471
|
+
}}
|
|
472
|
+
buttonStyle={styles.selectOption}
|
|
473
|
+
buttonTextStyle={styles.buttonTextStyle}
|
|
474
|
+
renderDropdownIcon={isOpened => {
|
|
475
|
+
return <FeatherIcon name={isOpened ? 'chevron-up' : 'chevron-down'} color={'#444'} size={18} />;
|
|
476
|
+
}}
|
|
477
|
+
dropdownStyle={styles.dropdownStyle}
|
|
478
|
+
dropdownOverlayColor='transparent'
|
|
479
|
+
rowStyle={styles.rowStyle}
|
|
480
|
+
renderCustomizedRowChild={(item, index) => {
|
|
481
|
+
return (
|
|
482
|
+
<SlaOption>
|
|
483
|
+
{index !== 0 && <OrderStatus timeState={item?.key} />}
|
|
484
|
+
<View><OText size={14} color={'#748194'} >{item?.name}</OText></View>
|
|
485
|
+
</SlaOption>
|
|
486
|
+
);
|
|
487
|
+
}}
|
|
488
|
+
/>
|
|
489
|
+
</View>
|
|
490
|
+
</View>
|
|
321
491
|
<FiltersTab>
|
|
322
492
|
<ScrollView
|
|
323
493
|
ref={scrollRefTab}
|
|
@@ -371,7 +541,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
371
541
|
</TabsContainer>
|
|
372
542
|
</ScrollView>
|
|
373
543
|
</FiltersTab>
|
|
374
|
-
<View style={{ flex: 1, minHeight: HEIGHT_SCREEN -
|
|
544
|
+
<View style={{ flex: 1, minHeight: HEIGHT_SCREEN - 450 }}>
|
|
375
545
|
{currentTabSelected !== 'logisticOrders' && (
|
|
376
546
|
<View
|
|
377
547
|
style={{
|
|
@@ -460,6 +630,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
460
630
|
onNavigationRedirect={onNavigationRedirect}
|
|
461
631
|
getOrderStatus={getOrderStatus}
|
|
462
632
|
handleClickOrder={handleClickOrder}
|
|
633
|
+
slaSettingTime={slaSettingTime}
|
|
634
|
+
currentTabSelected={currentTabSelected}
|
|
463
635
|
/>
|
|
464
636
|
)}
|
|
465
637
|
{!logisticOrders?.error?.length &&
|
|
@@ -552,8 +724,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
552
724
|
{/* </GestureRecognizer> */}
|
|
553
725
|
|
|
554
726
|
<NewOrderNotification />
|
|
555
|
-
{
|
|
556
|
-
<OModal open={
|
|
727
|
+
{(openSearchModal || openSLASettingModal) && (
|
|
728
|
+
<OModal open={openSearchModal || openSLASettingModal} entireModal customClose>
|
|
557
729
|
<ModalContainer
|
|
558
730
|
nestedScrollEnabled={true}
|
|
559
731
|
>
|
|
@@ -569,62 +741,117 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
569
741
|
marginBottom: 30,
|
|
570
742
|
marginTop: 30
|
|
571
743
|
}}
|
|
572
|
-
onClick={() =>
|
|
573
|
-
/>
|
|
574
|
-
<ModalTitle>{t('SEARCH_ORDERS', 'Search orders')}</ModalTitle>
|
|
575
|
-
<OInput
|
|
576
|
-
value={search.id}
|
|
577
|
-
onChange={(value: any) => setSearch({ ...search, id: value })}
|
|
578
|
-
style={styles.inputStyle}
|
|
579
|
-
placeholder={t('ORDER_NUMBER', 'Order number')}
|
|
580
|
-
autoCorrect={false}
|
|
744
|
+
onClick={() => handleClose()}
|
|
581
745
|
/>
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
/>
|
|
592
|
-
{isBusinessApp && (
|
|
593
|
-
<>
|
|
594
|
-
<OrdersOptionBusiness
|
|
595
|
-
{...props}
|
|
596
|
-
search={search}
|
|
597
|
-
onSearch={setSearch}
|
|
746
|
+
{openSearchModal && (
|
|
747
|
+
<SearchModalContent>
|
|
748
|
+
<ModalTitle>{t('SEARCH_ORDERS', 'Search orders')}</ModalTitle>
|
|
749
|
+
<OInput
|
|
750
|
+
value={search.id}
|
|
751
|
+
onChange={(value: any) => setSearch({ ...search, id: value })}
|
|
752
|
+
style={styles.inputStyle}
|
|
753
|
+
placeholder={t('ORDER_NUMBER', 'Order number')}
|
|
754
|
+
autoCorrect={false}
|
|
598
755
|
/>
|
|
599
|
-
<
|
|
756
|
+
<OrdersOptionDate
|
|
600
757
|
{...props}
|
|
601
758
|
search={search}
|
|
602
759
|
onSearch={setSearch}
|
|
603
760
|
/>
|
|
604
|
-
<
|
|
761
|
+
<OrdersOptionCity
|
|
605
762
|
{...props}
|
|
606
763
|
search={search}
|
|
607
764
|
onSearch={setSearch}
|
|
608
765
|
/>
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
766
|
+
{isBusinessApp && (
|
|
767
|
+
<>
|
|
768
|
+
<OrdersOptionBusiness
|
|
769
|
+
{...props}
|
|
770
|
+
search={search}
|
|
771
|
+
onSearch={setSearch}
|
|
772
|
+
/>
|
|
773
|
+
<OrdersOptionDelivery
|
|
774
|
+
{...props}
|
|
775
|
+
search={search}
|
|
776
|
+
onSearch={setSearch}
|
|
777
|
+
/>
|
|
778
|
+
<OrdersOptionDriver
|
|
779
|
+
{...props}
|
|
780
|
+
search={search}
|
|
781
|
+
onSearch={setSearch}
|
|
782
|
+
/>
|
|
783
|
+
<OrdersOptionPaymethod
|
|
784
|
+
{...props}
|
|
785
|
+
search={search}
|
|
786
|
+
onSearch={setSearch}
|
|
787
|
+
/>
|
|
788
|
+
</>
|
|
789
|
+
)}
|
|
790
|
+
<OButton
|
|
791
|
+
text={t('SEARCH', 'Search')}
|
|
792
|
+
textStyle={{ color: theme.colors.white }}
|
|
793
|
+
imgRightSrc={null}
|
|
794
|
+
style={{
|
|
795
|
+
borderRadius: 7.6,
|
|
796
|
+
marginBottom: 70,
|
|
797
|
+
marginTop: 60,
|
|
798
|
+
zIndex: 12
|
|
799
|
+
}}
|
|
800
|
+
onClick={applyFilters}
|
|
613
801
|
/>
|
|
614
|
-
|
|
802
|
+
|
|
803
|
+
</SearchModalContent>
|
|
804
|
+
)}
|
|
805
|
+
{openSLASettingModal && (
|
|
806
|
+
<SlaSettingModalContent>
|
|
807
|
+
<ModalTitle>{t('SLA_SETTINGS', 'SLA’s Settings')}</ModalTitle>
|
|
808
|
+
<FiltersTab>
|
|
809
|
+
<ScrollView
|
|
810
|
+
ref={scrollRefTab}
|
|
811
|
+
showsVerticalScrollIndicator={false}
|
|
812
|
+
showsHorizontalScrollIndicator={false}
|
|
813
|
+
horizontal
|
|
814
|
+
nestedScrollEnabled={true}
|
|
815
|
+
>
|
|
816
|
+
<TabsContainer>
|
|
817
|
+
{defaultOrderTypes && defaultOrderTypes.map(tab => (
|
|
818
|
+
<TabPressable
|
|
819
|
+
key={tab.key}
|
|
820
|
+
onPress={() => setCurrentDeliveryType(tab?.name)}
|
|
821
|
+
isSelected={tab.name.toUpperCase() === currentDeliveryType.toUpperCase() ? 1 : 0}
|
|
822
|
+
>
|
|
823
|
+
<OText
|
|
824
|
+
style={{
|
|
825
|
+
...styles.tab,
|
|
826
|
+
fontSize: tab.name.toUpperCase() === currentDeliveryType.toUpperCase() ? 14 : 12,
|
|
827
|
+
borderBottomWidth: Platform.OS === 'ios' && tab.name.toUpperCase() === currentDeliveryType.toUpperCase() ? 1 : 0,
|
|
828
|
+
}}
|
|
829
|
+
color={
|
|
830
|
+
tab.name.toUpperCase() === currentDeliveryType.toUpperCase()
|
|
831
|
+
? theme.colors.textGray
|
|
832
|
+
: theme.colors.unselectText
|
|
833
|
+
}
|
|
834
|
+
weight={tab.name.toUpperCase() === currentDeliveryType ? '600' : 'normal'}
|
|
835
|
+
>
|
|
836
|
+
{tab.name}
|
|
837
|
+
</OText>
|
|
838
|
+
</TabPressable>
|
|
839
|
+
))}
|
|
840
|
+
</TabsContainer>
|
|
841
|
+
</ScrollView>
|
|
842
|
+
</FiltersTab>
|
|
843
|
+
<DeliveryStatusWrapper>
|
|
844
|
+
{selectedTabStatus && selectedTabStatus.length > 0 && selectedTabStatus.map((item, i) => (
|
|
845
|
+
<StatusBlock
|
|
846
|
+
key={i}
|
|
847
|
+
item={item}
|
|
848
|
+
last={i + 1 === selectedTabStatus.length}
|
|
849
|
+
/>
|
|
850
|
+
))}
|
|
851
|
+
<VerticalLine />
|
|
852
|
+
</DeliveryStatusWrapper>
|
|
853
|
+
</SlaSettingModalContent>
|
|
615
854
|
)}
|
|
616
|
-
<OButton
|
|
617
|
-
text={t('SEARCH', 'Search')}
|
|
618
|
-
textStyle={{ color: theme.colors.white }}
|
|
619
|
-
imgRightSrc={null}
|
|
620
|
-
style={{
|
|
621
|
-
borderRadius: 7.6,
|
|
622
|
-
marginBottom: 70,
|
|
623
|
-
marginTop: 60,
|
|
624
|
-
zIndex: 12
|
|
625
|
-
}}
|
|
626
|
-
onClick={applyFilters}
|
|
627
|
-
/>
|
|
628
855
|
</ModalContainer>
|
|
629
856
|
</OModal>
|
|
630
857
|
)}
|
|
@@ -632,6 +859,71 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
632
859
|
);
|
|
633
860
|
};
|
|
634
861
|
|
|
862
|
+
export const StatusBlock = (props: any) => {
|
|
863
|
+
const { item, last } = props
|
|
864
|
+
const [showTime, setShowTime] = useState(false)
|
|
865
|
+
|
|
866
|
+
useEffect(() => {
|
|
867
|
+
if (last) {
|
|
868
|
+
setShowTime(true)
|
|
869
|
+
}
|
|
870
|
+
}, [last])
|
|
871
|
+
|
|
872
|
+
return (
|
|
873
|
+
<StatusItems>
|
|
874
|
+
<Pressable style={{ marginBottom: 10 }}>
|
|
875
|
+
<ItemHeader>
|
|
876
|
+
<IconWrapper>
|
|
877
|
+
<OIcon
|
|
878
|
+
src={item?.icon}
|
|
879
|
+
width={16}
|
|
880
|
+
height={16}
|
|
881
|
+
color={item?.backColor}
|
|
882
|
+
/>
|
|
883
|
+
</IconWrapper>
|
|
884
|
+
<ItemStatus backColor={item?.backColor} />
|
|
885
|
+
<OText>{item?.key}</OText>
|
|
886
|
+
</ItemHeader>
|
|
887
|
+
</Pressable>
|
|
888
|
+
<ItemContent>
|
|
889
|
+
<OText>{item?.des}</OText>
|
|
890
|
+
</ItemContent>
|
|
891
|
+
{showTime && (
|
|
892
|
+
<Timer />
|
|
893
|
+
)}
|
|
894
|
+
{last && (
|
|
895
|
+
<OverLine />
|
|
896
|
+
)}
|
|
897
|
+
</StatusItems>
|
|
898
|
+
)
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
export const Timer = () => {
|
|
902
|
+
const [, t] = useLanguage()
|
|
903
|
+
const theme = useTheme()
|
|
904
|
+
const [{ configs }] = useConfig();
|
|
905
|
+
|
|
906
|
+
const styles = StyleSheet.create({
|
|
907
|
+
settingTime: {
|
|
908
|
+
fontSize: 14,
|
|
909
|
+
borderWidth: 1,
|
|
910
|
+
borderRadius: 7.6,
|
|
911
|
+
margin: 0,
|
|
912
|
+
marginRight: 10,
|
|
913
|
+
paddingHorizontal: 10,
|
|
914
|
+
paddingTop: 5,
|
|
915
|
+
borderColor: theme.colors.disabled
|
|
916
|
+
}
|
|
917
|
+
})
|
|
918
|
+
|
|
919
|
+
return (
|
|
920
|
+
<TimerInputWrapper>
|
|
921
|
+
<OText style={styles.settingTime} color={theme.colors.disabled}>{configs?.order_deadlines_delayed_time?.value}</OText>
|
|
922
|
+
<OText>{t('MIN', 'min')}</OText>
|
|
923
|
+
</TimerInputWrapper>
|
|
924
|
+
)
|
|
925
|
+
}
|
|
926
|
+
|
|
635
927
|
export const OrdersOption = (props: OrdersOptionParams) => {
|
|
636
928
|
const [, t] = useLanguage();
|
|
637
929
|
const theme = useTheme()
|
|
@@ -712,13 +1004,13 @@ export const OrdersOption = (props: OrdersOptionParams) => {
|
|
|
712
1004
|
'Customer arrived to business',
|
|
713
1005
|
),
|
|
714
1006
|
},
|
|
715
|
-
{
|
|
716
|
-
key: 22,
|
|
717
|
-
text: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver')
|
|
1007
|
+
{
|
|
1008
|
+
key: 22,
|
|
1009
|
+
text: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver')
|
|
718
1010
|
},
|
|
719
|
-
{
|
|
720
|
-
key: 23,
|
|
721
|
-
text: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
|
|
1011
|
+
{
|
|
1012
|
+
key: 23,
|
|
1013
|
+
text: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
|
|
722
1014
|
}
|
|
723
1015
|
],
|
|
724
1016
|
tabs: [
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import styled from 'styled-components/native';
|
|
1
|
+
import styled, { css } from 'styled-components/native';
|
|
2
2
|
|
|
3
3
|
export const FiltersTab = styled.View`
|
|
4
4
|
margin-bottom: 20px;
|
|
5
5
|
min-height: 30px;
|
|
6
6
|
max-height: 35px;
|
|
7
7
|
flex: 1;
|
|
8
|
-
|
|
8
|
+
width: 100%;
|
|
9
|
+
`
|
|
9
10
|
|
|
10
11
|
export const TabsContainer = styled.View`
|
|
11
12
|
display: flex;
|
|
@@ -13,8 +14,9 @@ export const TabsContainer = styled.View`
|
|
|
13
14
|
justify-content: space-between;
|
|
14
15
|
border-bottom-width: 1px;
|
|
15
16
|
flex: 1;
|
|
17
|
+
width: 100%;
|
|
16
18
|
border-bottom-color: ${(props: any) => props.theme.colors.tabBar};
|
|
17
|
-
|
|
19
|
+
`
|
|
18
20
|
|
|
19
21
|
export const Tag = styled.Pressable`
|
|
20
22
|
background-color: ${({ isSelected }: { isSelected: string }) => isSelected};
|
|
@@ -24,24 +26,24 @@ export const Tag = styled.Pressable`
|
|
|
24
26
|
padding: 4px 10px;
|
|
25
27
|
border-radius: 50px;
|
|
26
28
|
margin-right: 15px;
|
|
27
|
-
|
|
29
|
+
`
|
|
28
30
|
|
|
29
31
|
export const IconWrapper = styled.View`
|
|
30
32
|
flex-direction: row;
|
|
31
33
|
align-items: center;
|
|
34
|
+
background: #fff;
|
|
32
35
|
`
|
|
33
36
|
|
|
34
37
|
export const ModalContainer = styled.ScrollView`
|
|
35
|
-
padding:
|
|
38
|
+
padding: 0px 30px;
|
|
36
39
|
`
|
|
37
40
|
|
|
38
41
|
export const ModalTitle = styled.Text`
|
|
39
42
|
font-family: Poppins;
|
|
40
43
|
font-style: normal;
|
|
41
|
-
font-weight:
|
|
44
|
+
font-weight: bold;
|
|
42
45
|
font-size: 20px;
|
|
43
46
|
color: ${(props: any) => props.theme.colors.textGray};
|
|
44
|
-
text-transform: capitalize;
|
|
45
47
|
margin-bottom: 24px;
|
|
46
48
|
`
|
|
47
49
|
|
|
@@ -61,4 +63,90 @@ export const TabPressable = styled.Pressable`
|
|
|
61
63
|
border-color: ${(props: any) => props.theme.colors.textGray};
|
|
62
64
|
border-bottom-width: ${(props: any) => props.isSelected ? '1px' : '0px'};
|
|
63
65
|
padding-horizontal: 10px;
|
|
66
|
+
`
|
|
67
|
+
export const OrderStatus = styled.View`
|
|
68
|
+
margin-right: 5px;
|
|
69
|
+
width: 3px;
|
|
70
|
+
height: 90%;
|
|
71
|
+
border-radius: 6px;
|
|
72
|
+
|
|
73
|
+
${(props: any) => props.timeState === 'in_time' && css`
|
|
74
|
+
background-color: #00D27A;
|
|
75
|
+
`}
|
|
76
|
+
|
|
77
|
+
${(props: any) => props.timeState === 'at_risk' && css`
|
|
78
|
+
background-color: #FFC700;
|
|
79
|
+
`}
|
|
80
|
+
|
|
81
|
+
${(props: any) => props.timeState === 'delayed' && css`
|
|
82
|
+
background-color: #E63757;
|
|
83
|
+
`}
|
|
84
|
+
`
|
|
85
|
+
|
|
86
|
+
export const SlaOption = styled.View`
|
|
87
|
+
flex-direction: row;
|
|
88
|
+
align-items: center;
|
|
89
|
+
`
|
|
90
|
+
|
|
91
|
+
export const SearchModalContent = styled.View`
|
|
92
|
+
|
|
93
|
+
`
|
|
94
|
+
|
|
95
|
+
export const SlaSettingModalContent = styled.View`
|
|
96
|
+
|
|
97
|
+
`
|
|
98
|
+
|
|
99
|
+
export const DeliveryStatusWrapper = styled.View`
|
|
100
|
+
position: relative;
|
|
101
|
+
`
|
|
102
|
+
export const VerticalLine = styled.View`
|
|
103
|
+
position: absolute;
|
|
104
|
+
background: #E9ECEF;
|
|
105
|
+
position: absolute;
|
|
106
|
+
width: 1px;
|
|
107
|
+
height: 100%;
|
|
108
|
+
top: 7px;
|
|
109
|
+
left: 7px;
|
|
110
|
+
`
|
|
111
|
+
export const StatusItems = styled.View`
|
|
112
|
+
position: relative;
|
|
113
|
+
margin-bottom: 20px;
|
|
114
|
+
z-index: 2;
|
|
115
|
+
`
|
|
116
|
+
export const ItemHeader = styled.View`
|
|
117
|
+
flex-direction: row;
|
|
118
|
+
margin-bottom: 5px;
|
|
119
|
+
`
|
|
120
|
+
export const ItemStatus = styled.View`
|
|
121
|
+
width: 4px;
|
|
122
|
+
height: 22px;
|
|
123
|
+
margin: 0 15px;
|
|
124
|
+
border-radius: 4px;
|
|
125
|
+
background: ${(props: any) => props.backColor};
|
|
126
|
+
`
|
|
127
|
+
export const ItemContent = styled.View`
|
|
128
|
+
display: flex;
|
|
129
|
+
padding: 0 30px;
|
|
130
|
+
`
|
|
131
|
+
|
|
132
|
+
export const TimerInputWrapper = styled.View`
|
|
133
|
+
color: ${(props: any) => props.theme.colors.disabled};
|
|
134
|
+
margin-top: 15px;
|
|
135
|
+
margin-left: 30px;
|
|
136
|
+
margin-right: 30px;
|
|
137
|
+
flex-direction: row;
|
|
138
|
+
align-items: flex-end;
|
|
139
|
+
`
|
|
140
|
+
export const OverLine = styled.View`
|
|
141
|
+
position: absolute;
|
|
142
|
+
height: 100%;
|
|
143
|
+
width: 15px;
|
|
144
|
+
top: 20px;
|
|
145
|
+
left: 0;
|
|
146
|
+
/* border-width: 1px; */
|
|
147
|
+
background-color: #fff;
|
|
148
|
+
z-index: 2;
|
|
149
|
+
`
|
|
150
|
+
export const Actions = styled.View`
|
|
151
|
+
|
|
64
152
|
`
|