ordering-ui-react-native 0.15.55 → 0.15.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/OrderDetails/index.tsx +2 -2
- package/themes/business/src/components/NewOrderNotification/index.tsx +59 -98
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +125 -91
- package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
- package/themes/kiosk/src/components/Cart/index.tsx +99 -25
- package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
- package/themes/kiosk/src/components/OrderDetails/index.tsx +134 -39
- package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +151 -0
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +58 -21
- package/themes/original/src/components/BusinessProductsList/index.tsx +104 -18
- package/themes/original/src/components/BusinessProductsList/styles.tsx +12 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +5 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/PhoneInputNumber/index.tsx +10 -4
- package/themes/original/src/components/SignupForm/index.tsx +41 -13
- package/themes/original/src/components/UserFormDetails/index.tsx +13 -2
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
- package/themes/original/src/config/constants.tsx +6 -6
- package/themes/original/src/types/index.tsx +6 -1
- package/themes/single-business/src/components/AddressList/index.tsx +1 -1
- package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useValidationFields,
|
|
11
11
|
} from 'ordering-components/native';
|
|
12
12
|
|
|
13
|
-
import { CheckoutAction, OrderTypeWrapper, FloatingLayout } from './styles';
|
|
13
|
+
import { CheckoutAction, OrderTypeWrapper, FloatingLayout, OSRow } from './styles';
|
|
14
14
|
|
|
15
15
|
import { OSBill, OSCoupon, OSTable } from '../OrderSummary/styles';
|
|
16
16
|
|
|
@@ -90,6 +90,20 @@ const CartUI = (props: any) => {
|
|
|
90
90
|
|
|
91
91
|
const goToBack = () => navigation.goBack();
|
|
92
92
|
|
|
93
|
+
const getIncludedTaxes = () => {
|
|
94
|
+
if (cart?.taxes === null) {
|
|
95
|
+
return cart.business.tax_type === 1 ? cart?.tax : 0
|
|
96
|
+
} else {
|
|
97
|
+
return cart?.taxes.reduce((taxIncluded: number, tax: any) => {
|
|
98
|
+
return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
|
|
99
|
+
}, 0)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const getIncludedTaxesDiscounts = () => {
|
|
104
|
+
return cart?.taxes?.filter((tax: any) => tax?.type === 1)?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
105
|
+
}
|
|
106
|
+
|
|
93
107
|
return (
|
|
94
108
|
<>
|
|
95
109
|
<Container>
|
|
@@ -177,13 +191,10 @@ const CartUI = (props: any) => {
|
|
|
177
191
|
<OSTable>
|
|
178
192
|
<OText>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
179
193
|
<OText>
|
|
180
|
-
{cart
|
|
181
|
-
? parsePrice((cart?.subtotal + cart?.tax) || 0)
|
|
182
|
-
: parsePrice(cart?.subtotal || 0)}
|
|
194
|
+
{parsePrice(cart?.subtotal + getIncludedTaxes())}
|
|
183
195
|
</OText>
|
|
184
196
|
</OSTable>
|
|
185
|
-
{cart?.discount > 0 && cart?.total >= 0 && orientationState?.orientation == PORTRAIT && (
|
|
186
|
-
|
|
197
|
+
{cart?.discount > 0 && cart?.total >= 0 && cart?.offers?.length === 0 && orientationState?.orientation == PORTRAIT && (
|
|
187
198
|
<OSTable
|
|
188
199
|
style={{
|
|
189
200
|
backgroundColor: theme.colors.success,
|
|
@@ -226,44 +237,107 @@ const CartUI = (props: any) => {
|
|
|
226
237
|
</OText>
|
|
227
238
|
</OSTable>
|
|
228
239
|
)}
|
|
229
|
-
{
|
|
240
|
+
{
|
|
241
|
+
cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
|
|
242
|
+
<OSTable key={offer.id}>
|
|
243
|
+
<OSRow>
|
|
244
|
+
<OText>{offer.name}</OText>
|
|
245
|
+
{offer.rate_type === 1 && (
|
|
246
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
247
|
+
)}
|
|
248
|
+
</OSRow>
|
|
249
|
+
<OText>
|
|
250
|
+
- {parsePrice(offer?.summary?.discount)}
|
|
251
|
+
</OText>
|
|
252
|
+
</OSTable>
|
|
253
|
+
))
|
|
254
|
+
}
|
|
255
|
+
{cart?.subtotal_with_discount > 0 && cart?.discount > 0 && cart?.total >= 0 && (
|
|
230
256
|
<OSTable>
|
|
231
|
-
<OText>
|
|
232
|
-
|
|
233
|
-
{
|
|
234
|
-
|
|
235
|
-
|
|
257
|
+
<OText numberOfLines={1}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
|
|
258
|
+
{cart?.business?.tax_type === 1 ? (
|
|
259
|
+
<OText>{parsePrice(cart?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0)}</OText>
|
|
260
|
+
) : (
|
|
261
|
+
<OText>{parsePrice(cart?.subtotal_with_discount ?? 0)}</OText>
|
|
262
|
+
)}
|
|
236
263
|
</OSTable>
|
|
237
264
|
)}
|
|
265
|
+
{
|
|
266
|
+
cart.taxes?.length > 0 && cart.taxes.filter((tax: any) => tax.type === 2 && tax?.rate !== 0).map((tax: any) => (
|
|
267
|
+
<OSTable key={tax.id}>
|
|
268
|
+
<OSRow>
|
|
269
|
+
<OText>
|
|
270
|
+
{tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
|
|
271
|
+
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
272
|
+
</OText>
|
|
273
|
+
</OSRow>
|
|
274
|
+
<OText>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
|
|
275
|
+
</OSTable>
|
|
276
|
+
))
|
|
277
|
+
}
|
|
278
|
+
{
|
|
279
|
+
cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
|
|
280
|
+
<OSTable key={fee?.id}>
|
|
281
|
+
<OSRow>
|
|
282
|
+
<OText>
|
|
283
|
+
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
|
|
284
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
|
|
285
|
+
</OText>
|
|
286
|
+
</OSRow>
|
|
287
|
+
<OText>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
|
|
288
|
+
</OSTable>
|
|
289
|
+
))
|
|
290
|
+
}
|
|
291
|
+
{
|
|
292
|
+
cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any) => (
|
|
293
|
+
<OSTable key={offer.id}>
|
|
294
|
+
<OSRow>
|
|
295
|
+
<OText>{offer.name}</OText>
|
|
296
|
+
{offer.rate_type === 1 && (
|
|
297
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
298
|
+
)}
|
|
299
|
+
</OSRow>
|
|
300
|
+
<OText>
|
|
301
|
+
- {parsePrice(offer?.summary?.discount)}
|
|
302
|
+
</OText>
|
|
303
|
+
</OSTable>
|
|
304
|
+
))
|
|
305
|
+
}
|
|
238
306
|
{selectedOrderType === 1 && cart?.delivery_price > 0 && (
|
|
239
307
|
<OSTable>
|
|
240
308
|
<OText>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
241
309
|
<OText>{parsePrice(cart?.delivery_price)}</OText>
|
|
242
310
|
</OSTable>
|
|
243
311
|
)}
|
|
312
|
+
{
|
|
313
|
+
cart?.offers?.length > 0 && cart?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
|
|
314
|
+
<OSTable key={offer.id}>
|
|
315
|
+
<OSRow>
|
|
316
|
+
<OText>{offer.name}</OText>
|
|
317
|
+
{offer.rate_type === 1 && (
|
|
318
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
319
|
+
)}
|
|
320
|
+
</OSRow>
|
|
321
|
+
<OText>
|
|
322
|
+
- {parsePrice(offer?.summary?.discount)}
|
|
323
|
+
</OText>
|
|
324
|
+
</OSTable>
|
|
325
|
+
))
|
|
326
|
+
}
|
|
244
327
|
{cart?.driver_tip > 0 && (
|
|
245
328
|
<OSTable>
|
|
246
329
|
<OText>
|
|
247
330
|
{t('DRIVER_TIP', 'Driver tip')}
|
|
248
331
|
{cart?.driver_tip_rate > 0 &&
|
|
249
332
|
parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
|
|
250
|
-
|
|
333
|
+
!parseInt(configs?.driver_tip_use_custom?.value, 10) &&
|
|
251
334
|
(
|
|
252
|
-
`(${
|
|
335
|
+
`(${verifyDecimals(cart?.driver_tip_rate, parseNumber)}%)`
|
|
253
336
|
)}
|
|
254
337
|
</OText>
|
|
255
338
|
<OText>{parsePrice(cart?.driver_tip)}</OText>
|
|
256
339
|
</OSTable>
|
|
257
340
|
)}
|
|
258
|
-
{cart?.service_fee > 0 && (
|
|
259
|
-
<OSTable>
|
|
260
|
-
<OText>
|
|
261
|
-
{t('SERVICE_FEE', 'Service Fee')}
|
|
262
|
-
{`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
|
|
263
|
-
</OText>
|
|
264
|
-
<OText>{parsePrice(cart?.service_fee)}</OText>
|
|
265
|
-
</OSTable>
|
|
266
|
-
)}
|
|
267
341
|
{!cart?.discount_type && isCouponEnabled && !isCartPending && orientationState?.orientation == PORTRAIT && (
|
|
268
342
|
<OSTable>
|
|
269
343
|
<OSCoupon>
|
|
@@ -279,7 +353,7 @@ const CartUI = (props: any) => {
|
|
|
279
353
|
{t('TOTAL', 'Total')}
|
|
280
354
|
</OText>
|
|
281
355
|
<OText weight='bold' color={theme.colors.primary}>
|
|
282
|
-
{cart?.total >=
|
|
356
|
+
{parsePrice(cart?.total >= 0 ? cart?.total : 0)}
|
|
283
357
|
</OText>
|
|
284
358
|
</OSTable>
|
|
285
359
|
</OSBill>
|
|
@@ -379,7 +453,7 @@ const CartUI = (props: any) => {
|
|
|
379
453
|
<ProductForm
|
|
380
454
|
productCart={curProduct}
|
|
381
455
|
businessSlug={cart?.business?.slug}
|
|
382
|
-
businessId={
|
|
456
|
+
businessId={curProduct?.business_id}
|
|
383
457
|
categoryId={curProduct?.category_id}
|
|
384
458
|
productId={curProduct?.id}
|
|
385
459
|
onSave={handlerProductAction}
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
Table,
|
|
24
24
|
OrderBill,
|
|
25
25
|
Total,
|
|
26
|
+
OSRow,
|
|
26
27
|
} from './styles'
|
|
27
28
|
import { OrderDetailsParams, Product } from '../../types'
|
|
28
29
|
import { Container } from '../../layouts/Container';
|
|
@@ -178,6 +179,20 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
178
179
|
setIsLoading(false)
|
|
179
180
|
}
|
|
180
181
|
|
|
182
|
+
const getIncludedTaxes = () => {
|
|
183
|
+
if (order?.taxes?.length === 0) {
|
|
184
|
+
return order.tax_type === 1 ? order?.summary?.tax ?? 0 : 0
|
|
185
|
+
} else {
|
|
186
|
+
return order?.taxes.reduce((taxIncluded: number, tax: any) => {
|
|
187
|
+
return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
|
|
188
|
+
}, 0)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const getIncludedTaxesDiscounts = () => {
|
|
193
|
+
return order?.taxes?.filter((tax: any) => tax?.type === 1)?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
194
|
+
}
|
|
195
|
+
|
|
181
196
|
useEffect(() => {
|
|
182
197
|
const backAction = () => {
|
|
183
198
|
Alert.alert(`${t('HOLD_ON', 'Hold on')}!`, `${t('ARE_YOU_SURE_YOU_WANT_TO_GO_BACK', 'Are you sure you want to go back')}?`, [
|
|
@@ -209,7 +224,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
209
224
|
const getCustomerName = async () => {
|
|
210
225
|
try {
|
|
211
226
|
const { customerName: name } = await _retrieveStoreData('customer_name')
|
|
212
|
-
|
|
227
|
+
setCustomerName(name)
|
|
213
228
|
} catch (e) {
|
|
214
229
|
if (e) {
|
|
215
230
|
setCustomerName(null)
|
|
@@ -217,8 +232,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
217
232
|
}
|
|
218
233
|
}
|
|
219
234
|
getCustomerName()
|
|
220
|
-
const redirectHome = setTimeout(() =>{
|
|
221
|
-
_setStoreData('customer_name', {customerName: ''});
|
|
235
|
+
const redirectHome = setTimeout(() => {
|
|
236
|
+
_setStoreData('customer_name', { customerName: '' });
|
|
222
237
|
navigation.reset({
|
|
223
238
|
routes: [{ name: 'Intro' }],
|
|
224
239
|
});
|
|
@@ -345,7 +360,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
345
360
|
<OButton
|
|
346
361
|
text={`${t('YOU_ARE_DONE', 'You are done! Click to close')}!`}
|
|
347
362
|
onClick={() => {
|
|
348
|
-
_setStoreData('customer_name', {customerName: ''});
|
|
363
|
+
_setStoreData('customer_name', { customerName: '' });
|
|
349
364
|
navigation.reset({
|
|
350
365
|
routes: [{ name: 'Intro' }],
|
|
351
366
|
});
|
|
@@ -419,46 +434,135 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
419
434
|
<Table>
|
|
420
435
|
<OText>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
421
436
|
<OText>
|
|
422
|
-
{parsePrice(
|
|
423
|
-
? (order?.summary?.subtotal + order?.summary?.tax) ?? 0
|
|
424
|
-
: order?.summary?.subtotal ?? 0
|
|
425
|
-
)}
|
|
437
|
+
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
|
|
426
438
|
</OText>
|
|
427
439
|
</Table>
|
|
428
|
-
{order?.summary?.discount > 0 && (
|
|
440
|
+
{(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
|
|
429
441
|
<Table>
|
|
430
442
|
{order?.offer_type === 1 ? (
|
|
431
443
|
<OText>
|
|
432
444
|
{t('DISCOUNT', 'Discount')}
|
|
433
|
-
<OText>{`(${verifyDecimals(
|
|
445
|
+
<OText>{`(${verifyDecimals(
|
|
446
|
+
order?.offer_rate,
|
|
447
|
+
parsePrice,
|
|
448
|
+
)}%)`}</OText>
|
|
434
449
|
</OText>
|
|
435
450
|
) : (
|
|
436
451
|
<OText>{t('DISCOUNT', 'Discount')}</OText>
|
|
437
452
|
)}
|
|
438
|
-
<OText
|
|
453
|
+
<OText>
|
|
454
|
+
- {parsePrice(order?.summary?.discount || order?.discount)}
|
|
455
|
+
</OText>
|
|
439
456
|
</Table>
|
|
440
457
|
)}
|
|
458
|
+
{
|
|
459
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
|
|
460
|
+
<Table key={offer.id}>
|
|
461
|
+
<OSRow>
|
|
462
|
+
<OText>
|
|
463
|
+
{offer.name}
|
|
464
|
+
{offer.rate_type === 1 && (
|
|
465
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
466
|
+
)}
|
|
467
|
+
</OText>
|
|
468
|
+
</OSRow>
|
|
469
|
+
<OText>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
470
|
+
</Table>
|
|
471
|
+
))
|
|
472
|
+
}
|
|
441
473
|
{order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
|
|
442
474
|
<Table>
|
|
443
475
|
<OText>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
<OText>
|
|
450
|
-
{t('TAX', 'Tax')}
|
|
451
|
-
{`(${verifyDecimals(order?.summary?.tax_rate, parseNumber)}%)`}
|
|
452
|
-
</OText>
|
|
453
|
-
<OText>{parsePrice(order?.summary?.tax)}</OText>
|
|
476
|
+
{order?.tax_type === 1 ? (
|
|
477
|
+
<OText>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0))}</OText>
|
|
478
|
+
) : (
|
|
479
|
+
<OText>{parsePrice(order?.summary?.subtotal_with_discount ?? 0)}</OText>
|
|
480
|
+
)}
|
|
454
481
|
</Table>
|
|
455
482
|
)}
|
|
483
|
+
{
|
|
484
|
+
order?.taxes?.length === 0 && order?.tax_type === 2 && (
|
|
485
|
+
<Table>
|
|
486
|
+
<OText>
|
|
487
|
+
{t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
|
|
488
|
+
</OText>
|
|
489
|
+
<OText>{parsePrice(order?.summary?.tax || 0)}</OText>
|
|
490
|
+
</Table>
|
|
491
|
+
)
|
|
492
|
+
}
|
|
493
|
+
{
|
|
494
|
+
order?.fees?.length === 0 && (
|
|
495
|
+
<Table>
|
|
496
|
+
<OText>
|
|
497
|
+
{t('SERVICE_FEE', 'Service fee')}
|
|
498
|
+
{`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
|
|
499
|
+
</OText>
|
|
500
|
+
<OText>{parsePrice(order?.summary?.service_fee || 0)}</OText>
|
|
501
|
+
</Table>
|
|
502
|
+
)
|
|
503
|
+
}
|
|
504
|
+
{
|
|
505
|
+
order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
|
|
506
|
+
<Table key={tax.id}>
|
|
507
|
+
<OSRow>
|
|
508
|
+
<OText>
|
|
509
|
+
{tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
510
|
+
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
511
|
+
</OText>
|
|
512
|
+
</OSRow>
|
|
513
|
+
<OText>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
|
|
514
|
+
</Table>
|
|
515
|
+
))
|
|
516
|
+
}
|
|
517
|
+
{
|
|
518
|
+
order?.fees?.length > 0 && order?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
|
|
519
|
+
<Table key={fee.id}>
|
|
520
|
+
<OSRow>
|
|
521
|
+
<OText>
|
|
522
|
+
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
523
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}%){' '}
|
|
524
|
+
</OText>
|
|
525
|
+
</OSRow>
|
|
526
|
+
<OText>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
|
|
527
|
+
</Table>
|
|
528
|
+
))
|
|
529
|
+
}
|
|
530
|
+
{
|
|
531
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any) => (
|
|
532
|
+
<Table key={offer.id}>
|
|
533
|
+
<OSRow>
|
|
534
|
+
<OText>
|
|
535
|
+
{offer.name}
|
|
536
|
+
{offer.rate_type === 1 && (
|
|
537
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
538
|
+
)}
|
|
539
|
+
</OText>
|
|
540
|
+
</OSRow>
|
|
541
|
+
<OText>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
542
|
+
</Table>
|
|
543
|
+
))
|
|
544
|
+
}
|
|
456
545
|
{order?.summary?.delivery_price > 0 && (
|
|
457
546
|
<Table>
|
|
458
547
|
<OText>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
459
548
|
<OText>{parsePrice(order?.summary?.delivery_price)}</OText>
|
|
460
549
|
</Table>
|
|
461
550
|
)}
|
|
551
|
+
{
|
|
552
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
|
|
553
|
+
<Table key={offer.id}>
|
|
554
|
+
<OSRow>
|
|
555
|
+
<OText>
|
|
556
|
+
{offer.name}
|
|
557
|
+
{offer.rate_type === 1 && (
|
|
558
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
559
|
+
)}
|
|
560
|
+
</OText>
|
|
561
|
+
</OSRow>
|
|
562
|
+
<OText>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
563
|
+
</Table>
|
|
564
|
+
))
|
|
565
|
+
}
|
|
462
566
|
{order?.summary?.driver_tip > 0 && (
|
|
463
567
|
<Table>
|
|
464
568
|
<OText>
|
|
@@ -470,23 +574,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
470
574
|
`(${verifyDecimals(order?.summary?.driver_tip, parseNumber)}%)`
|
|
471
575
|
)}
|
|
472
576
|
</OText>
|
|
473
|
-
<OText>{parsePrice(order?.summary?.driver_tip ??
|
|
474
|
-
</Table>
|
|
475
|
-
)}
|
|
476
|
-
{order?.summary?.service_fee > 0 && (
|
|
477
|
-
<Table>
|
|
478
|
-
<OText>
|
|
479
|
-
{t('SERVICE_FEE', 'Service Fee')}
|
|
480
|
-
{`(${verifyDecimals(order?.summary?.service_fee, parseNumber)}%)`}
|
|
481
|
-
</OText>
|
|
482
|
-
<OText>{parsePrice(order?.summary?.service_fee)}</OText>
|
|
577
|
+
<OText>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</OText>
|
|
483
578
|
</Table>
|
|
484
579
|
)}
|
|
485
580
|
<Total>
|
|
486
581
|
<Table>
|
|
487
582
|
<OText style={styles.textBold}>{t('TOTAL', 'Total')}</OText>
|
|
488
583
|
<OText style={styles.textBold} color={theme.colors.primary}>
|
|
489
|
-
{parsePrice(order?.summary?.total ??
|
|
584
|
+
{parsePrice(order?.summary?.total ?? order?.total)}
|
|
490
585
|
</OText>
|
|
491
586
|
</Table>
|
|
492
587
|
</Total>
|
|
@@ -508,14 +603,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
508
603
|
<OIconButton
|
|
509
604
|
bgColor="transparent"
|
|
510
605
|
borderColor="transparent"
|
|
511
|
-
RenderIcon={() =>
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
606
|
+
RenderIcon={() =>
|
|
607
|
+
<EvilIcons
|
|
608
|
+
name={'close'}
|
|
609
|
+
size={40}
|
|
610
|
+
color={theme.colors.primary}
|
|
611
|
+
/>
|
|
517
612
|
}
|
|
518
|
-
style={{ flex:1, justifyContent: 'flex-end', left: 30 }}
|
|
613
|
+
style={{ flex: 1, justifyContent: 'flex-end', left: 30 }}
|
|
519
614
|
onClick={() => {
|
|
520
615
|
navigation.reset({
|
|
521
616
|
routes: [{ name: 'Intro' }],
|
|
@@ -50,6 +50,74 @@ import { BusinessTypeFilter } from './src/components/BusinessTypeFilter';
|
|
|
50
50
|
import { BusinessController } from './src/components/BusinessController';
|
|
51
51
|
import { BusinessFeaturedController } from './src/components/BusinessFeaturedController';
|
|
52
52
|
import { HighestRatedBusinesses } from './src/components/HighestRatedBusinesses';
|
|
53
|
+
import { PaymentOptions } from './src/components/PaymentOptions';
|
|
54
|
+
import { DriverTips } from './src/components/DriverTips';
|
|
55
|
+
import { UserDetails } from './src/components/UserDetails';
|
|
56
|
+
import { OrderSummary } from './src/components/OrderSummary';
|
|
57
|
+
import { CartStoresListing } from './src/components/CartStoresListing';
|
|
58
|
+
import { PaymentOptionsWebView } from '../../src/components/PaymentOptionsWebView';
|
|
59
|
+
import { GoogleMap } from './src/components/GoogleMap';
|
|
60
|
+
import { SingleProductCard } from './src/components/SingleProductCard';
|
|
61
|
+
import { UpsellingRedirect } from './src/components/BusinessProductsListing/UpsellingRedirect';
|
|
62
|
+
import { ProductItemAccordion } from './src/components/ProductItemAccordion';
|
|
63
|
+
import { BusinessItemAccordion } from './src/components/BusinessItemAccordion';
|
|
64
|
+
import { CouponControl } from './src/components/CouponControl';
|
|
65
|
+
import { TaxInformation } from './src/components/TaxInformation';
|
|
66
|
+
import { PlaceSpot } from './src/components/PlaceSpot';
|
|
67
|
+
import { Cart } from './src/components/Cart';
|
|
68
|
+
import { LanguageSelector } from './src/components/LanguageSelector';
|
|
69
|
+
import { PhoneInputNumber } from './src/components/PhoneInputNumber'
|
|
70
|
+
import { FacebookLogin } from './src/components/FacebookLogin';
|
|
71
|
+
import { VerifyPhone } from './src/components/VerifyPhone';
|
|
72
|
+
import { GoogleLogin } from './src/components/GoogleLogin';
|
|
73
|
+
import { PreviousOrders } from './src/components/PreviousOrders';
|
|
74
|
+
import { PaymentOptionCash } from './src/components/PaymentOptionCash';
|
|
75
|
+
import { StripeElementsForm } from './src/components/StripeElementsForm';
|
|
76
|
+
import { StripeCardsList } from './src/components/StripeCardsList';
|
|
77
|
+
import { ProductIngredient } from './src/components/ProductIngredient';
|
|
78
|
+
import { ProductOption } from './src/components/ProductOption';
|
|
79
|
+
import { ProductOptionSubOption } from './src/components/ProductOptionSubOption';
|
|
80
|
+
import { SingleProductReview } from './src/components/SingleProductReview';
|
|
81
|
+
import { LogoutButton } from './src/components/LogoutButton';
|
|
82
|
+
import { UserFormDetailsUI } from './src/components/UserFormDetails';
|
|
83
|
+
import { WalletTransactionItem } from './src/components/WalletTransactionItem';
|
|
84
|
+
|
|
85
|
+
import { USER_TYPE, ORDER_TYPES } from './src/config/constants'
|
|
86
|
+
|
|
87
|
+
import { OSBill, OSTable, OSCoupon, OSTotal, OSRow } from './src/components/OrderSummary/styles';
|
|
88
|
+
|
|
89
|
+
import { FormInput, FormSide, ButtonsWrapper, LoginWith, OTab, OTabs } from './src/components/LoginForm/styles';
|
|
90
|
+
import { OSItem, OSItemContent, OSItemActions} from './src/components/PaymentOptionStripe/styles';
|
|
91
|
+
|
|
92
|
+
import Alert from './src/providers/AlertProvider'
|
|
93
|
+
|
|
94
|
+
import {
|
|
95
|
+
LoginParams,
|
|
96
|
+
ProfileParams,
|
|
97
|
+
AddressListParams,
|
|
98
|
+
AddressFormParams,
|
|
99
|
+
SignupParams,
|
|
100
|
+
PhoneInputParams,
|
|
101
|
+
LanguageSelectorParams,
|
|
102
|
+
BusinessesListingParams,
|
|
103
|
+
HighestRatedBusinessesParams,
|
|
104
|
+
BusinessTypeFilterParams,
|
|
105
|
+
BusinessControllerParams,
|
|
106
|
+
BusinessProductsListingParams,
|
|
107
|
+
BusinessBasicInformationParams,
|
|
108
|
+
BusinessProductsCategoriesParams,
|
|
109
|
+
BusinessProductsListParams,
|
|
110
|
+
SingleProductCardParams,
|
|
111
|
+
BusinessInformationParams,
|
|
112
|
+
BusinessReviewsParams,
|
|
113
|
+
SearchBarParams,
|
|
114
|
+
NotFoundSourceParams,
|
|
115
|
+
OrdersOptionParams,
|
|
116
|
+
ActiveOrdersParams,
|
|
117
|
+
PreviousOrdersParams,
|
|
118
|
+
OrderDetailsParams,
|
|
119
|
+
ReviewDriverParams
|
|
120
|
+
} from './src/types';
|
|
53
121
|
|
|
54
122
|
import { Toast } from './src/components/shared/OToast';
|
|
55
123
|
import {
|
|
@@ -71,6 +139,8 @@ import {
|
|
|
71
139
|
|
|
72
140
|
import { Container } from './src/layouts/Container';
|
|
73
141
|
import { SafeAreaContainer } from './src/layouts/SafeAreaContainer';
|
|
142
|
+
import { FloatingBottomContainer } from './src/layouts/FloatingBottomContainer';
|
|
143
|
+
|
|
74
144
|
import {
|
|
75
145
|
_retrieveStoreData,
|
|
76
146
|
_setStoreData,
|
|
@@ -130,6 +200,86 @@ export {
|
|
|
130
200
|
BusinessController,
|
|
131
201
|
BusinessFeaturedController,
|
|
132
202
|
HighestRatedBusinesses,
|
|
203
|
+
PaymentOptions,
|
|
204
|
+
DriverTips,
|
|
205
|
+
UserDetails,
|
|
206
|
+
OrderSummary,
|
|
207
|
+
CartStoresListing,
|
|
208
|
+
PaymentOptionsWebView,
|
|
209
|
+
GoogleMap,
|
|
210
|
+
SingleProductCard,
|
|
211
|
+
UpsellingRedirect,
|
|
212
|
+
ProductItemAccordion,
|
|
213
|
+
BusinessItemAccordion,
|
|
214
|
+
CouponControl,
|
|
215
|
+
TaxInformation,
|
|
216
|
+
PlaceSpot,
|
|
217
|
+
Cart,
|
|
218
|
+
LanguageSelector,
|
|
219
|
+
PhoneInputNumber,
|
|
220
|
+
FacebookLogin,
|
|
221
|
+
VerifyPhone,
|
|
222
|
+
GoogleLogin,
|
|
223
|
+
PreviousOrders,
|
|
224
|
+
PaymentOptionCash,
|
|
225
|
+
StripeElementsForm,
|
|
226
|
+
StripeCardsList,
|
|
227
|
+
ProductIngredient,
|
|
228
|
+
ProductOption,
|
|
229
|
+
ProductOptionSubOption,
|
|
230
|
+
SingleProductReview,
|
|
231
|
+
LogoutButton,
|
|
232
|
+
UserFormDetailsUI,
|
|
233
|
+
WalletTransactionItem,
|
|
234
|
+
|
|
235
|
+
ORDER_TYPES,
|
|
236
|
+
USER_TYPE,
|
|
237
|
+
|
|
238
|
+
OSBill,
|
|
239
|
+
OSTable,
|
|
240
|
+
OSCoupon,
|
|
241
|
+
OSTotal,
|
|
242
|
+
OSRow,
|
|
243
|
+
|
|
244
|
+
FormInput,
|
|
245
|
+
FormSide,
|
|
246
|
+
ButtonsWrapper,
|
|
247
|
+
LoginWith,
|
|
248
|
+
OTab,
|
|
249
|
+
OTabs,
|
|
250
|
+
|
|
251
|
+
OSItem,
|
|
252
|
+
OSItemContent,
|
|
253
|
+
OSItemActions,
|
|
254
|
+
|
|
255
|
+
Alert,
|
|
256
|
+
|
|
257
|
+
//Types
|
|
258
|
+
LoginParams,
|
|
259
|
+
ProfileParams,
|
|
260
|
+
AddressListParams,
|
|
261
|
+
AddressFormParams,
|
|
262
|
+
SignupParams,
|
|
263
|
+
PhoneInputParams,
|
|
264
|
+
LanguageSelectorParams,
|
|
265
|
+
BusinessesListingParams,
|
|
266
|
+
HighestRatedBusinessesParams,
|
|
267
|
+
BusinessTypeFilterParams,
|
|
268
|
+
BusinessControllerParams,
|
|
269
|
+
BusinessProductsListingParams,
|
|
270
|
+
BusinessBasicInformationParams,
|
|
271
|
+
BusinessProductsCategoriesParams,
|
|
272
|
+
BusinessProductsListParams,
|
|
273
|
+
SingleProductCardParams,
|
|
274
|
+
BusinessInformationParams,
|
|
275
|
+
BusinessReviewsParams,
|
|
276
|
+
SearchBarParams,
|
|
277
|
+
NotFoundSourceParams,
|
|
278
|
+
OrdersOptionParams,
|
|
279
|
+
ActiveOrdersParams,
|
|
280
|
+
PreviousOrdersParams,
|
|
281
|
+
OrderDetailsParams,
|
|
282
|
+
ReviewDriverParams,
|
|
133
283
|
|
|
134
284
|
// OComponents
|
|
135
285
|
Toast,
|
|
@@ -151,6 +301,7 @@ export {
|
|
|
151
301
|
// layout
|
|
152
302
|
Container,
|
|
153
303
|
SafeAreaContainer,
|
|
304
|
+
FloatingBottomContainer,
|
|
154
305
|
NavBar,
|
|
155
306
|
|
|
156
307
|
// utils
|
|
@@ -140,7 +140,7 @@ const AddressListUI = (props: AddressListParams) => {
|
|
|
140
140
|
<AddressListContainer>
|
|
141
141
|
{isProfile && (
|
|
142
142
|
<NavBar
|
|
143
|
-
title={t('
|
|
143
|
+
title={t('SAVED_PLACES', 'My saved places')}
|
|
144
144
|
titleAlign={'center'}
|
|
145
145
|
onActionLeft={() => goToBack()}
|
|
146
146
|
showCall={false}
|