ordering-ui-react-native 0.12.58 → 0.12.59

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.
@@ -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
  };