ordering-ui-react-native 0.12.57 → 0.12.61

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 (182) hide show
  1. package/package.json +1 -1
  2. package/src/components/AppleLogin/index.tsx +14 -8
  3. package/themes/doordash/src/components/Cart/index.tsx +1 -0
  4. package/themes/doordash/src/components/LastOrders/index.tsx +1 -1
  5. package/themes/doordash/src/components/OrderSummary/index.tsx +1 -0
  6. package/themes/instacart/src/components/OrderDetails/index.tsx +2 -2
  7. package/themes/single-business/src/components/Cart/index.tsx +127 -16
  8. package/themes/single-business/src/components/Cart/styles.tsx +39 -0
  9. package/themes/single-business/src/components/CartContent/index.tsx +56 -52
  10. package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
  11. package/themes/single-business/src/components/OrderDetails/index.tsx +724 -708
  12. package/themes/single-business/src/components/OrderSummary/index.tsx +189 -154
  13. package/themes/franchises/index.tsx +0 -111
  14. package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
  15. package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
  16. package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
  17. package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
  18. package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
  19. package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
  20. package/themes/franchises/src/components/AddressList/index.tsx +0 -338
  21. package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
  22. package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
  23. package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
  24. package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
  25. package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
  26. package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
  27. package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
  28. package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
  29. package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
  30. package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
  31. package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
  32. package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
  33. package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
  34. package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
  35. package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
  36. package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
  37. package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
  38. package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
  39. package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
  40. package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
  41. package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
  42. package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
  43. package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
  44. package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
  45. package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
  46. package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
  47. package/themes/franchises/src/components/Cart/index.tsx +0 -332
  48. package/themes/franchises/src/components/Cart/styles.tsx +0 -28
  49. package/themes/franchises/src/components/CartContent/index.tsx +0 -60
  50. package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
  51. package/themes/franchises/src/components/Checkout/index.tsx +0 -664
  52. package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
  53. package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
  54. package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
  55. package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
  56. package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
  57. package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
  58. package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
  59. package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
  60. package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
  61. package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
  62. package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
  63. package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
  64. package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
  65. package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
  66. package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
  67. package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
  68. package/themes/franchises/src/components/Help/index.tsx +0 -56
  69. package/themes/franchises/src/components/Help/styles.tsx +0 -11
  70. package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
  71. package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
  72. package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
  73. package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
  74. package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
  75. package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
  76. package/themes/franchises/src/components/Home/index.tsx +0 -102
  77. package/themes/franchises/src/components/Home/styles.tsx +0 -18
  78. package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
  79. package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
  80. package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
  81. package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
  82. package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
  83. package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
  84. package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
  85. package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
  86. package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
  87. package/themes/franchises/src/components/Messages/index.tsx +0 -359
  88. package/themes/franchises/src/components/Messages/styles.tsx +0 -20
  89. package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
  90. package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
  91. package/themes/franchises/src/components/NavBar/index.tsx +0 -129
  92. package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
  93. package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
  94. package/themes/franchises/src/components/Notifications/index.tsx +0 -120
  95. package/themes/franchises/src/components/Notifications/styles.ts +0 -21
  96. package/themes/franchises/src/components/OrderDetails/index.tsx +0 -828
  97. package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
  98. package/themes/franchises/src/components/OrderSummary/index.tsx +0 -266
  99. package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
  100. package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
  101. package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
  102. package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
  103. package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
  104. package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
  105. package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
  106. package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
  107. package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
  108. package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
  109. package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
  110. package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
  111. package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
  112. package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
  113. package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
  114. package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
  115. package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
  116. package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
  117. package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
  118. package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
  119. package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
  120. package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
  121. package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
  122. package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
  123. package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
  124. package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
  125. package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
  126. package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
  127. package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
  128. package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
  129. package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
  130. package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
  131. package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
  132. package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
  133. package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
  134. package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
  135. package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
  136. package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
  137. package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
  138. package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
  139. package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
  140. package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
  141. package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
  142. package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
  143. package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
  144. package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
  145. package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
  146. package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
  147. package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
  148. package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
  149. package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
  150. package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
  151. package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
  152. package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
  153. package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
  154. package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
  155. package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
  156. package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
  157. package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
  158. package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
  159. package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
  160. package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
  161. package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
  162. package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
  163. package/themes/franchises/src/components/shared/OButton.tsx +0 -132
  164. package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
  165. package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
  166. package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
  167. package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
  168. package/themes/franchises/src/components/shared/OInput.tsx +0 -113
  169. package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
  170. package/themes/franchises/src/components/shared/OModal.tsx +0 -172
  171. package/themes/franchises/src/components/shared/OText.tsx +0 -52
  172. package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
  173. package/themes/franchises/src/components/shared/OToast.tsx +0 -93
  174. package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
  175. package/themes/franchises/src/components/shared/index.tsx +0 -29
  176. package/themes/franchises/src/config/constants.tsx +0 -57
  177. package/themes/franchises/src/layouts/Container.tsx +0 -23
  178. package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
  179. package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
  180. package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
  181. package/themes/franchises/src/types/index.tsx +0 -445
  182. package/themes/franchises/src/utils/index.tsx +0 -222
@@ -4,37 +4,37 @@ import Spinner from 'react-native-loading-spinner-overlay';
4
4
  import LinearGradient from 'react-native-linear-gradient';
5
5
  import { Messages } from '../Messages';
6
6
  import {
7
- useLanguage,
8
- OrderDetails as OrderDetailsConTableoller,
9
- useUtils,
10
- useConfig,
11
- useSession,
7
+ useLanguage,
8
+ OrderDetails as OrderDetailsConTableoller,
9
+ useUtils,
10
+ useConfig,
11
+ useSession,
12
12
  } from 'ordering-components/native';
13
13
  import { useTheme } from 'styled-components/native';
14
14
  import {
15
- OrderDetailsContainer,
16
- Header,
17
- OrderContent,
18
- OrderBusiness,
19
- Logo,
20
- OrderData,
21
- OrderInfo,
22
- OrderStatus,
23
- StaturBar,
24
- StatusImage,
25
- OrderCustomer,
26
- CustomerPhoto,
27
- InfoBlock,
28
- HeaderInfo,
29
- Customer,
30
- OrderProducts,
31
- Table,
32
- OrderBill,
33
- Total,
34
- NavBack,
35
- Icons,
36
- OrderDriver,
37
- Map,
15
+ OrderDetailsContainer,
16
+ Header,
17
+ OrderContent,
18
+ OrderBusiness,
19
+ Logo,
20
+ OrderData,
21
+ OrderInfo,
22
+ OrderStatus,
23
+ StaturBar,
24
+ StatusImage,
25
+ OrderCustomer,
26
+ CustomerPhoto,
27
+ InfoBlock,
28
+ HeaderInfo,
29
+ Customer,
30
+ OrderProducts,
31
+ Table,
32
+ OrderBill,
33
+ Total,
34
+ NavBack,
35
+ Icons,
36
+ OrderDriver,
37
+ Map,
38
38
  } from './styles';
39
39
  import { OButton, OIcon, OModal, OText, OLink } from '../shared';
40
40
  import { ProductItemAccordion } from '../ProductItemAccordion';
@@ -49,288 +49,288 @@ import { TaxInformation } from '../TaxInformation';
49
49
  import AntIcon from 'react-native-vector-icons/AntDesign'
50
50
 
51
51
  export const OrderDetailsUI = (props: OrderDetailsParams) => {
52
- const {
53
- navigation,
54
- messages,
55
- setMessages,
56
- readMessages,
57
- messagesReadList,
58
- isFromCheckout,
59
- driverLocation,
52
+ const {
53
+ navigation,
54
+ messages,
55
+ setMessages,
56
+ readMessages,
57
+ messagesReadList,
58
+ isFromCheckout,
59
+ driverLocation,
60
60
  onNavigationRedirect
61
- } = props;
61
+ } = props;
62
62
 
63
- const theme = useTheme();
63
+ const theme = useTheme();
64
64
 
65
- const styles = StyleSheet.create({
66
- rowDirection: {
67
- flexDirection: 'row',
68
- },
69
- statusBar: {
70
- height: 12,
71
- },
72
- logo: {
73
- width: 75,
74
- height: 75,
75
- borderRadius: 10,
76
- },
77
- textBold: {
78
- fontWeight: 'bold',
79
- },
80
- btnBackArrow: {
81
- borderWidth: 0,
82
- backgroundColor: theme.colors.clear,
83
- borderColor: theme.colors.clear,
84
- shadowColor: theme.colors.clear,
85
- alignItems: 'flex-start',
86
- justifyContent: 'flex-start',
87
- paddingLeft: 0,
88
- height: 30,
89
- width: 40,
90
- },
91
- });
65
+ const styles = StyleSheet.create({
66
+ rowDirection: {
67
+ flexDirection: 'row',
68
+ },
69
+ statusBar: {
70
+ height: 12,
71
+ },
72
+ logo: {
73
+ width: 75,
74
+ height: 75,
75
+ borderRadius: 10,
76
+ },
77
+ textBold: {
78
+ fontWeight: 'bold',
79
+ },
80
+ btnBackArrow: {
81
+ borderWidth: 0,
82
+ backgroundColor: theme.colors.clear,
83
+ borderColor: theme.colors.clear,
84
+ shadowColor: theme.colors.clear,
85
+ alignItems: 'flex-start',
86
+ justifyContent: 'flex-start',
87
+ paddingLeft: 0,
88
+ height: 30,
89
+ width: 40,
90
+ },
91
+ });
92
92
 
93
- const [, t] = useLanguage();
94
- const [{ parsePrice, parseNumber, parseDate }] = useUtils();
95
- const [{ user }] = useSession();
96
- const [{ configs }] = useConfig();
93
+ const [, t] = useLanguage();
94
+ const [{ parsePrice, parseNumber, parseDate }] = useUtils();
95
+ const [{ user }] = useSession();
96
+ const [{ configs }] = useConfig();
97
97
 
98
- const [openModalForBusiness, setOpenModalForBusiness] = useState(false);
99
- const [openModalForDriver, setOpenModalForDriver] = useState(false);
98
+ const [openModalForBusiness, setOpenModalForBusiness] = useState(false);
99
+ const [openModalForDriver, setOpenModalForDriver] = useState(false);
100
100
  const [isReviewed, setIsReviewed] = useState(false)
101
- const [unreadAlert, setUnreadAlert] = useState({
102
- business: false,
103
- driver: false,
104
- });
101
+ const [unreadAlert, setUnreadAlert] = useState({
102
+ business: false,
103
+ driver: false,
104
+ });
105
105
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, data: null })
106
106
 
107
- const { order, businessData } = props.order;
107
+ const { order, businessData } = props.order;
108
108
 
109
- const getOrderStatus = (s: string) => {
110
- const status = parseInt(s);
111
- const orderStatus = [
112
- {
113
- key: 0,
114
- value: t('PENDING', 'Pending'),
115
- slug: 'PENDING',
116
- percentage: 0.25,
117
- image: theme.images.order.status0,
118
- },
119
- {
120
- key: 1,
121
- value: t('COMPLETED', 'Completed'),
122
- slug: 'COMPLETED',
123
- percentage: 1,
124
- image: theme.images.order.status1,
125
- },
126
- {
127
- key: 2,
128
- value: t('REJECTED', 'Rejected'),
129
- slug: 'REJECTED',
130
- percentage: 0,
131
- image: theme.images.order.status2,
132
- },
133
- {
134
- key: 3,
135
- value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
136
- slug: 'DRIVER_IN_BUSINESS',
137
- percentage: 0.6,
138
- image: theme.images.order.status3,
139
- },
140
- {
141
- key: 4,
142
- value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
143
- slug: 'PREPARATION_COMPLETED',
144
- percentage: 0.7,
145
- image: theme.images.order.status4,
146
- },
147
- {
148
- key: 5,
149
- value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
150
- slug: 'REJECTED_BY_BUSINESS',
151
- percentage: 0,
152
- image: theme.images.order.status5,
153
- },
154
- {
155
- key: 6,
156
- value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
157
- slug: 'REJECTED_BY_DRIVER',
158
- percentage: 0,
159
- image: theme.images.order.status6,
160
- },
161
- {
162
- key: 7,
163
- value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
164
- slug: 'ACCEPTED_BY_BUSINESS',
165
- percentage: 0.35,
166
- image: theme.images.order.status7,
167
- },
168
- {
169
- key: 8,
170
- value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
171
- slug: 'ACCEPTED_BY_DRIVER',
172
- percentage: 0.45,
173
- image: theme.images.order.status8,
174
- },
175
- {
176
- key: 9,
177
- value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
178
- slug: 'PICK_UP_COMPLETED_BY_DRIVER',
179
- percentage: 0.8,
180
- image: theme.images.order.status9,
181
- },
182
- {
183
- key: 10,
184
- value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
185
- slug: 'PICK_UP_FAILED_BY_DRIVER',
186
- percentage: 0,
187
- image: theme.images.order.status10,
188
- },
189
- {
190
- key: 11,
191
- value: t(
192
- 'DELIVERY_COMPLETED_BY_DRIVER',
193
- 'Delivery completed by driver',
194
- ),
195
- slug: 'DELIVERY_COMPLETED_BY_DRIVER',
196
- percentage: 1,
197
- image: theme.images.order.status11,
198
- },
199
- {
200
- key: 12,
201
- value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
202
- slug: 'DELIVERY_FAILED_BY_DRIVER',
203
- percentage: 0,
204
- image: theme.images.order.status12,
205
- },
206
- {
207
- key: 13,
208
- value: t('PREORDER', 'PreOrder'),
209
- slug: 'PREORDER',
210
- percentage: 0,
211
- image: theme.images.order.status13,
212
- },
213
- {
214
- key: 14,
215
- value: t('ORDER_NOT_READY', 'Order not ready'),
216
- slug: 'ORDER_NOT_READY',
217
- percentage: 0,
218
- image: theme.images.order.status13,
219
- },
220
- {
221
- key: 15,
222
- value: t(
223
- 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
224
- 'Order picked up completed by customer',
225
- ),
226
- slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
227
- percentage: 100,
228
- image: theme.images.order.status1,
229
- },
230
- {
231
- key: 16,
232
- value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
233
- slug: 'CANCELLED_BY_CUSTOMER',
234
- percentage: 0,
235
- image: theme.images.order.status2,
236
- },
237
- {
238
- key: 17,
239
- value: t(
240
- 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
241
- 'Order not picked up by customer',
242
- ),
243
- slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
244
- percentage: 0,
245
- image: theme.images.order.status2,
246
- },
247
- {
248
- key: 18,
249
- value: t(
250
- 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
251
- 'Driver almost arrived to business',
252
- ),
253
- slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
254
- percentage: 0.15,
255
- image: theme.images.order.status3,
256
- },
257
- {
258
- key: 19,
259
- value: t(
260
- 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
261
- 'Driver almost arrived to customer',
262
- ),
263
- slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
264
- percentage: 0.9,
265
- image: theme.images.order.status11,
266
- },
267
- {
268
- key: 20,
269
- value: t(
270
- 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
271
- 'Customer almost arrived to business',
272
- ),
273
- slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
274
- percentage: 90,
275
- image: theme.images.order.status7,
276
- },
277
- {
278
- key: 21,
279
- value: t(
280
- 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
281
- 'Customer arrived to business',
282
- ),
283
- slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
284
- percentage: 95,
285
- image: theme.images.order.status7,
286
- },
287
- ];
109
+ const getOrderStatus = (s: string) => {
110
+ const status = parseInt(s);
111
+ const orderStatus = [
112
+ {
113
+ key: 0,
114
+ value: t('PENDING', 'Pending'),
115
+ slug: 'PENDING',
116
+ percentage: 0.25,
117
+ image: theme.images.order.status0,
118
+ },
119
+ {
120
+ key: 1,
121
+ value: t('COMPLETED', 'Completed'),
122
+ slug: 'COMPLETED',
123
+ percentage: 1,
124
+ image: theme.images.order.status1,
125
+ },
126
+ {
127
+ key: 2,
128
+ value: t('REJECTED', 'Rejected'),
129
+ slug: 'REJECTED',
130
+ percentage: 0,
131
+ image: theme.images.order.status2,
132
+ },
133
+ {
134
+ key: 3,
135
+ value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
136
+ slug: 'DRIVER_IN_BUSINESS',
137
+ percentage: 0.6,
138
+ image: theme.images.order.status3,
139
+ },
140
+ {
141
+ key: 4,
142
+ value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
143
+ slug: 'PREPARATION_COMPLETED',
144
+ percentage: 0.7,
145
+ image: theme.images.order.status4,
146
+ },
147
+ {
148
+ key: 5,
149
+ value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
150
+ slug: 'REJECTED_BY_BUSINESS',
151
+ percentage: 0,
152
+ image: theme.images.order.status5,
153
+ },
154
+ {
155
+ key: 6,
156
+ value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
157
+ slug: 'REJECTED_BY_DRIVER',
158
+ percentage: 0,
159
+ image: theme.images.order.status6,
160
+ },
161
+ {
162
+ key: 7,
163
+ value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
164
+ slug: 'ACCEPTED_BY_BUSINESS',
165
+ percentage: 0.35,
166
+ image: theme.images.order.status7,
167
+ },
168
+ {
169
+ key: 8,
170
+ value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
171
+ slug: 'ACCEPTED_BY_DRIVER',
172
+ percentage: 0.45,
173
+ image: theme.images.order.status8,
174
+ },
175
+ {
176
+ key: 9,
177
+ value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
178
+ slug: 'PICK_UP_COMPLETED_BY_DRIVER',
179
+ percentage: 0.8,
180
+ image: theme.images.order.status9,
181
+ },
182
+ {
183
+ key: 10,
184
+ value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
185
+ slug: 'PICK_UP_FAILED_BY_DRIVER',
186
+ percentage: 0,
187
+ image: theme.images.order.status10,
188
+ },
189
+ {
190
+ key: 11,
191
+ value: t(
192
+ 'DELIVERY_COMPLETED_BY_DRIVER',
193
+ 'Delivery completed by driver',
194
+ ),
195
+ slug: 'DELIVERY_COMPLETED_BY_DRIVER',
196
+ percentage: 1,
197
+ image: theme.images.order.status11,
198
+ },
199
+ {
200
+ key: 12,
201
+ value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
202
+ slug: 'DELIVERY_FAILED_BY_DRIVER',
203
+ percentage: 0,
204
+ image: theme.images.order.status12,
205
+ },
206
+ {
207
+ key: 13,
208
+ value: t('PREORDER', 'PreOrder'),
209
+ slug: 'PREORDER',
210
+ percentage: 0,
211
+ image: theme.images.order.status13,
212
+ },
213
+ {
214
+ key: 14,
215
+ value: t('ORDER_NOT_READY', 'Order not ready'),
216
+ slug: 'ORDER_NOT_READY',
217
+ percentage: 0,
218
+ image: theme.images.order.status13,
219
+ },
220
+ {
221
+ key: 15,
222
+ value: t(
223
+ 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
224
+ 'Order picked up completed by customer',
225
+ ),
226
+ slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
227
+ percentage: 100,
228
+ image: theme.images.order.status1,
229
+ },
230
+ {
231
+ key: 16,
232
+ value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
233
+ slug: 'CANCELLED_BY_CUSTOMER',
234
+ percentage: 0,
235
+ image: theme.images.order.status2,
236
+ },
237
+ {
238
+ key: 17,
239
+ value: t(
240
+ 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
241
+ 'Order not picked up by customer',
242
+ ),
243
+ slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
244
+ percentage: 0,
245
+ image: theme.images.order.status2,
246
+ },
247
+ {
248
+ key: 18,
249
+ value: t(
250
+ 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
251
+ 'Driver almost arrived to business',
252
+ ),
253
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
254
+ percentage: 0.15,
255
+ image: theme.images.order.status3,
256
+ },
257
+ {
258
+ key: 19,
259
+ value: t(
260
+ 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
261
+ 'Driver almost arrived to customer',
262
+ ),
263
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
264
+ percentage: 0.9,
265
+ image: theme.images.order.status11,
266
+ },
267
+ {
268
+ key: 20,
269
+ value: t(
270
+ 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
271
+ 'Customer almost arrived to business',
272
+ ),
273
+ slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
274
+ percentage: 90,
275
+ image: theme.images.order.status7,
276
+ },
277
+ {
278
+ key: 21,
279
+ value: t(
280
+ 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
281
+ 'Customer arrived to business',
282
+ ),
283
+ slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
284
+ percentage: 95,
285
+ image: theme.images.order.status7,
286
+ },
287
+ ];
288
288
 
289
- const objectStatus = orderStatus.find((o) => o.key === status);
289
+ const objectStatus = orderStatus.find((o) => o.key === status);
290
290
 
291
- return objectStatus && objectStatus;
292
- };
291
+ return objectStatus && objectStatus;
292
+ };
293
293
 
294
- const handleOpenMessagesForBusiness = () => {
295
- setOpenModalForBusiness(true);
296
- readMessages && readMessages();
297
- setUnreadAlert({ ...unreadAlert, business: false });
298
- };
294
+ const handleOpenMessagesForBusiness = () => {
295
+ setOpenModalForBusiness(true);
296
+ readMessages && readMessages();
297
+ setUnreadAlert({ ...unreadAlert, business: false });
298
+ };
299
299
 
300
- const handleOpenMessagesForDriver = () => {
301
- setOpenModalForDriver(true);
302
- readMessages && readMessages();
303
- setUnreadAlert({ ...unreadAlert, driver: false });
304
- };
300
+ const handleOpenMessagesForDriver = () => {
301
+ setOpenModalForDriver(true);
302
+ readMessages && readMessages();
303
+ setUnreadAlert({ ...unreadAlert, driver: false });
304
+ };
305
305
 
306
- const unreadMessages = () => {
307
- const length = messages?.messages.length;
308
- const unreadLength = order?.unread_count;
309
- const unreadedMessages = messages.messages.slice(
310
- length - unreadLength,
311
- length,
312
- );
313
- const business = unreadedMessages.some((message: any) =>
314
- message?.can_see?.includes(2),
315
- );
316
- const driver = unreadedMessages.some((message: any) =>
317
- message?.can_see?.includes(4),
318
- );
319
- setUnreadAlert({ business, driver });
320
- };
306
+ const unreadMessages = () => {
307
+ const length = messages?.messages.length;
308
+ const unreadLength = order?.unread_count;
309
+ const unreadedMessages = messages.messages.slice(
310
+ length - unreadLength,
311
+ length,
312
+ );
313
+ const business = unreadedMessages.some((message: any) =>
314
+ message?.can_see?.includes(2),
315
+ );
316
+ const driver = unreadedMessages.some((message: any) =>
317
+ message?.can_see?.includes(4),
318
+ );
319
+ setUnreadAlert({ business, driver });
320
+ };
321
321
 
322
- const handleCloseModal = () => {
323
- setOpenModalForBusiness(false);
324
- setOpenModalForDriver(false);
325
- };
322
+ const handleCloseModal = () => {
323
+ setOpenModalForBusiness(false);
324
+ setOpenModalForDriver(false);
325
+ };
326
326
 
327
- const handleArrowBack: any = () => {
328
- if (!isFromCheckout) {
329
- navigation?.canGoBack() && navigation.goBack();
330
- return;
331
- }
332
- navigation.navigate('BottomTab');
333
- };
327
+ const handleArrowBack: any = () => {
328
+ if (!isFromCheckout) {
329
+ navigation?.canGoBack() && navigation.goBack();
330
+ return;
331
+ }
332
+ navigation.navigate('BottomTab');
333
+ };
334
334
 
335
335
  const getIncludedTaxes = () => {
336
336
  if (order?.taxes?.length === 0) {
@@ -343,166 +343,166 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
343
343
  }
344
344
 
345
345
 
346
- useEffect(() => {
347
- BackHandler.addEventListener('hardwareBackPress', handleArrowBack);
348
- return () => {
349
- BackHandler.removeEventListener('hardwareBackPress', handleArrowBack);
350
- };
351
- }, []);
346
+ useEffect(() => {
347
+ BackHandler.addEventListener('hardwareBackPress', handleArrowBack);
348
+ return () => {
349
+ BackHandler.removeEventListener('hardwareBackPress', handleArrowBack);
350
+ };
351
+ }, []);
352
352
 
353
- useEffect(() => {
354
- if (messagesReadList?.length) {
355
- openModalForBusiness
356
- ? setUnreadAlert({ ...unreadAlert, business: false })
357
- : setUnreadAlert({ ...unreadAlert, driver: false });
358
- }
359
- }, [messagesReadList]);
353
+ useEffect(() => {
354
+ if (messagesReadList?.length) {
355
+ openModalForBusiness
356
+ ? setUnreadAlert({ ...unreadAlert, business: false })
357
+ : setUnreadAlert({ ...unreadAlert, driver: false });
358
+ }
359
+ }, [messagesReadList]);
360
360
 
361
- const locations = [
362
- {
363
- ...order?.driver?.location,
364
- title: t('DRIVER', 'Driver'),
365
- icon:
366
- order?.driver?.photo ||
367
- 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://www.freeiconspng.com/thumbs/driver-icon/driver-icon-14.png',
368
- },
369
- {
370
- ...order?.business?.location,
371
- title: order?.business?.name,
372
- icon: order?.business?.logo || theme.images.dummies.businessLogo,
373
- },
374
- {
375
- ...order?.customer?.location,
376
- title: t('YOUR_LOCATION', 'Your Location'),
377
- icon:
378
- order?.customer?.photo ||
379
- 'https://res.cloudinary.com/demo/image/upload/c_thumb,g_face,r_max/d_avatar.png/non_existing_id.png',
380
- },
381
- ];
361
+ const locations = [
362
+ {
363
+ ...order?.driver?.location,
364
+ title: t('DRIVER', 'Driver'),
365
+ icon:
366
+ order?.driver?.photo ||
367
+ 'https://res.cloudinary.com/demo/image/fetch/c_thumb,g_face,r_max/https://www.freeiconspng.com/thumbs/driver-icon/driver-icon-14.png',
368
+ },
369
+ {
370
+ ...order?.business?.location,
371
+ title: order?.business?.name,
372
+ icon: order?.business?.logo || theme.images.dummies.businessLogo,
373
+ },
374
+ {
375
+ ...order?.customer?.location,
376
+ title: t('YOUR_LOCATION', 'Your Location'),
377
+ icon:
378
+ order?.customer?.photo ||
379
+ 'https://res.cloudinary.com/demo/image/upload/c_thumb,g_face,r_max/d_avatar.png/non_existing_id.png',
380
+ },
381
+ ];
382
382
 
383
- useEffect(() => {
384
- if (driverLocation) {
385
- locations[0] = driverLocation;
386
- }
387
- }, [driverLocation]);
383
+ useEffect(() => {
384
+ if (driverLocation) {
385
+ locations[0] = driverLocation;
386
+ }
387
+ }, [driverLocation]);
388
388
 
389
- return (
390
- <OrderDetailsContainer keyboardShouldPersistTaps="handled">
391
- <Spinner visible={!order || Object.keys(order).length === 0} />
392
- {order && Object.keys(order).length > 0 && (
393
- <>
394
- <Header>
389
+ return (
390
+ <OrderDetailsContainer keyboardShouldPersistTaps="handled">
391
+ <Spinner visible={!order || Object.keys(order).length === 0} />
392
+ {order && Object.keys(order).length > 0 && (
393
+ <>
394
+ <Header>
395
395
  <NavBar
396
396
  style={{ paddingBottom: 0, marginLeft: -20, backgroundColor: 'transparent' }}
397
397
  btnStyle={{ backgroundColor: 'transparent' }}
398
398
  leftImageStyle={{ tintColor: theme.colors.textThird }}
399
399
  onActionLeft={() => handleArrowBack()}
400
400
  />
401
- <OrderInfo>
402
- <OrderData>
403
- <OText
404
- size={20}
405
- lineHeight={30}
406
- weight={'600'}
407
- color={theme.colors.textNormal}>
408
- {t('ORDER', 'Order')} #{order?.id}
409
- </OText>
410
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
411
- {order?.delivery_datetime_utc
412
- ? parseDate(order?.delivery_datetime_utc)
413
- : parseDate(order?.delivery_datetime, { utc: false })}
414
- </OText>
401
+ <OrderInfo>
402
+ <OrderData>
403
+ <OText
404
+ size={20}
405
+ lineHeight={30}
406
+ weight={'600'}
407
+ color={theme.colors.textNormal}>
408
+ {t('ORDER', 'Order')} #{order?.id}
409
+ </OText>
410
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
411
+ {order?.delivery_datetime_utc
412
+ ? parseDate(order?.delivery_datetime_utc)
413
+ : parseDate(order?.delivery_datetime, { utc: false })}
414
+ </OText>
415
415
  {(
416
416
  parseInt(order?.status, 10) === 1 ||
417
417
  parseInt(order?.status, 10) === 11 ||
418
418
  parseInt(order?.status, 10) === 15
419
419
  ) && !order.review && !isReviewed && (
420
- <TouchableOpacity
421
- activeOpacity={0.7}
422
- style={{ marginTop: 6 }}
423
- onPress={() => onNavigationRedirect('ReviewOrder', {
424
- order: {
425
- id: order?.id,
426
- business_id: order?.business_id,
427
- logo: order.business?.logo,
428
- driver: order?.driver,
429
- products: order?.products,
430
- review: order?.review,
431
- user_review: order?.user_review
432
- },
433
- setIsReviewed
434
- })}
435
- >
436
- <OText
437
- size={10}
438
- lineHeight={15}
439
- color={theme.colors.textSecondary}
440
- style={{ textDecorationLine: 'underline' }}>
441
- {t('REVIEW_ORDER', 'Review order')}
442
- </OText>
443
- </TouchableOpacity>
444
- )}
420
+ <TouchableOpacity
421
+ activeOpacity={0.7}
422
+ style={{ marginTop: 6 }}
423
+ onPress={() => onNavigationRedirect('ReviewOrder', {
424
+ order: {
425
+ id: order?.id,
426
+ business_id: order?.business_id,
427
+ logo: order.business?.logo,
428
+ driver: order?.driver,
429
+ products: order?.products,
430
+ review: order?.review,
431
+ user_review: order?.user_review
432
+ },
433
+ setIsReviewed
434
+ })}
435
+ >
436
+ <OText
437
+ size={10}
438
+ lineHeight={15}
439
+ color={theme.colors.textSecondary}
440
+ style={{ textDecorationLine: 'underline' }}>
441
+ {t('REVIEW_ORDER', 'Review order')}
442
+ </OText>
443
+ </TouchableOpacity>
444
+ )}
445
445
 
446
- <StaturBar>
447
- <LinearGradient
448
- start={{ x: 0.0, y: 0.0 }}
449
- end={{
450
- x: getOrderStatus(order?.status)?.percentage || 0,
451
- y: 0,
452
- }}
453
- locations={[0.9999, 0.9999]}
454
- colors={[theme.colors.primary, theme.colors.backgroundGray100]}
455
- style={styles.statusBar}
456
- />
457
- </StaturBar>
458
- <OText
459
- size={16}
460
- lineHeight={24}
461
- weight={'600'}
462
- color={theme.colors.textNormal}>
463
- {getOrderStatus(order?.status)?.value}
464
- </OText>
465
- </OrderData>
466
- <View
467
- style={{
468
- height: 8,
469
- backgroundColor: theme.colors.backgroundGray100,
470
- marginTop: 18,
471
- marginHorizontal: -40,
472
- }}
473
- />
474
- </OrderInfo>
475
- </Header>
476
- <OrderContent>
477
- <OrderBusiness>
478
- <OText
479
- size={16}
480
- lineHeight={24}
481
- weight={'500'}
482
- color={theme.colors.textNormal}
483
- mBottom={12}>
484
- {t('FROM', 'From')}
485
- </OText>
486
- <View
487
- style={{
488
- display: 'flex',
489
- flexDirection: 'column',
490
- alignItems: 'flex-start',
491
- }}>
492
- <View
493
- style={{
494
- flexDirection: 'row',
495
- alignItems: 'center',
496
- justifyContent: 'space-between',
497
- }}>
498
- <OText
499
- size={13}
500
- lineHeight={20}
501
- color={theme.colors.textNormal}
502
- style={{ flexGrow: 1, flexBasis: '80%' }}>
503
- {order?.business?.name}
504
- </OText>
505
- <Icons>
446
+ <StaturBar>
447
+ <LinearGradient
448
+ start={{ x: 0.0, y: 0.0 }}
449
+ end={{
450
+ x: getOrderStatus(order?.status)?.percentage || 0,
451
+ y: 0,
452
+ }}
453
+ locations={[0.9999, 0.9999]}
454
+ colors={[theme.colors.primary, theme.colors.backgroundGray100]}
455
+ style={styles.statusBar}
456
+ />
457
+ </StaturBar>
458
+ <OText
459
+ size={16}
460
+ lineHeight={24}
461
+ weight={'600'}
462
+ color={theme.colors.textNormal}>
463
+ {getOrderStatus(order?.status)?.value}
464
+ </OText>
465
+ </OrderData>
466
+ <View
467
+ style={{
468
+ height: 8,
469
+ backgroundColor: theme.colors.backgroundGray100,
470
+ marginTop: 18,
471
+ marginHorizontal: -40,
472
+ }}
473
+ />
474
+ </OrderInfo>
475
+ </Header>
476
+ <OrderContent>
477
+ <OrderBusiness>
478
+ <OText
479
+ size={16}
480
+ lineHeight={24}
481
+ weight={'500'}
482
+ color={theme.colors.textNormal}
483
+ mBottom={12}>
484
+ {t('FROM', 'From')}
485
+ </OText>
486
+ <View
487
+ style={{
488
+ display: 'flex',
489
+ flexDirection: 'column',
490
+ alignItems: 'flex-start',
491
+ }}>
492
+ <View
493
+ style={{
494
+ flexDirection: 'row',
495
+ alignItems: 'center',
496
+ justifyContent: 'space-between',
497
+ }}>
498
+ <OText
499
+ size={13}
500
+ lineHeight={20}
501
+ color={theme.colors.textNormal}
502
+ style={{ flexGrow: 1, flexBasis: '80%' }}>
503
+ {order?.business?.name}
504
+ </OText>
505
+ <Icons>
506
506
  {(!!order?.business?.cellphone || !!order?.business?.phone) && (
507
507
  <View style={{ paddingEnd: 5 }}>
508
508
  <OLink
@@ -516,206 +516,206 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
516
516
  </OLink>
517
517
  </View>
518
518
  )}
519
- <TouchableOpacity
520
- style={{ paddingStart: 5 }}
521
- onPress={() => handleOpenMessagesForBusiness()}>
522
- <OIcon
523
- src={theme.images.general.chat}
524
- width={16}
525
- color={theme.colors.disabled}
526
- />
527
- </TouchableOpacity>
528
- </Icons>
529
- </View>
530
- <OText
531
- size={12}
532
- lineHeight={18}
533
- color={theme.colors.textNormal}
534
- mBottom={2}>
535
- {order?.business?.email}
536
- </OText>
537
- <OText
538
- size={12}
539
- lineHeight={18}
540
- color={theme.colors.textNormal}
541
- mBottom={2}>
542
- {order?.business?.cellphone}
543
- </OText>
544
- <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
545
- {order?.business?.address}
546
- </OText>
547
- </View>
548
- </OrderBusiness>
549
- <View
550
- style={{
551
- height: 8,
552
- backgroundColor: theme.colors.backgroundGray100,
553
- marginTop: 18,
554
- marginHorizontal: -40,
555
- }}
556
- />
557
- <OrderCustomer>
558
- <OText
559
- size={16}
560
- lineHeight={24}
561
- weight={'500'}
562
- color={theme.colors.textNormal}
563
- mBottom={12}>
564
- {t('TO', 'To')}
565
- </OText>
566
- <Customer>
567
- <InfoBlock>
568
- <OText
569
- size={12}
570
- lineHeight={18}
571
- color={theme.colors.textNormal}
572
- mBottom={2}>
573
- {order?.customer?.name} {order?.customer?.lastname}
574
- </OText>
575
- <OText
576
- size={12}
577
- lineHeight={18}
578
- color={theme.colors.textNormal}
579
- mBottom={2}>
580
- {order?.customer?.address}
581
- </OText>
582
- <OText
583
- size={12}
584
- lineHeight={18}
585
- color={theme.colors.textNormal}
586
- mBottom={2}>
587
- {order?.customer?.cellphone}
588
- </OText>
589
- </InfoBlock>
590
- </Customer>
591
- {order?.driver && (
592
- <>
593
- {order?.driver?.location && parseInt(order?.status) === 9 && (
594
- <Map>
595
- <GoogleMap
596
- location={order?.driver?.location}
597
- locations={locations}
598
- readOnly
599
- />
600
- </Map>
601
- )}
602
- </>
603
- )}
604
- </OrderCustomer>
605
- {order?.driver && (
606
- <>
607
- <View
608
- style={{
609
- height: 8,
610
- backgroundColor: theme.colors.backgroundGray100,
611
- marginTop: 18,
612
- marginHorizontal: -40,
613
- }}
614
- />
615
- <OrderDriver>
616
- <OText size={16} lineHeight={24} weight={'500'} style={{ marginBottom: 10 }}>{t('YOUR_DRIVER', 'Your Driver')}</OText>
617
- <Customer>
618
- <InfoBlock>
619
- <View
620
- style={{
621
- flexDirection: 'row',
622
- alignItems: 'center',
623
- justifyContent: 'space-between',
624
- }}>
625
- <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2} style={{ flexGrow: 1, flexBasis: '80%' }}>
626
- {order?.driver?.name} {order?.driver?.lastname}
627
- </OText>
628
- <Icons>
629
- <TouchableOpacity
630
- onPress={() => handleOpenMessagesForDriver()}>
631
- <OIcon
632
- src={theme.images.general.chat}
633
- width={16}
634
- color={theme.colors.disabled}
635
- />
636
- </TouchableOpacity>
637
- </Icons>
638
- </View>
639
- <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
640
- {order?.driver?.cellphone}
641
- </OText>
642
- </InfoBlock>
643
- </Customer>
644
- </OrderDriver>
645
- </>
646
- )}
647
- <View
648
- style={{
649
- height: 8,
650
- backgroundColor: theme.colors.backgroundGray100,
651
- marginTop: 18,
652
- marginHorizontal: -40,
653
- }}
654
- />
655
- <HeaderInfo>
656
- <OText
657
- size={24}
658
- color={theme.colors.textNormal}
659
- style={{ fontWeight: '600', marginBottom: 16 }}>
660
- {t(
661
- 'YOUR_ORDER_HAS_BEEN_RECEIVED',
662
- 'Your Order has been received',
663
- )}
664
- </OText>
665
- <OText color={theme.colors.textNormal} size={14} weight={'500'}>
666
- {t(
667
- 'ORDER_MESSAGE_HEADER_TEXT',
668
- 'Once business accepts your order, we will send you an email, thank you!',
669
- )}
670
- </OText>
671
- <OButton
672
- text={t('YOUR_ORDERS', 'Your Orders')}
673
- textStyle={{ fontSize: 14, color: theme.colors.primary }}
674
- imgRightSrc={null}
675
- borderColor={theme.colors.primary}
676
- bgColor={theme.colors.clear}
677
- style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0 }}
678
- parentStyle={{ marginTop: 29, width: '50%' }}
679
- onClick={() => navigation.navigate('BottomTab', { screen: 'MyOrders' })}
680
- />
681
- </HeaderInfo>
682
- <OrderProducts>
683
- {order?.products?.length &&
684
- order?.products.map((product: any, i: number) => (
685
- <ProductItemAccordion
686
- key={product?.id || i}
687
- product={product}
688
- isFromCheckout
689
- />
690
- ))}
691
- </OrderProducts>
692
- <OrderBill>
693
- <View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
694
- <Table>
695
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL', 'Subtotal')}</OText>
696
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
519
+ <TouchableOpacity
520
+ style={{ paddingStart: 5 }}
521
+ onPress={() => handleOpenMessagesForBusiness()}>
522
+ <OIcon
523
+ src={theme.images.general.chat}
524
+ width={16}
525
+ color={theme.colors.disabled}
526
+ />
527
+ </TouchableOpacity>
528
+ </Icons>
529
+ </View>
530
+ <OText
531
+ size={12}
532
+ lineHeight={18}
533
+ color={theme.colors.textNormal}
534
+ mBottom={2}>
535
+ {order?.business?.email}
536
+ </OText>
537
+ <OText
538
+ size={12}
539
+ lineHeight={18}
540
+ color={theme.colors.textNormal}
541
+ mBottom={2}>
542
+ {order?.business?.cellphone}
543
+ </OText>
544
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal}>
545
+ {order?.business?.address}
546
+ </OText>
547
+ </View>
548
+ </OrderBusiness>
549
+ <View
550
+ style={{
551
+ height: 8,
552
+ backgroundColor: theme.colors.backgroundGray100,
553
+ marginTop: 18,
554
+ marginHorizontal: -40,
555
+ }}
556
+ />
557
+ <OrderCustomer>
558
+ <OText
559
+ size={16}
560
+ lineHeight={24}
561
+ weight={'500'}
562
+ color={theme.colors.textNormal}
563
+ mBottom={12}>
564
+ {t('TO', 'To')}
565
+ </OText>
566
+ <Customer>
567
+ <InfoBlock>
568
+ <OText
569
+ size={12}
570
+ lineHeight={18}
571
+ color={theme.colors.textNormal}
572
+ mBottom={2}>
573
+ {order?.customer?.name} {order?.customer?.lastname}
574
+ </OText>
575
+ <OText
576
+ size={12}
577
+ lineHeight={18}
578
+ color={theme.colors.textNormal}
579
+ mBottom={2}>
580
+ {order?.customer?.address}
581
+ </OText>
582
+ <OText
583
+ size={12}
584
+ lineHeight={18}
585
+ color={theme.colors.textNormal}
586
+ mBottom={2}>
587
+ {order?.customer?.cellphone}
588
+ </OText>
589
+ </InfoBlock>
590
+ </Customer>
591
+ {order?.driver && (
592
+ <>
593
+ {order?.driver?.location && parseInt(order?.status) === 9 && (
594
+ <Map>
595
+ <GoogleMap
596
+ location={order?.driver?.location}
597
+ locations={locations}
598
+ readOnly
599
+ />
600
+ </Map>
601
+ )}
602
+ </>
603
+ )}
604
+ </OrderCustomer>
605
+ {order?.driver && (
606
+ <>
607
+ <View
608
+ style={{
609
+ height: 8,
610
+ backgroundColor: theme.colors.backgroundGray100,
611
+ marginTop: 18,
612
+ marginHorizontal: -40,
613
+ }}
614
+ />
615
+ <OrderDriver>
616
+ <OText size={16} lineHeight={24} weight={'500'} style={{ marginBottom: 10 }}>{t('YOUR_DRIVER', 'Your Driver')}</OText>
617
+ <Customer>
618
+ <InfoBlock>
619
+ <View
620
+ style={{
621
+ flexDirection: 'row',
622
+ alignItems: 'center',
623
+ justifyContent: 'space-between',
624
+ }}>
625
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2} style={{ flexGrow: 1, flexBasis: '80%' }}>
626
+ {order?.driver?.name} {order?.driver?.lastname}
627
+ </OText>
628
+ <Icons>
629
+ <TouchableOpacity
630
+ onPress={() => handleOpenMessagesForDriver()}>
631
+ <OIcon
632
+ src={theme.images.general.chat}
633
+ width={16}
634
+ color={theme.colors.disabled}
635
+ />
636
+ </TouchableOpacity>
637
+ </Icons>
638
+ </View>
639
+ <OText size={12} lineHeight={18} color={theme.colors.textNormal} mBottom={2}>
640
+ {order?.driver?.cellphone}
641
+ </OText>
642
+ </InfoBlock>
643
+ </Customer>
644
+ </OrderDriver>
645
+ </>
646
+ )}
647
+ <View
648
+ style={{
649
+ height: 8,
650
+ backgroundColor: theme.colors.backgroundGray100,
651
+ marginTop: 18,
652
+ marginHorizontal: -40,
653
+ }}
654
+ />
655
+ <HeaderInfo>
656
+ <OText
657
+ size={24}
658
+ color={theme.colors.textNormal}
659
+ style={{ fontWeight: '600', marginBottom: 16 }}>
660
+ {t(
661
+ 'YOUR_ORDER_HAS_BEEN_RECEIVED',
662
+ 'Your Order has been received',
663
+ )}
664
+ </OText>
665
+ <OText color={theme.colors.textNormal} size={14} weight={'500'}>
666
+ {t(
667
+ 'ORDER_MESSAGE_HEADER_TEXT',
668
+ 'Once business accepts your order, we will send you an email, thank you!',
669
+ )}
670
+ </OText>
671
+ <OButton
672
+ text={t('YOUR_ORDERS', 'Your Orders')}
673
+ textStyle={{ fontSize: 14, color: theme.colors.primary }}
674
+ imgRightSrc={null}
675
+ borderColor={theme.colors.primary}
676
+ bgColor={theme.colors.clear}
677
+ style={{ borderRadius: 7.6, borderWidth: 1, height: 44, shadowOpacity: 0 }}
678
+ parentStyle={{ marginTop: 29, width: '50%' }}
679
+ onClick={() => navigation.navigate('BottomTab', { screen: 'MyOrders' })}
680
+ />
681
+ </HeaderInfo>
682
+ <OrderProducts>
683
+ {order?.products?.length &&
684
+ order?.products.map((product: any, i: number) => (
685
+ <ProductItemAccordion
686
+ key={product?.id || i}
687
+ product={product}
688
+ isFromCheckout
689
+ />
690
+ ))}
691
+ </OrderProducts>
692
+ <OrderBill>
693
+ <View style={{ height: 1, backgroundColor: theme.colors.border, marginBottom: 17 }} />
694
+ <Table>
695
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('SUBTOTAL', 'Subtotal')}</OText>
696
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
697
697
  {parsePrice(((order?.summary?.subtotal || order?.subtotal) + getIncludedTaxes()))}
698
- </OText>
699
- </Table>
700
- {(order?.summary?.discount > 0 || order?.discount > 0) && (
701
- <Table>
702
- {order?.offer_type === 1 ? (
703
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
704
- {t('DISCOUNT', 'Discount')}
705
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(
706
- order?.offer_rate,
707
- parsePrice,
708
- )}%)`}</OText>
709
- </OText>
710
- ) : (
711
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DISCOUNT', 'Discount')}</OText>
712
- )}
713
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
714
- - {parsePrice(order?.summary?.discount || order?.discount)}
715
- </OText>
716
- </Table>
717
- )}
718
- {
698
+ </OText>
699
+ </Table>
700
+ {(order?.summary?.discount > 0 || order?.discount > 0) && (
701
+ <Table>
702
+ {order?.offer_type === 1 ? (
703
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
704
+ {t('DISCOUNT', 'Discount')}
705
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{`(${verifyDecimals(
706
+ order?.offer_rate,
707
+ parsePrice,
708
+ )}%)`}</OText>
709
+ </OText>
710
+ ) : (
711
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DISCOUNT', 'Discount')}</OText>
712
+ )}
713
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
714
+ - {parsePrice(order?.summary?.discount || order?.discount)}
715
+ </OText>
716
+ </Table>
717
+ )}
718
+ {
719
719
  order?.taxes?.length === 0 && order?.tax_type === 2 && (
720
720
  <Table>
721
721
  <OText size={12}>
@@ -753,72 +753,88 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
753
753
  ))
754
754
  }
755
755
  {
756
- order?.fees?.length > 0 && order?.fees?.filter((fee : any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
757
- <Table key={fee.id}>
758
- <OSRow>
759
- <OText size={12} numberOfLines={1}>
760
- {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
761
- ({parsePrice(fee?.fixed)} + {fee.percentage}%){' '}
762
- </OText>
763
- <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })}>
764
- <AntIcon name='exclamationcircleo' size={14} color={theme.colors.primary} />
765
- </TouchableOpacity>
766
- </OSRow>
767
- <OText size={12}>{parsePrice(fee?.fixed + fee?.summary?.percentage || 0)}</OText>
768
- </Table>
756
+ order?.fees?.length > 0 && order?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
757
+ <Table key={fee.id}>
758
+ <OSRow>
759
+ <OText size={12} numberOfLines={1}>
760
+ {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
761
+ ({parsePrice(fee?.fixed)} + {fee.percentage}%){' '}
762
+ </OText>
763
+ <TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee })}>
764
+ <AntIcon name='exclamationcircleo' size={14} color={theme.colors.primary} />
765
+ </TouchableOpacity>
766
+ </OSRow>
767
+ <OText size={12}>{parsePrice(fee?.fixed + fee?.summary?.percentage || 0)}</OText>
768
+ </Table>
769
769
  ))
770
770
  }
771
- {(order?.summary?.delivery_price > 0 ||
772
- order?.deliveryFee > 0) && (
773
- <Table>
774
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
775
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
776
- {parsePrice(
777
- order?.summary?.delivery_price || order?.deliveryFee,
778
- )}
779
- </OText>
780
- </Table>
781
- )}
782
- <Table>
783
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
784
- {t('DRIVER_TIP', 'Driver tip')}
785
- {(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) &&
786
- parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
787
- !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
788
- `(${verifyDecimals(order?.driver_tip, parseNumber)}%)`}
789
- </OText>
790
- <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
791
- {parsePrice(
792
- order?.summary?.driver_tip || order?.totalDriverTip,
793
- )}
794
- </OText>
795
- </Table>
796
- <Total>
797
- <Table>
798
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
799
- <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>
800
- {parsePrice(order?.summary?.total || order?.total)}
801
- </OText>
802
- </Table>
803
- </Total>
804
- </OrderBill>
805
- </OrderContent>
806
- </>
807
- )}
808
- <OModal
809
- open={openModalForBusiness || openModalForDriver}
810
- customClose
811
- entireModal
812
- onClose={() => handleCloseModal()}>
813
- <Messages
814
- type={openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER}
815
- orderId={order?.id}
816
- messages={messages}
817
- order={order}
818
- setMessages={setMessages}
819
- onClose={() => handleCloseModal()}
820
- />
821
- </OModal>
771
+ {(order?.summary?.delivery_price > 0 ||
772
+ order?.deliveryFee > 0) && (
773
+ <Table>
774
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
775
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
776
+ {parsePrice(
777
+ order?.summary?.delivery_price || order?.deliveryFee,
778
+ )}
779
+ </OText>
780
+ </Table>
781
+ )}
782
+ <Table>
783
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
784
+ {t('DRIVER_TIP', 'Driver tip')}
785
+ {(order?.summary?.driver_tip > 0 || order?.driver_tip > 0) &&
786
+ parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
787
+ !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
788
+ `(${verifyDecimals(order?.driver_tip, parseNumber)}%)`}
789
+ </OText>
790
+ <OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
791
+ {parsePrice(
792
+ order?.summary?.driver_tip || order?.totalDriverTip,
793
+ )}
794
+ </OText>
795
+ </Table>
796
+ <Total>
797
+ <Table>
798
+ <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>{t('TOTAL', 'Total')}</OText>
799
+ <OText size={20} lineHeight={30} weight={'600'} color={theme.colors.textNormal}>
800
+ {parsePrice(order?.summary?.total || order?.total)}
801
+ </OText>
802
+ </Table>
803
+ </Total>
804
+ {order?.comment && (
805
+ <Table>
806
+ <OText
807
+ style={{ flex: 1 }}
808
+ size={12}
809
+ lineHeight={18}
810
+ weight={'400'}
811
+ color={theme.colors.textNormal}
812
+ >
813
+ {t('COMMENT', 'Comment')}
814
+ </OText>
815
+ <OText style={{ maxWidth: '70%' }} size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
816
+ {order?.comment}
817
+ </OText>
818
+ </Table>
819
+ )}
820
+ </OrderBill>
821
+ </OrderContent>
822
+ </>
823
+ )}
824
+ <OModal
825
+ open={openModalForBusiness || openModalForDriver}
826
+ customClose
827
+ entireModal
828
+ onClose={() => handleCloseModal()}>
829
+ <Messages
830
+ type={openModalForBusiness ? USER_TYPE.BUSINESS : USER_TYPE.DRIVER}
831
+ orderId={order?.id}
832
+ messages={messages}
833
+ order={order}
834
+ setMessages={setMessages}
835
+ onClose={() => handleCloseModal()}
836
+ />
837
+ </OModal>
822
838
  <OModal
823
839
  open={openTaxModal.open}
824
840
  onClose={() => setOpenTaxModal({ open: false, data: null })}
@@ -826,15 +842,15 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
826
842
  >
827
843
  <TaxInformation data={openTaxModal.data} products={order?.products} />
828
844
  </OModal>
829
- </OrderDetailsContainer>
830
- );
845
+ </OrderDetailsContainer>
846
+ );
831
847
  };
832
848
 
833
849
  export const OrderDetails = (props: OrderDetailsParams) => {
834
- const orderDetailsProps = {
835
- ...props,
836
- UIComponent: OrderDetailsUI,
837
- };
850
+ const orderDetailsProps = {
851
+ ...props,
852
+ UIComponent: OrderDetailsUI,
853
+ };
838
854
 
839
- return <OrderDetailsConTableoller {...orderDetailsProps} />;
855
+ return <OrderDetailsConTableoller {...orderDetailsProps} />;
840
856
  };