ordering-ui-react-native 0.14.89 → 0.14.90-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.
Files changed (135) hide show
  1. package/package.json +6 -3
  2. package/src/DeliveryApp.tsx +34 -2
  3. package/src/assets/images/no-network.png +0 -0
  4. package/src/components/BusinessTypeFilter/index.tsx +9 -2
  5. package/src/components/BusinessTypeFilter/styles.tsx +1 -1
  6. package/src/components/BusinessesListing/index.tsx +1 -1
  7. package/src/components/Cart/index.tsx +1 -1
  8. package/src/components/Checkout/index.tsx +0 -1
  9. package/src/components/Home/index.tsx +3 -5
  10. package/src/components/LanguageSelector/index.tsx +65 -97
  11. package/src/components/LanguageSelector/styles.tsx +4 -17
  12. package/src/components/Messages/index.tsx +38 -30
  13. package/src/components/MomentOption/index.tsx +3 -1
  14. package/src/components/OrderDetails/index.tsx +26 -5
  15. package/src/components/PaymentOptions/index.tsx +7 -16
  16. package/src/components/PaymentOptionsWebView/index.tsx +123 -124
  17. package/src/components/ProductForm/index.tsx +1 -1
  18. package/src/components/ProductForm/styles.tsx +1 -0
  19. package/src/components/StripeElementsForm/index.tsx +27 -48
  20. package/src/components/UserProfileForm/index.tsx +35 -1
  21. package/src/components/VerifyPhone/styles.tsx +1 -2
  22. package/src/config.json +0 -2
  23. package/src/pages/Checkout.tsx +1 -1
  24. package/src/providers/AlertProvider.tsx +4 -1
  25. package/src/theme.json +2 -1
  26. package/src/types/index.tsx +2 -9
  27. package/src/utils/index.tsx +2 -1
  28. package/themes/business/index.tsx +4 -0
  29. package/themes/business/src/components/Chat/index.tsx +32 -31
  30. package/themes/business/src/components/NetworkError/index.tsx +61 -0
  31. package/themes/business/src/components/NetworkError/styles.tsx +11 -0
  32. package/themes/business/src/components/OrderDetails/Business.tsx +1 -0
  33. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +85 -17
  34. package/themes/business/src/components/OrdersListManager/index.tsx +871 -0
  35. package/themes/business/src/components/OrdersListManager/styles.tsx +123 -0
  36. package/themes/business/src/components/OrdersListManager/utils.tsx +216 -0
  37. package/themes/business/src/components/OrdersOption/index.tsx +18 -68
  38. package/themes/business/src/components/OrdersOption/styles.tsx +2 -5
  39. package/themes/business/src/components/PreviousOrders/index.tsx +34 -11
  40. package/themes/business/src/components/ReviewCustomer/index.tsx +5 -1
  41. package/themes/business/src/types/index.tsx +4 -0
  42. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  43. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  44. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  45. package/themes/kiosk/index.tsx +2 -0
  46. package/themes/kiosk/src/components/BusinessController/index.tsx +27 -6
  47. package/themes/kiosk/src/components/BusinessController/styles.tsx +1 -1
  48. package/themes/kiosk/src/components/BusinessProductsListing/index.tsx +51 -24
  49. package/themes/kiosk/src/components/Cart/index.tsx +1 -1
  50. package/themes/kiosk/src/components/CartBottomSheet/index.tsx +1 -1
  51. package/themes/kiosk/src/components/CartBottomSheet/styles.tsx +1 -1
  52. package/themes/kiosk/src/components/CartContent/index.tsx +13 -3
  53. package/themes/kiosk/src/components/CartItem/index.tsx +20 -8
  54. package/themes/kiosk/src/components/CategoriesMenu/index.tsx +7 -5
  55. package/themes/kiosk/src/components/CustomerName/index.tsx +89 -88
  56. package/themes/kiosk/src/components/Intro/index.tsx +13 -13
  57. package/themes/kiosk/src/components/LanguageSelector/index.tsx +12 -8
  58. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  59. package/themes/kiosk/src/components/NetworkError/index.tsx +60 -0
  60. package/themes/kiosk/src/components/NetworkError/styles.tsx +11 -0
  61. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  62. package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
  63. package/themes/kiosk/src/components/OrderSummary/index.tsx +1 -1
  64. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
  65. package/themes/kiosk/src/components/ProductForm/index.tsx +172 -124
  66. package/themes/kiosk/src/components/ProductForm/styles.tsx +1 -1
  67. package/themes/kiosk/src/components/ProductOption/index.tsx +1 -0
  68. package/themes/kiosk/src/components/ProductOption/styles.tsx +1 -0
  69. package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
  70. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  71. package/themes/kiosk/src/components/shared/OCard.tsx +112 -78
  72. package/themes/kiosk/src/types/index.d.ts +4 -0
  73. package/themes/original/index.tsx +36 -6
  74. package/themes/original/src/components/AddressForm/index.tsx +15 -10
  75. package/themes/original/src/components/AddressList/index.tsx +27 -1
  76. package/themes/original/src/components/AnalyticsSegment/index.tsx +127 -0
  77. package/themes/original/src/components/BusinessBasicInformation/index.tsx +11 -7
  78. package/themes/original/src/components/BusinessController/index.tsx +5 -4
  79. package/themes/original/src/components/BusinessMenuList/index.tsx +4 -2
  80. package/themes/original/src/components/BusinessPreorder/index.tsx +142 -121
  81. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -1
  82. package/themes/original/src/components/BusinessProductsList/index.tsx +50 -6
  83. package/themes/original/src/components/BusinessProductsListing/index.tsx +13 -10
  84. package/themes/original/src/components/BusinessReviews/index.tsx +4 -3
  85. package/themes/original/src/components/BusinessesListing/index.tsx +23 -22
  86. package/themes/original/src/components/Cart/index.tsx +43 -10
  87. package/themes/original/src/components/CartContent/index.tsx +2 -2
  88. package/themes/original/src/components/Checkout/index.tsx +54 -30
  89. package/themes/original/src/components/Checkout/styles.tsx +7 -0
  90. package/themes/original/src/components/CouponControl/index.tsx +1 -0
  91. package/themes/original/src/components/DriverTips/index.tsx +1 -1
  92. package/themes/original/src/components/ForgotPasswordForm/index.tsx +8 -12
  93. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +9 -2
  94. package/themes/original/src/components/LoginForm/index.tsx +83 -68
  95. package/themes/original/src/components/Messages/index.tsx +24 -21
  96. package/themes/original/src/components/Messages/styles.tsx +1 -3
  97. package/themes/original/src/components/MomentOption/index.tsx +127 -152
  98. package/themes/original/src/components/MomentOption/styles.tsx +42 -18
  99. package/themes/original/src/components/NetworkError/index.tsx +61 -0
  100. package/themes/original/src/components/NetworkError/styles.tsx +11 -0
  101. package/themes/original/src/components/OrderDetails/index.tsx +103 -124
  102. package/themes/original/src/components/OrderDetails/styles.tsx +3 -1
  103. package/themes/original/src/components/OrderProgress/index.tsx +2 -3
  104. package/themes/original/src/components/OrderSummary/index.tsx +35 -2
  105. package/themes/original/src/components/OrdersOption/index.tsx +16 -40
  106. package/themes/original/src/components/OrdersOption/styles.tsx +0 -5
  107. package/themes/original/src/components/PaymentOptionWallet/index.tsx +1 -1
  108. package/themes/original/src/components/PaymentOptions/index.tsx +21 -24
  109. package/themes/original/src/components/PhoneInputNumber/index.tsx +15 -8
  110. package/themes/original/src/components/PlaceSpot/index.tsx +114 -0
  111. package/themes/original/src/components/PlaceSpot/styles.tsx +11 -0
  112. package/themes/original/src/components/PreviousOrders/index.tsx +4 -0
  113. package/themes/original/src/components/ProductForm/index.tsx +154 -105
  114. package/themes/original/src/components/ProductForm/styles.tsx +5 -3
  115. package/themes/original/src/components/ProductOptionSubOption/index.tsx +6 -1
  116. package/themes/original/src/components/ReviewDriver/index.tsx +2 -1
  117. package/themes/original/src/components/ReviewOrder/index.tsx +2 -17
  118. package/themes/original/src/components/SignupForm/index.tsx +173 -154
  119. package/themes/original/src/components/SingleProductCard/index.tsx +6 -13
  120. package/themes/original/src/components/SingleProductCard/styles.tsx +1 -1
  121. package/themes/original/src/components/SingleProductReview/index.tsx +4 -0
  122. package/themes/original/src/components/StripeElementsForm/index.tsx +55 -72
  123. package/themes/original/src/components/UpsellingProducts/index.tsx +6 -6
  124. package/themes/original/src/components/UserDetails/index.tsx +4 -95
  125. package/themes/original/src/components/UserFormDetails/index.tsx +2 -14
  126. package/themes/original/src/components/UserProfile/index.tsx +16 -9
  127. package/themes/original/src/components/UserProfileForm/index.tsx +16 -8
  128. package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
  129. package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
  130. package/themes/original/src/components/shared/HeaderTitle.tsx +20 -0
  131. package/themes/original/src/components/shared/index.tsx +2 -0
  132. package/themes/original/src/types/index.tsx +18 -8
  133. package/themes/single-business/src/components/OrderTypeSelector/index.tsx +5 -5
  134. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
  135. package/src/components/StripeMethodForm/index.tsx +0 -163
@@ -0,0 +1,123 @@
1
+ import styled, { css } from 'styled-components/native';
2
+
3
+ export const FiltersTab = styled.View`
4
+ margin-bottom: 20px;
5
+ min-height: 30px;
6
+ max-height: 35px;
7
+ flex: 1;
8
+ width: 100%;
9
+ `
10
+
11
+ export const TabsContainer = styled.View`
12
+ display: flex;
13
+ flex-direction: row;
14
+ justify-content: space-between;
15
+ border-bottom-width: 1px;
16
+ flex: 1;
17
+ width: 100%;
18
+ border-bottom-color: ${(props: any) => props.theme.colors.tabBar};
19
+ `
20
+
21
+ export const Tag = styled.Pressable`
22
+ background-color: ${({ isSelected }: { isSelected: string }) => isSelected};
23
+ justify-content: center;
24
+ align-items: center;
25
+ min-height: 34px;
26
+ padding: 4px 10px;
27
+ border-radius: 50px;
28
+ margin-right: 15px;
29
+ `
30
+
31
+ export const IconWrapper = styled.View`
32
+ flex-direction: row;
33
+ align-items: center;
34
+ background: #fff;
35
+ `
36
+
37
+ export const ModalContainer = styled.ScrollView`
38
+ padding: 0px 30px;
39
+ `
40
+
41
+ export const ModalTitle = styled.Text`
42
+ font-family: Poppins;
43
+ font-style: normal;
44
+ font-weight: bold;
45
+ font-size: 20px;
46
+ color: ${(props: any) => props.theme.colors.textGray};
47
+ margin-bottom: 24px;
48
+ `
49
+
50
+ export const FilterBtnWrapper = styled.TouchableOpacity`
51
+ background-color: ${(props: any) => props.theme.colors.inputDisabled};
52
+ border-radius: 7.6px;
53
+ margin-vertical: 5px;
54
+ padding: 15px 20px;
55
+ flex-direction: row;
56
+ align-items: center;
57
+ justify-content: space-between;
58
+ margin-bottom: 24px;
59
+ `
60
+
61
+ export const TabPressable = styled.Pressable`
62
+ align-items: center;
63
+ border-color: ${(props: any) => props.theme.colors.textGray};
64
+ border-bottom-width: ${(props: any) => props.isSelected ? '1px' : '0px'};
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
+ export const SlaSettingModalContent = styled.View``
94
+
95
+ export const DeliveryStatusWrapper = styled.View`
96
+ position: relative;
97
+ `
98
+ export const VerticalLine = styled.View`
99
+ position: absolute;
100
+ background: #E9ECEF;
101
+ position: absolute;
102
+ width: 1px;
103
+ height: 100%;
104
+ top: 7px;
105
+ left: 7px;
106
+ `
107
+
108
+ export const Actions = styled.View``
109
+
110
+ export const Sides = styled.View`
111
+ flex-direction: row;
112
+ height: 100%;
113
+ `
114
+
115
+ export const LeftSide = styled.View`
116
+ width: 30%;
117
+ `
118
+
119
+ export const RightSide = styled.View`
120
+ width: 70%;
121
+ border-width: 2px;
122
+ border-color: ${(props: any) => props.theme.colors.gray100};
123
+ `
@@ -0,0 +1,216 @@
1
+ import React, { useState, useEffect } from 'react'
2
+ import { StyleSheet, Pressable } from 'react-native'
3
+ import { useLanguage, useUtils, useConfig } from 'ordering-components/native'
4
+ import styled, { useTheme } from 'styled-components/native'
5
+
6
+ import { OText, OIcon } from '../shared';
7
+
8
+ export const useOrderUtils = () => {
9
+ const theme = useTheme();
10
+ const [, t] = useLanguage();
11
+ const [{ parseDate }] = useUtils()
12
+
13
+ const calculateDate = (type: any, from: any, to: any) => {
14
+ switch (type) {
15
+ case 'today':
16
+ const date = parseDate(new Date(), { outputFormat: 'MM/DD/YYYY' })
17
+ return { from: `${date} 00:00:00`, to: `${date} 23:59:59` }
18
+ case 'yesterday':
19
+ const yesterday = new Date()
20
+ yesterday.setDate(yesterday.getDate() - 1)
21
+ const start1 = parseDate(yesterday, { outputFormat: 'MM/DD/YYYY' })
22
+ const end1 = parseDate(new Date(), { outputFormat: 'MM/DD/YYYY' })
23
+ return { from: `${start1} 00:00:00`, to: `${end1} 23:59:59` }
24
+ case 'last_7days':
25
+ const last_7days = new Date()
26
+ last_7days.setDate(last_7days.getDate() - 6)
27
+ const start7 = parseDate(last_7days, { outputFormat: 'MM/DD/YYYY' })
28
+ const end7 = parseDate(new Date(), { outputFormat: 'MM/DD/YYYY' })
29
+ return { from: `${start7} 00:00:00`, to: `${end7} 23:59:59` }
30
+ case 'last_30days':
31
+ const last_30days = new Date()
32
+ last_30days.setDate(last_30days.getDate() - 29)
33
+ const start30 = parseDate(last_30days, { outputFormat: 'MM/DD/YYYY' })
34
+ const end30 = parseDate(new Date(), { outputFormat: 'MM/DD/YYYY' })
35
+ return { from: `${start30} 00:00:00`, to: `${end30} 23:59:59` }
36
+ default:
37
+ const start = from ? `${parseDate(from, { outputFormat: 'MM/DD/YYYY' })} 00:00:00` : ''
38
+ const end = to ? `${parseDate(to, { outputFormat: 'MM/DD/YYYY' })} 23:59:59` : ''
39
+ return { from: start, to: end }
40
+ }
41
+ }
42
+
43
+ const preorderTypeList = [
44
+ { key: null, name: t('SLA', 'SLA\'s') },
45
+ { key: 'in_time', name: t('OK', 'Ok') },
46
+ { key: 'at_risk', name: t('AT_RISK', 'At Risk') },
47
+ { key: 'delayed', name: t('DELAYED', 'Delayed') }
48
+ ]
49
+ const defaultOrderTypes = [
50
+ { key: 1, name: t('DELIVERY', 'Delivery') },
51
+ { key: 2, name: t('PICKUP', 'Pickup') },
52
+ { key: 3, name: t('EAT_IN', 'Eat in') },
53
+ { key: 4, name: t('CURBSIDE', 'Curbside') },
54
+ { key: 5, name: t('DRIVE_THRU', 'Drive thru') }
55
+ ]
56
+
57
+ const deliveryStatus = [
58
+ {
59
+ key: t('OK', 'Ok'),
60
+ des: t('DELIVERY_OK_STATUS_DESC', 'Get delivery time from the businesses.'),
61
+ timmer: false,
62
+ icon: theme.images.general?.clock1,
63
+ backColor: '#00D27A'
64
+ },
65
+ {
66
+ key: t('AT_RISK', 'At risk'),
67
+ des: t('DELIVERY_ATRISK_STATUS_DESC', 'Is the time between delivery time of busines and the delayed time.'),
68
+ timmer: false,
69
+ icon: theme.images.general?.clockRisk,
70
+ backColor: '#FFC700'
71
+ },
72
+ {
73
+ key: t('DELAYED', 'Delayed'),
74
+ des: t('DELIVERY_DELAYED_STATUS_DESC', 'If this time is exceeded, the order will be delayed.'),
75
+ timmer: true,
76
+ icon: theme.images.general?.clockDelayed,
77
+ backColor: '#E63757'
78
+ }
79
+ ]
80
+
81
+ const defaultSearchList = {
82
+ id: '',
83
+ state: '',
84
+ city: '',
85
+ business: '',
86
+ delivery_type: '',
87
+ paymethod: '',
88
+ driver: '',
89
+ timeStatus: '',
90
+ date: {
91
+ from: '',
92
+ to: '',
93
+ type: ''
94
+ }
95
+ }
96
+
97
+ const constants = {
98
+ preorderTypeList,
99
+ defaultOrderTypes,
100
+ deliveryStatus,
101
+ defaultSearchList,
102
+ calculateDate
103
+ }
104
+
105
+ return [constants];
106
+ }
107
+
108
+ export const StatusBlock = (props: any) => {
109
+ const { item, last } = props
110
+ const [showTime, setShowTime] = useState(false)
111
+
112
+ useEffect(() => {
113
+ if (last) {
114
+ setShowTime(true)
115
+ }
116
+ }, [last])
117
+
118
+ const StatusItems = styled.View`
119
+ position: relative;
120
+ margin-bottom: 20px;
121
+ z-index: 2;
122
+ `
123
+ const ItemHeader = styled.View`
124
+ flex-direction: row;
125
+ margin-bottom: 5px;
126
+ `
127
+
128
+ const IconWrapper = styled.View`
129
+ flex-direction: row;
130
+ align-items: center;
131
+ background: #fff;
132
+ `
133
+
134
+ const ItemStatus = styled.View`
135
+ width: 4px;
136
+ height: 22px;
137
+ margin: 0 15px;
138
+ border-radius: 4px;
139
+ background: ${(props: any) => props.backColor};
140
+ `
141
+
142
+ const ItemContent = styled.View`
143
+ display: flex;
144
+ padding: 0 30px;
145
+ `
146
+
147
+ const OverLine = styled.View`
148
+ position: absolute;
149
+ height: 100%;
150
+ width: 15px;
151
+ top: 20px;
152
+ left: 0;
153
+ background-color: #fff;
154
+ z-index: 2;
155
+ `
156
+
157
+ return (
158
+ <StatusItems>
159
+ <Pressable style={{ marginBottom: 10 }}>
160
+ <ItemHeader>
161
+ <IconWrapper>
162
+ <OIcon
163
+ src={item?.icon}
164
+ width={16}
165
+ height={16}
166
+ color={item?.backColor}
167
+ />
168
+ </IconWrapper>
169
+ <ItemStatus backColor={item?.backColor} />
170
+ <OText>{item?.key}</OText>
171
+ </ItemHeader>
172
+ </Pressable>
173
+ <ItemContent>
174
+ <OText>{item?.des}</OText>
175
+ </ItemContent>
176
+ {showTime && ( <Timer /> )}
177
+ {last && ( <OverLine /> )}
178
+ </StatusItems>
179
+ )
180
+ }
181
+
182
+ export const Timer = () => {
183
+ const [, t] = useLanguage()
184
+ const theme = useTheme()
185
+ const [{ configs }] = useConfig();
186
+
187
+ const styles = StyleSheet.create({
188
+ settingTime: {
189
+ fontSize: 14,
190
+ borderWidth: 1,
191
+ borderRadius: 7.6,
192
+ margin: 0,
193
+ marginRight: 10,
194
+ paddingHorizontal: 10,
195
+ paddingTop: 5,
196
+ borderColor: theme.colors.disabled
197
+ }
198
+ })
199
+
200
+ const TimerInputWrapper = styled.View`
201
+ color: ${(props: any) => props.theme.colors.disabled};
202
+ margin-top: 15px;
203
+ margin-left: 30px;
204
+ margin-right: 30px;
205
+ flex-direction: row;
206
+ align-items: flex-end;
207
+ `
208
+
209
+ return (
210
+ <TimerInputWrapper>
211
+ <OText style={styles.settingTime} color={theme.colors.disabled}>{configs?.order_deadlines_delayed_time?.value}</OText>
212
+ <OText>{t('MIN', 'min')}</OText>
213
+ </TimerInputWrapper>
214
+ )
215
+ }
216
+
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState, useRef } from 'react';
2
2
  import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Linking, Platform, TextInput } from 'react-native';
3
- import { useLanguage, useUtils, useToast, ToastType, OrderListGroups } from 'ordering-components/native';
3
+ import { useLanguage, useUtils, useToast, ToastType, OrderListGroups, useConfig } from 'ordering-components/native';
4
4
  import SelectDropdown from 'react-native-select-dropdown'
5
5
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
6
6
  import FeatherIcon from 'react-native-vector-icons/Feather';
@@ -400,20 +400,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
400
400
  setOpenSLASettingModal(false)
401
401
  }
402
402
 
403
- const [settingTimeErrorMessage, setSettingTimeErrorMessage] = useState('')
404
-
405
- const handlSLASettingTime = () => {
406
- if (!hour || !minute) {
407
- setSettingTimeErrorMessage(t('SLA_SETTING_ERROR', 'Time value is invalid'))
408
- return
409
- }
410
- const _settingTimeSecond = hour * 3600 + minute * 60
411
- setSlaSettingTime(_settingTimeSecond)
412
- handleClose()
413
- showToast(ToastType.Success, t('SLA_SETTING_UPDATED', 'SLAs setting updated'))
414
- }
415
-
416
-
417
403
  useEffect(() => {
418
404
  setCurrentFilters(null)
419
405
  onFiltered && onFiltered(null)
@@ -555,7 +541,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
555
541
  </TabsContainer>
556
542
  </ScrollView>
557
543
  </FiltersTab>
558
- <View style={{ flex: 1, minHeight: HEIGHT_SCREEN - 250 }}>
544
+ <View style={{ flex: 1, minHeight: HEIGHT_SCREEN - 450 }}>
559
545
  {currentTabSelected !== 'logisticOrders' && (
560
546
  <View
561
547
  style={{
@@ -645,6 +631,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
645
631
  getOrderStatus={getOrderStatus}
646
632
  handleClickOrder={handleClickOrder}
647
633
  slaSettingTime={slaSettingTime}
634
+ currentTabSelected={currentTabSelected}
648
635
  />
649
636
  )}
650
637
  {!logisticOrders?.error?.length &&
@@ -859,24 +846,10 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
859
846
  key={i}
860
847
  item={item}
861
848
  last={i + 1 === selectedTabStatus.length}
862
- setHour={setHour}
863
- setMinute={setMinute}
864
- setSettingTimeErrorMessage={setSettingTimeErrorMessage}
865
849
  />
866
850
  ))}
867
851
  <VerticalLine />
868
852
  </DeliveryStatusWrapper>
869
- {settingTimeErrorMessage !== '' && (
870
- <OText style={styles.errorMessage}>{settingTimeErrorMessage}</OText>
871
- )}
872
- <Actions>
873
- <OButton
874
- text={t('ACCEPT', 'Accept')}
875
- textStyle={{ color: 'white', fontSize: 14 }}
876
- onClick={handlSLASettingTime}
877
- style={styles.acceptButtonStyle}
878
- />
879
- </Actions>
880
853
  </SlaSettingModalContent>
881
854
  )}
882
855
  </ModalContainer>
@@ -887,7 +860,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
887
860
  };
888
861
 
889
862
  export const StatusBlock = (props: any) => {
890
- const { item, last, setHour, setMinute, setSettingTimeErrorMessage } = props
863
+ const { item, last } = props
891
864
  const [showTime, setShowTime] = useState(false)
892
865
 
893
866
  useEffect(() => {
@@ -898,7 +871,7 @@ export const StatusBlock = (props: any) => {
898
871
 
899
872
  return (
900
873
  <StatusItems>
901
- <Pressable onPress={() => setShowTime(!showTime)} style={{ marginBottom: 5 }}>
874
+ <Pressable style={{ marginBottom: 10 }}>
902
875
  <ItemHeader>
903
876
  <IconWrapper>
904
877
  <OIcon
@@ -916,11 +889,7 @@ export const StatusBlock = (props: any) => {
916
889
  <OText>{item?.des}</OText>
917
890
  </ItemContent>
918
891
  {showTime && (
919
- <Timer
920
- setHour={setHour}
921
- setMinute={setMinute}
922
- setSettingTimeErrorMessage={setSettingTimeErrorMessage}
923
- />
892
+ <Timer />
924
893
  )}
925
894
  {last && (
926
895
  <OverLine />
@@ -929,47 +898,28 @@ export const StatusBlock = (props: any) => {
929
898
  )
930
899
  }
931
900
 
932
- export const Timer = (props: any) => {
933
- const { setHour, setMinute, setSettingTimeErrorMessage } = props
901
+ export const Timer = () => {
934
902
  const [, t] = useLanguage()
935
903
  const theme = useTheme()
904
+ const [{ configs }] = useConfig();
936
905
 
937
906
  const styles = StyleSheet.create({
938
- inputStyle: {
939
- paddingHorizontal: 7,
940
- paddingVertical: 2,
941
- borderRadius: 0,
907
+ settingTime: {
942
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
943
916
  }
944
917
  })
945
918
 
946
- const handleChangeInput = (val: any, type: string) => {
947
- setSettingTimeErrorMessage('')
948
- if (type === 'hour') {
949
- setHour(val)
950
- }
951
- if (type === 'minute') {
952
- setMinute(val)
953
- }
954
- }
955
-
956
919
  return (
957
920
  <TimerInputWrapper>
958
- <TextInput
959
- placeholder='HH'
960
- keyboardType='number-pad'
961
- maxLength={2}
962
- style={{ ...styles.inputStyle, width: 36 }}
963
- onChangeText={hour => handleChangeInput(hour, 'hour')}
964
- />
965
- <OText color={theme.colors.disabled}>:</OText>
966
- <TextInput
967
- placeholder='MM'
968
- keyboardType='number-pad'
969
- maxLength={2}
970
- style={{ ...styles.inputStyle, width: 40 }}
971
- onChangeText={minute => handleChangeInput(minute, 'minute')}
972
- />
921
+ <OText style={styles.settingTime} color={theme.colors.disabled}>{configs?.order_deadlines_delayed_time?.value}</OText>
922
+ <OText>{t('MIN', 'min')}</OText>
973
923
  </TimerInputWrapper>
974
924
  )
975
925
  }
@@ -130,15 +130,12 @@ export const ItemContent = styled.View`
130
130
  `
131
131
 
132
132
  export const TimerInputWrapper = styled.View`
133
- border-width: 1px;
134
- border-radius: 7.6px;
135
133
  color: ${(props: any) => props.theme.colors.disabled};
136
- border-color: ${(props: any) => props.theme.colors.disabled};
134
+ margin-top: 15px;
137
135
  margin-left: 30px;
138
136
  margin-right: 30px;
139
137
  flex-direction: row;
140
- align-items: center;
141
- width: 80px;
138
+ align-items: flex-end;
142
139
  `
143
140
  export const OverLine = styled.View`
144
141
  position: absolute;
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import { StyleSheet, TouchableOpacity, View } from 'react-native';
2
+ import { StyleSheet, TouchableOpacity, View, Platform, PlatformIOSStatic } from 'react-native';
3
3
  import { useTheme } from 'styled-components/native';
4
4
  import moment from 'moment'
5
5
  import { useLanguage, useUtils } from 'ordering-components/native';
@@ -8,6 +8,10 @@ import {
8
8
  Card, Logo, Information, MyOrderOptions, NotificationIcon, AcceptOrRejectOrder, Timestatus
9
9
  } from './styles';
10
10
  import EntypoIcon from 'react-native-vector-icons/Entypo'
11
+ import { DeviceOrientationMethods } from '../../../../../src/hooks/DeviceOrientation'
12
+ import DeviceInfo from 'react-native-device-info';
13
+
14
+ const { useDeviceOrientation, PORTRAIT } = DeviceOrientationMethods
11
15
 
12
16
  export const PreviousOrders = (props: any) => {
13
17
  const {
@@ -17,25 +21,38 @@ export const PreviousOrders = (props: any) => {
17
21
  handleClickOrder,
18
22
  isLogisticOrder,
19
23
  handleClickLogisticOrder,
20
- slaSettingTime
24
+ slaSettingTime,
25
+ currentTabSelected,
26
+ currentOrdenSelected
21
27
  } = props;
22
28
  const [, t] = useLanguage();
23
29
  const [{ parseDate, optimizeImage }] = useUtils();
24
30
  const theme = useTheme();
25
31
  const [currentTime, setCurrentTime] = useState()
32
+ const [orientationState] = useDeviceOrientation();
33
+
34
+ const IS_PORTRAIT = orientationState.orientation === PORTRAIT
35
+
36
+ const platformIOS = Platform as PlatformIOSStatic
37
+ const isIpad = platformIOS.isPad
38
+ const isTablet = DeviceInfo.isTablet();
26
39
 
27
40
  const handlePressOrder = (order: any) => {
28
41
  if (order?.locked && isLogisticOrder) return
29
42
  handleClickOrder && handleClickOrder(order)
30
- onNavigationRedirect &&
31
- onNavigationRedirect('OrderDetails', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
43
+ if (props.handleClickEvent) {
44
+ props.handleClickEvent({ ...order, isLogistic: isLogisticOrder })
45
+ } else {
46
+ onNavigationRedirect &&
47
+ onNavigationRedirect('OrderDetails', { order: { ...order, isLogistic: isLogisticOrder }, handleClickLogisticOrder });
48
+ }
32
49
  };
33
50
 
34
51
  const styles = StyleSheet.create({
35
52
  cardButton: {
36
53
  flex: 1,
37
- minHeight: isLogisticOrder ? 50 : 64,
38
- marginBottom: isLogisticOrder ? 0 : 30,
54
+ paddingVertical: (isIpad || isTablet) ? 20 : 0,
55
+ marginBottom: IS_PORTRAIT ? 25 : 0,
39
56
  marginLeft: 3,
40
57
  },
41
58
  icon: {
@@ -114,8 +131,9 @@ export const PreviousOrders = (props: any) => {
114
131
  return (
115
132
  <View
116
133
  style={{
117
- backgroundColor: order?.locked && isLogisticOrder ? '#ccc' : '#fff',
118
- marginBottom: isLogisticOrder ? 10 : 0
134
+ backgroundColor: currentOrdenSelected === order?.id ? theme.colors.gray100 : order?.locked && isLogisticOrder ? '#ccc' : '#fff',
135
+ marginBottom: isLogisticOrder ? 10 : 0,
136
+ // justifyContent: 'center'
119
137
  }}
120
138
  key={order.id}
121
139
  >
@@ -159,7 +177,7 @@ export const PreviousOrders = (props: any) => {
159
177
  />
160
178
  </NotificationIcon>
161
179
  )}
162
- <View style={{ flexDirection: 'row' }}>
180
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap' }}>
163
181
  <OText
164
182
  style={styles.date}
165
183
  color={theme.colors.unselectText}
@@ -169,9 +187,14 @@ export const PreviousOrders = (props: any) => {
169
187
  {(order?.order_group_id && order?.order_group && isLogisticOrder ? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}` : (t('NO', 'Order No.') + order.id)) + ' · '}
170
188
  {order?.delivery_datetime_utc
171
189
  ? parseDate(order?.delivery_datetime_utc, { outputFormat: 'MM/DD/YY · HH:mm a' })
172
- : parseDate(order?.delivery_datetime, { utc: false })}{' · '}
190
+ : parseDate(order?.delivery_datetime, { utc: false })}
173
191
  </OText>
174
- <OText style={styles.date} color={order?.time_status === 'in_time' ? '#00D27A' : order?.time_status === 'at_risk' ? '#FFC700' : order?.time_status === 'delayed' ? '#E63757' : ''} >{getDelayTime(order)}</OText>
192
+ {(currentTabSelected === 'pending' || currentTabSelected === 'inProgress') && (
193
+ <>
194
+ <OText> · </OText>
195
+ <OText style={styles.date} color={order?.time_status === 'in_time' ? '#00D27A' : order?.time_status === 'at_risk' ? '#FFC700' : order?.time_status === 'delayed' ? '#E63757' : ''} >{getDelayTime(order)}</OText>
196
+ </>
197
+ )}
175
198
  </View>
176
199
  {!isLogisticOrder && (
177
200
  <MyOrderOptions>
@@ -38,7 +38,6 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
38
38
  reviewState,
39
39
  setReviewState,
40
40
  actionState,
41
- handleChangeQualification,
42
41
  handleSendCustomerReview
43
42
  } = props
44
43
 
@@ -105,6 +104,11 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
105
104
 
106
105
  const commentsList = reviewCommentList('customer')
107
106
 
107
+ const handleChangeQualification = (index: any) => {
108
+ if (index) setReviewState({ ...reviewState, qualification: index, comment: '' })
109
+ setComments([])
110
+ }
111
+
108
112
  const isSelectedComment = (commentKey: number) => {
109
113
  const found = comments.find((comment: any) => comment?.key === commentKey)
110
114
  return found
@@ -575,3 +575,7 @@ export interface ReviewCustomerParams {
575
575
  handleChangeQualification?: any,
576
576
  handleSendCustomerReview?: any,
577
577
  }
578
+
579
+ export interface NoNetworkParams {
580
+ image?: any;
581
+ }
@@ -197,7 +197,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
197
197
  {isFarAway && (
198
198
  <FarAwayMessage style={styles.farAwayMsg}>
199
199
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
200
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
200
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
201
201
  </FarAwayMessage>
202
202
  )}
203
203
  {!auth && (
@@ -410,8 +410,7 @@ const LoginFormUI = (props: LoginParams) => {
410
410
  textInputProps={{
411
411
  returnKeyType: 'next',
412
412
  onSubmitEditing: () => inputRef?.current?.focus?.(),
413
- style: { borderWidth: 0, fontSize: 12 },
414
- maxLength: 10
413
+ style: { borderWidth: 0, fontSize: 12 }
415
414
  }}
416
415
  textWrapStyle={{ borderColor: theme.colors.clear, borderWidth: 0, height: 40, paddingStart: 0 }}
417
416
  />
@@ -155,7 +155,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
155
155
  {isFarAway && (
156
156
  <FarAwayMessage style={styles.farAwayMsg}>
157
157
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
158
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
158
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
159
159
  </FarAwayMessage>
160
160
  )}
161
161
  <View style={styles.wrapperOrderOptions}>