ordering-ui-react-native 0.17.66 → 0.17.67
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/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +23 -23
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
- package/themes/original/index.tsx +2 -0
- package/themes/original/src/components/BusinessController/index.tsx +16 -2
- package/themes/original/src/components/BusinessController/styles.tsx +13 -1
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessProductsListing/index.tsx +1 -0
- package/themes/original/src/components/Cart/index.tsx +31 -2
- package/themes/original/src/components/FloatingButton/index.tsx +13 -11
- package/themes/original/src/components/Messages/index.tsx +15 -0
- package/themes/original/src/components/MultiCart/index.tsx +63 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +6 -7
- package/themes/original/src/components/MultiCheckout/index.tsx +4 -2
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +14 -0
- package/themes/original/src/components/OrdersOption/index.tsx +32 -2
- package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/SingleOrderCard/index.tsx +54 -19
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -1
- package/themes/original/src/types/index.tsx +2 -0
package/package.json
CHANGED
|
@@ -333,7 +333,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
333
333
|
<View style={{ marginTop: 10 }}>
|
|
334
334
|
{order?.delivery_option !== undefined && order?.delivery_type === 1 && (
|
|
335
335
|
<OText>
|
|
336
|
-
{order?.delivery_option?.name}
|
|
336
|
+
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
337
337
|
</OText>
|
|
338
338
|
)}
|
|
339
339
|
{!!order?.comment && (
|
|
@@ -378,7 +378,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
378
378
|
<Table>
|
|
379
379
|
<OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
380
380
|
<OText mBottom={4}>
|
|
381
|
-
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: order?.currency})}
|
|
381
|
+
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: order?.currency })}
|
|
382
382
|
</OText>
|
|
383
383
|
</Table>
|
|
384
384
|
{(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
|
|
@@ -391,7 +391,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
391
391
|
) : (
|
|
392
392
|
<OText mBottom={4}>{t('DISCOUNT', theme?.defaultLanguages?.DISCOUNT || 'Discount')}</OText>
|
|
393
393
|
)}
|
|
394
|
-
<OText>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: order?.currency})}</OText>
|
|
394
|
+
<OText>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: order?.currency })}</OText>
|
|
395
395
|
</Table>
|
|
396
396
|
)}
|
|
397
397
|
{
|
|
@@ -399,13 +399,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
399
399
|
<Table key={offer.id}>
|
|
400
400
|
<OSRow>
|
|
401
401
|
<OText mBottom={4}>
|
|
402
|
-
{offer.name}
|
|
402
|
+
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
403
403
|
{offer.rate_type === 1 && (
|
|
404
404
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
405
405
|
)}
|
|
406
406
|
</OText>
|
|
407
407
|
</OSRow>
|
|
408
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency})}</OText>
|
|
408
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
409
409
|
</Table>
|
|
410
410
|
))
|
|
411
411
|
}
|
|
@@ -413,9 +413,9 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
413
413
|
<Table>
|
|
414
414
|
<OText mBottom={4}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
|
|
415
415
|
{order?.tax_type === 1 ? (
|
|
416
|
-
<OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: order?.currency})}</OText>
|
|
416
|
+
<OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: order?.currency })}</OText>
|
|
417
417
|
) : (
|
|
418
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: order?.currency})}</OText>
|
|
418
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: order?.currency })}</OText>
|
|
419
419
|
)}
|
|
420
420
|
</Table>
|
|
421
421
|
)}
|
|
@@ -425,7 +425,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
425
425
|
{t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
|
|
426
426
|
</OText>
|
|
427
427
|
<OText mBottom={4}>
|
|
428
|
-
{parsePrice(order?.summary?.tax ?? 0, { currency: order?.currency})}
|
|
428
|
+
{parsePrice(order?.summary?.tax ?? 0, { currency: order?.currency })}
|
|
429
429
|
</OText>
|
|
430
430
|
</Table>
|
|
431
431
|
)}
|
|
@@ -436,7 +436,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
436
436
|
{t('SERVICE_FEE', 'Service fee')}
|
|
437
437
|
{`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
|
|
438
438
|
</OText>
|
|
439
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0, { currency: order?.currency})}</OText>
|
|
439
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0, { currency: order?.currency })}</OText>
|
|
440
440
|
</Table>
|
|
441
441
|
)
|
|
442
442
|
}
|
|
@@ -445,11 +445,11 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
445
445
|
<Table key={tax.id}>
|
|
446
446
|
<OSRow>
|
|
447
447
|
<OText mBottom={4}>
|
|
448
|
-
{tax
|
|
448
|
+
{t(tax?.name?.toUpperCase()?.replace(/ /g, '_'), tax?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
449
449
|
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
450
450
|
</OText>
|
|
451
451
|
</OSRow>
|
|
452
|
-
<OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: order?.currency})}</OText>
|
|
452
|
+
<OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: order?.currency })}</OText>
|
|
453
453
|
</Table>
|
|
454
454
|
))
|
|
455
455
|
}
|
|
@@ -458,11 +458,11 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
458
458
|
<Table key={fee.id}>
|
|
459
459
|
<OSRow>
|
|
460
460
|
<OText mBottom={4}>
|
|
461
|
-
{fee
|
|
462
|
-
({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: order?.currency})} + `}{fee.percentage}%){' '}
|
|
461
|
+
{t(fee?.name?.toUpperCase()?.replace(/ /g, '_'), fee?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
462
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: order?.currency })} + `}{fee.percentage}%){' '}
|
|
463
463
|
</OText>
|
|
464
464
|
</OSRow>
|
|
465
|
-
<OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: order?.currency})}</OText>
|
|
465
|
+
<OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: order?.currency })}</OText>
|
|
466
466
|
</Table>
|
|
467
467
|
))
|
|
468
468
|
}
|
|
@@ -471,13 +471,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
471
471
|
<Table key={offer.id}>
|
|
472
472
|
<OSRow>
|
|
473
473
|
<OText mBottom={4}>
|
|
474
|
-
{offer.name}
|
|
474
|
+
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
475
475
|
{offer.rate_type === 1 && (
|
|
476
476
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
477
477
|
)}
|
|
478
478
|
</OText>
|
|
479
479
|
</OSRow>
|
|
480
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency})}</OText>
|
|
480
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
481
481
|
</Table>
|
|
482
482
|
))
|
|
483
483
|
}
|
|
@@ -489,7 +489,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
489
489
|
</OText>
|
|
490
490
|
|
|
491
491
|
<OText mBottom={4}>
|
|
492
|
-
{parsePrice(order?.summary?.delivery_price, { currency: order?.currency})}
|
|
492
|
+
{parsePrice(order?.summary?.delivery_price, { currency: order?.currency })}
|
|
493
493
|
</OText>
|
|
494
494
|
</Table>
|
|
495
495
|
)
|
|
@@ -499,13 +499,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
499
499
|
<Table key={offer.id}>
|
|
500
500
|
<OSRow>
|
|
501
501
|
<OText mBottom={4}>
|
|
502
|
-
{offer.name}
|
|
502
|
+
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
503
503
|
{offer.rate_type === 1 && (
|
|
504
504
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
505
505
|
)}
|
|
506
506
|
</OText>
|
|
507
507
|
</OSRow>
|
|
508
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency})}</OText>
|
|
508
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
509
509
|
</Table>
|
|
510
510
|
))
|
|
511
511
|
}
|
|
@@ -520,7 +520,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
520
520
|
`(${verifyDecimals(order?.summary?.driver_tip, parseNumber)}%)`
|
|
521
521
|
)}
|
|
522
522
|
</OText>
|
|
523
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency})}</OText>
|
|
523
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency })}</OText>
|
|
524
524
|
</Table>
|
|
525
525
|
)}
|
|
526
526
|
|
|
@@ -534,7 +534,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
534
534
|
mBottom={4}
|
|
535
535
|
style={styles.textBold}
|
|
536
536
|
color={theme.colors.primary}>
|
|
537
|
-
{parsePrice(order?.summary?.total ?? order?.total, { currency: order?.currency})}
|
|
537
|
+
{parsePrice(order?.summary?.total ?? order?.total, { currency: order?.currency })}
|
|
538
538
|
</OText>
|
|
539
539
|
</Table>
|
|
540
540
|
</Total>
|
|
@@ -568,7 +568,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
568
568
|
<OText>
|
|
569
569
|
{event?.wallet_event
|
|
570
570
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
571
|
-
: event?.paymethod?.name}
|
|
571
|
+
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
|
|
572
572
|
</OText>
|
|
573
573
|
{event?.data?.charge_id && (
|
|
574
574
|
<OText>
|
|
@@ -577,7 +577,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
577
577
|
)}
|
|
578
578
|
</View>
|
|
579
579
|
<OText>
|
|
580
|
-
-{parsePrice(event.amount, { currency: order?.currency})}
|
|
580
|
+
-{parsePrice(event.amount, { currency: order?.currency })}
|
|
581
581
|
</OText>
|
|
582
582
|
</View>
|
|
583
583
|
))}
|
|
@@ -271,7 +271,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
271
271
|
{order?.delivery_option && (
|
|
272
272
|
<OText size={13}>
|
|
273
273
|
<OText size={13} weight='bold'>{`${t('DELIVERY_PREFERENCE', 'Delivery Preference')}: `}</OText>
|
|
274
|
-
{order?.delivery_option?.name}
|
|
274
|
+
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
275
275
|
</OText>
|
|
276
276
|
)}
|
|
277
277
|
{order?.payment_events?.length > 0 && (
|
|
@@ -286,8 +286,8 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
286
286
|
? `${walletName[event?.wallet_event?.wallet?.type]?.name} - `
|
|
287
287
|
: walletName[event?.wallet_event?.wallet?.type]?.name
|
|
288
288
|
: idx < order?.payment_events?.length - 1
|
|
289
|
-
? `${event?.paymethod?.name} - `
|
|
290
|
-
: event?.paymethod?.name
|
|
289
|
+
? `${t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)} - `
|
|
290
|
+
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)
|
|
291
291
|
})}
|
|
292
292
|
</OText>
|
|
293
293
|
</View>
|
|
@@ -68,6 +68,7 @@ import { SingleProductCard } from './src/components/SingleProductCard';
|
|
|
68
68
|
import { SingleOrderCard } from './src/components/SingleOrderCard';
|
|
69
69
|
import { UpsellingRedirect } from './src/components/BusinessProductsListing/UpsellingRedirect';
|
|
70
70
|
import { ProductItemAccordion } from './src/components/ProductItemAccordion';
|
|
71
|
+
import { ScheduleAccordion } from './src/components/ScheduleAccordion';
|
|
71
72
|
import { BusinessItemAccordion } from './src/components/BusinessItemAccordion';
|
|
72
73
|
import { CouponControl } from './src/components/CouponControl';
|
|
73
74
|
import { TaxInformation } from './src/components/TaxInformation';
|
|
@@ -231,6 +232,7 @@ export {
|
|
|
231
232
|
SingleOrderCard,
|
|
232
233
|
UpsellingRedirect,
|
|
233
234
|
ProductItemAccordion,
|
|
235
|
+
ScheduleAccordion,
|
|
234
236
|
BusinessItemAccordion,
|
|
235
237
|
CouponControl,
|
|
236
238
|
TaxInformation,
|
|
@@ -25,7 +25,8 @@ import {
|
|
|
25
25
|
BusinessLogo,
|
|
26
26
|
Reviews,
|
|
27
27
|
RibbonBox,
|
|
28
|
-
ReviewAndFavorite
|
|
28
|
+
ReviewAndFavorite,
|
|
29
|
+
OfferBox
|
|
29
30
|
} from './styles';
|
|
30
31
|
import { useTheme } from 'styled-components/native';
|
|
31
32
|
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome5';
|
|
@@ -50,7 +51,8 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
50
51
|
businessPickupTime,
|
|
51
52
|
businessDistance,
|
|
52
53
|
handleFavoriteBusiness,
|
|
53
|
-
enableIntersection
|
|
54
|
+
enableIntersection,
|
|
55
|
+
getBusinessOffer
|
|
54
56
|
} = props;
|
|
55
57
|
|
|
56
58
|
const [{ parsePrice, parseDistance, parseNumber, optimizeImage }] = useUtils();
|
|
@@ -201,6 +203,18 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
201
203
|
<FontAwesomeIcon name="crown" size={26} color="gold" />
|
|
202
204
|
</View>
|
|
203
205
|
)}
|
|
206
|
+
{(!isCustomLayout) && (
|
|
207
|
+
getBusinessOffer((business?.offers)) &&
|
|
208
|
+
<OfferBox>
|
|
209
|
+
<OText
|
|
210
|
+
size={10}
|
|
211
|
+
weight={'400'}
|
|
212
|
+
numberOfLines={2}
|
|
213
|
+
ellipsizeMode='tail'
|
|
214
|
+
lineHeight={13}
|
|
215
|
+
>{getBusinessOffer((business?.offers)) || parsePrice(0)}</OText>
|
|
216
|
+
</OfferBox>
|
|
217
|
+
)}
|
|
204
218
|
<BusinessState>
|
|
205
219
|
{!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1') && (
|
|
206
220
|
<View style={styles.businessStateView}>
|
|
@@ -39,7 +39,7 @@ export const BusinessState = styled.View`
|
|
|
39
39
|
`
|
|
40
40
|
|
|
41
41
|
export const BusinessLogo = styled.View`
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
`
|
|
44
44
|
|
|
45
45
|
export const ReviewAndFavorite = styled.View`
|
|
@@ -73,3 +73,15 @@ export const RibbonBox = styled.View`
|
|
|
73
73
|
border-radius: 50px;
|
|
74
74
|
`}
|
|
75
75
|
`
|
|
76
|
+
|
|
77
|
+
export const OfferBox = styled.View`
|
|
78
|
+
position: absolute;
|
|
79
|
+
z-index: 1;
|
|
80
|
+
top: 20px;
|
|
81
|
+
right: 10px;
|
|
82
|
+
border-radius: 50px;
|
|
83
|
+
color: ${(props: any) => props.theme.colors.textThird};
|
|
84
|
+
background: ${(props: any) => props.theme.colors.inputBorderColor};
|
|
85
|
+
padding: 3px 8px;
|
|
86
|
+
max-width: 180px;
|
|
87
|
+
`
|
|
@@ -16,26 +16,19 @@ import {
|
|
|
16
16
|
DivideView,
|
|
17
17
|
MediaWrapper,
|
|
18
18
|
} from './styles';
|
|
19
|
-
import {
|
|
19
|
+
import { StyleSheet, View } from 'react-native';
|
|
20
20
|
import { BusinessInformationParams } from '../../types';
|
|
21
21
|
import { GoogleMap } from '../GoogleMap';
|
|
22
22
|
import { WebView } from 'react-native-webview';
|
|
23
23
|
import { formatUrlVideo } from '../../utils'
|
|
24
|
+
import { ScheduleAccordion } from '../ScheduleAccordion';
|
|
24
25
|
const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
25
26
|
const { businessState, businessSchedule, businessLocation } = props;
|
|
26
27
|
|
|
27
28
|
const theme = useTheme();
|
|
28
29
|
const [, t] = useLanguage();
|
|
29
30
|
const [{ optimizeImage }] = useUtils();
|
|
30
|
-
|
|
31
|
-
t('SUNDAY_ABBREVIATION', 'Sun'),
|
|
32
|
-
t('MONDAY_ABBREVIATION', 'Mon'),
|
|
33
|
-
t('TUESDAY_ABBREVIATION', 'Tues'),
|
|
34
|
-
t('WEDNESDAY_ABBREVIATION', 'Wed'),
|
|
35
|
-
t('THURSDAY_ABBREVIATION', 'Thur'),
|
|
36
|
-
t('FRIDAY_ABBREVIATION', 'Fri'),
|
|
37
|
-
t('SATURDAY_ABBREVIATION', 'Sat'),
|
|
38
|
-
];
|
|
31
|
+
|
|
39
32
|
const scheduleFormatted = ({
|
|
40
33
|
hour,
|
|
41
34
|
minute,
|
|
@@ -112,25 +105,11 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
|
112
105
|
<WrapScheduleBlock>
|
|
113
106
|
{businessSchedule.map((schedule: any, i: number) => (
|
|
114
107
|
<ScheduleBlock key={i}>
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
style={{ flexBasis: '20%' }}>
|
|
121
|
-
{daysOfWeek[i].toUpperCase()}
|
|
122
|
-
</OText>
|
|
123
|
-
{schedule.enabled ? (
|
|
124
|
-
<OText mBottom={16}>
|
|
125
|
-
{scheduleFormatted(schedule.lapses[0].open) +
|
|
126
|
-
' - ' +
|
|
127
|
-
scheduleFormatted(schedule.lapses[0].close)}
|
|
128
|
-
</OText>
|
|
129
|
-
) : (
|
|
130
|
-
<OText color={theme.colors.red} mBottom={16}>
|
|
131
|
-
{t('CLOSED', 'Closed')}
|
|
132
|
-
</OText>
|
|
133
|
-
)}
|
|
108
|
+
<ScheduleAccordion
|
|
109
|
+
weekIndex={i}
|
|
110
|
+
scheduleFormatted={scheduleFormatted}
|
|
111
|
+
schedule={schedule}
|
|
112
|
+
/>
|
|
134
113
|
</ScheduleBlock>
|
|
135
114
|
))}
|
|
136
115
|
</WrapScheduleBlock>
|
|
@@ -152,10 +131,10 @@ const BusinessInformationUI = (props: BusinessInformationParams) => {
|
|
|
152
131
|
style={{ width: 210, height: 127, borderRadius: 7.6 }}
|
|
153
132
|
javaScriptEnabled={true}
|
|
154
133
|
domStorageEnabled={true}
|
|
155
|
-
source={{
|
|
134
|
+
source={{
|
|
156
135
|
html: `
|
|
157
136
|
<iframe width='80%' height='80%' src="${formatUrlVideo(v.video)}" frameBorder='0' allow='autoplay; encrypted-media' allowFullScreen />
|
|
158
|
-
`,
|
|
137
|
+
`,
|
|
159
138
|
}}
|
|
160
139
|
mediaPlaybackRequiresUserAction={true}
|
|
161
140
|
/>
|
|
@@ -530,6 +530,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
530
530
|
btnLeftValue={currentCart?.products.reduce((prev: number, product: any) => prev + product.quantity, 0)}
|
|
531
531
|
btnRightValue={parsePrice(currentCart?.total)}
|
|
532
532
|
disabled={subtotalWithTaxes < currentCart?.minimum || openUpselling}
|
|
533
|
+
hideButton={isCheckoutMultiBusinessEnabled}
|
|
533
534
|
handleClick={() => setOpenUpselling(true)}
|
|
534
535
|
/>
|
|
535
536
|
</View>
|
|
@@ -104,9 +104,38 @@ const CartUI = (props: any) => {
|
|
|
104
104
|
const handleUpsellingPage = () => {
|
|
105
105
|
setOpenUpselling(false)
|
|
106
106
|
setCanOpenUpselling(false)
|
|
107
|
-
|
|
107
|
+
const cartSelectedHasGroup = cart?.group?.uuid
|
|
108
|
+
const cartFilterValidation = (cart : any) => cart?.valid && cart?.status !== 2
|
|
109
|
+
const cartsGroupLength = cartSelectedHasGroup ? Object.values(orderState.carts).filter((_cart : any) => _cart?.group?.uuid === cartSelectedHasGroup && cartFilterValidation(_cart))?.length : 0
|
|
110
|
+
if (cartsGroupLength > 1 && isCheckoutMultiBusinessEnabled) {
|
|
108
111
|
props.onNavigationRedirect('CheckoutNavigator', {
|
|
109
|
-
screen: 'MultiCheckout'
|
|
112
|
+
screen: 'MultiCheckout',
|
|
113
|
+
cartUuid: cart?.group?.uuid
|
|
114
|
+
})
|
|
115
|
+
return
|
|
116
|
+
}
|
|
117
|
+
const cartGroupsCount : any = {}
|
|
118
|
+
Object.values(orderState.carts).filter(_cart => cartFilterValidation(_cart))?.forEach((_cart : any) => {
|
|
119
|
+
if (cartGroupsCount[_cart?.group?.uuid]) {
|
|
120
|
+
cartGroupsCount[_cart?.group?.uuid] += 1
|
|
121
|
+
} else {
|
|
122
|
+
cartGroupsCount[_cart?.group?.uuid] = 1
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
let groupForTheCart
|
|
126
|
+
const groupForAddCartArray = Object.keys(cartGroupsCount).filter(cartGroupUuid => cartGroupsCount[cartGroupUuid] > 0 && cartGroupsCount[cartGroupUuid] < 5)
|
|
127
|
+
const max = Math.max(...groupForAddCartArray.map(uuid => cartGroupsCount[uuid]))
|
|
128
|
+
const indexes = groupForAddCartArray.filter(uuid => cartGroupsCount[uuid] === max)
|
|
129
|
+
if (indexes?.length > 1) {
|
|
130
|
+
groupForTheCart = indexes.find(uuid => uuid !== 'undefined')
|
|
131
|
+
} else {
|
|
132
|
+
groupForTheCart = indexes[0]
|
|
133
|
+
}
|
|
134
|
+
if (isCheckoutMultiBusinessEnabled && openCarts.length > 1 && groupForTheCart) {
|
|
135
|
+
props.onNavigationRedirect('CheckoutNavigator', {
|
|
136
|
+
screen: 'MultiCart',
|
|
137
|
+
cartUuid: cart.uuid,
|
|
138
|
+
cartGroup: groupForTheCart === 'undefined' ? 'create' : groupForTheCart
|
|
110
139
|
})
|
|
111
140
|
} else {
|
|
112
141
|
props.onNavigationRedirect('CheckoutNavigator', {
|
|
@@ -22,7 +22,8 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
|
|
|
22
22
|
disabled,
|
|
23
23
|
isSecondaryBtn,
|
|
24
24
|
handleEmpty,
|
|
25
|
-
iosBottom
|
|
25
|
+
iosBottom,
|
|
26
|
+
hideButton
|
|
26
27
|
} = props;
|
|
27
28
|
|
|
28
29
|
const [, t] = useLanguage();
|
|
@@ -77,16 +78,17 @@ const FloatingButtonUI = (props: FloatingButtonParams) => {
|
|
|
77
78
|
</View>
|
|
78
79
|
)}
|
|
79
80
|
</View>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
{!hideButton && (
|
|
82
|
+
<Button
|
|
83
|
+
style={[isSecondaryBtn ? styles.secondaryBtn : styles.primaryBtn]}
|
|
84
|
+
onPress={handleButtonClick}
|
|
85
|
+
disabled={disabled}
|
|
86
|
+
>
|
|
87
|
+
<OText color={isSecondaryBtn ? theme.colors.textSecondary : theme.colors.white} lineHeight={24} size={14} weight={'400'}>
|
|
88
|
+
{btnText}
|
|
89
|
+
</OText>
|
|
90
|
+
</Button>
|
|
91
|
+
)}
|
|
90
92
|
</Container>
|
|
91
93
|
);
|
|
92
94
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import Clipboard from '@react-native-clipboard/clipboard';
|
|
2
3
|
import { Messages as MessagesController, useSession, useUtils, useLanguage, ToastType, useToast } from 'ordering-components/native'
|
|
3
4
|
import { useTheme } from 'styled-components/native';
|
|
4
5
|
import { launchImageLibrary } from 'react-native-image-picker'
|
|
@@ -397,6 +398,19 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
397
398
|
}
|
|
398
399
|
}
|
|
399
400
|
|
|
401
|
+
const onLongPress = (context: any, message: any) => {
|
|
402
|
+
const options = [
|
|
403
|
+
t('COPY_TEXT', 'Copy text'),
|
|
404
|
+
t('CANCEL', 'Cancel'),
|
|
405
|
+
];
|
|
406
|
+
const cancelButtonIndex = options.length - 1;
|
|
407
|
+
context.actionSheet().showActionSheetWithOptions({
|
|
408
|
+
options,
|
|
409
|
+
cancelButtonIndex
|
|
410
|
+
}, (buttonIndex: any) => buttonIndex === 0 && Clipboard.setString(message.text)
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
|
|
400
414
|
return (
|
|
401
415
|
<View style={{ height: getViewHeight(), width: '100%', paddingTop: 12, backgroundColor: 'white' }}>
|
|
402
416
|
<Wrapper>
|
|
@@ -473,6 +487,7 @@ const MessagesUI = (props: MessagesParams) => {
|
|
|
473
487
|
onSend={onSubmit}
|
|
474
488
|
onInputTextChanged={onChangeMessage}
|
|
475
489
|
alignTop
|
|
490
|
+
onLongPress={(context: any, message: any) => onLongPress(context, message)}
|
|
476
491
|
scrollToBottom
|
|
477
492
|
renderAvatarOnTop
|
|
478
493
|
renderUsernameOnMessage
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ChAddress, ChContainer, ChSection, ChUserDetails, DeliveryOptionsContainer } from '../Checkout/styles'
|
|
3
|
+
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
|
|
4
|
+
import { Container } from '../../layouts/Container';
|
|
5
|
+
import { View, StyleSheet } from 'react-native'
|
|
6
|
+
import { useTheme } from 'styled-components/native';
|
|
7
|
+
import { MultiCartCreate } from 'ordering-components/native'
|
|
8
|
+
|
|
9
|
+
export const MultiCartUI = () => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
|
|
12
|
+
const styles = StyleSheet.create({
|
|
13
|
+
pagePadding: {
|
|
14
|
+
paddingHorizontal: 40
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<Container noPadding>
|
|
21
|
+
<ChContainer style={styles.pagePadding}>
|
|
22
|
+
<ChSection>
|
|
23
|
+
<ChUserDetails>
|
|
24
|
+
<Placeholder Animation={Fade}>
|
|
25
|
+
<PlaceholderLine height={20} />
|
|
26
|
+
<PlaceholderLine height={12} />
|
|
27
|
+
<PlaceholderLine height={12} />
|
|
28
|
+
<PlaceholderLine height={12} style={{ marginBottom: 20 }} />
|
|
29
|
+
</Placeholder>
|
|
30
|
+
</ChUserDetails>
|
|
31
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
|
|
32
|
+
</ChSection>
|
|
33
|
+
<DeliveryOptionsContainer>
|
|
34
|
+
<View style={{ height: 110 }}>
|
|
35
|
+
<Placeholder Animation={Fade}>
|
|
36
|
+
<PlaceholderLine height={20} />
|
|
37
|
+
<PlaceholderLine height={40} />
|
|
38
|
+
</Placeholder>
|
|
39
|
+
</View>
|
|
40
|
+
</DeliveryOptionsContainer>
|
|
41
|
+
<ChSection>
|
|
42
|
+
<ChAddress>
|
|
43
|
+
<Placeholder Animation={Fade}>
|
|
44
|
+
<PlaceholderLine height={20} style={{ marginBottom: 50 }} />
|
|
45
|
+
<PlaceholderLine height={100} />
|
|
46
|
+
</Placeholder>
|
|
47
|
+
</ChAddress>
|
|
48
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
49
|
+
</ChSection>
|
|
50
|
+
</ChContainer>
|
|
51
|
+
</Container>
|
|
52
|
+
|
|
53
|
+
</>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const MultiCart = (props : any) => {
|
|
58
|
+
const mulcartProps = {
|
|
59
|
+
...props,
|
|
60
|
+
UIComponent: MultiCartUI
|
|
61
|
+
}
|
|
62
|
+
return <MultiCartCreate {...mulcartProps} />
|
|
63
|
+
}
|
|
@@ -25,7 +25,6 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
25
25
|
businessIds,
|
|
26
26
|
paymethodsAndWallets,
|
|
27
27
|
walletsState,
|
|
28
|
-
businessPaymethods,
|
|
29
28
|
paymethodSelected,
|
|
30
29
|
handleSelectPaymethod,
|
|
31
30
|
handleSelectWallet,
|
|
@@ -77,24 +76,24 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
77
76
|
const renderPaymethods = ({ item }: any) => {
|
|
78
77
|
return (
|
|
79
78
|
<TouchableOpacity
|
|
80
|
-
onPress={() => handleSelectPaymethod(item)}
|
|
79
|
+
onPress={() => handleSelectPaymethod({ ...item, paymethod: { gateway: item.gateway }, paymethod_id: item?.id })}
|
|
81
80
|
>
|
|
82
81
|
<PMItem
|
|
83
82
|
key={item.id}
|
|
84
|
-
isActive={paymethodSelected?.
|
|
83
|
+
isActive={paymethodSelected?.id === item.id}
|
|
85
84
|
>
|
|
86
85
|
<OIcon
|
|
87
86
|
src={getPayIcon(item.paymethod?.gateway)}
|
|
88
87
|
width={20}
|
|
89
88
|
height={20}
|
|
90
|
-
color={paymethodSelected?.
|
|
89
|
+
color={paymethodSelected?.id === item.id ? theme.colors.white : theme.colors.backgroundDark}
|
|
91
90
|
/>
|
|
92
91
|
<OText
|
|
93
92
|
size={10}
|
|
94
93
|
style={{ margin: 0, marginTop: 4 }}
|
|
95
|
-
color={paymethodSelected?.
|
|
94
|
+
color={paymethodSelected?.id === item.id ? theme.colors.white : '#000'}
|
|
96
95
|
>
|
|
97
|
-
{t(item?.
|
|
96
|
+
{t(item?.gateway.toUpperCase(), item?.name)}
|
|
98
97
|
</OText>
|
|
99
98
|
</PMItem>
|
|
100
99
|
</TouchableOpacity>
|
|
@@ -124,7 +123,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
124
123
|
<FlatList
|
|
125
124
|
horizontal
|
|
126
125
|
showsHorizontalScrollIndicator={false}
|
|
127
|
-
data={
|
|
126
|
+
data={paymethodsAndWallets.paymethods}
|
|
128
127
|
renderItem={renderPaymethods}
|
|
129
128
|
keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
|
|
130
129
|
/>
|
|
@@ -53,7 +53,8 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
53
53
|
paymethodSelected,
|
|
54
54
|
handleSelectPaymethod,
|
|
55
55
|
handleSelectWallet,
|
|
56
|
-
handlePaymethodDataChange
|
|
56
|
+
handlePaymethodDataChange,
|
|
57
|
+
cartUuid
|
|
57
58
|
} = props
|
|
58
59
|
|
|
59
60
|
const theme = useTheme();
|
|
@@ -78,7 +79,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
78
79
|
const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
|
|
79
80
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
80
81
|
const maximumCarts = 5
|
|
81
|
-
const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || openCarts.length > maximumCarts
|
|
82
|
+
const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || openCarts.length > maximumCarts || (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data)
|
|
82
83
|
const walletCarts = (Object.values(carts)?.filter((cart: any) => cart?.products && cart?.products?.length && cart?.status !== 2 && cart?.valid_schedule && cart?.valid_products && cart?.valid_address && cart?.valid_maximum && cart?.valid_minimum && cart?.wallets) || null) || []
|
|
83
84
|
|
|
84
85
|
const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(false);
|
|
@@ -225,6 +226,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
225
226
|
handleSelectPaymethod={handleSelectPaymethod}
|
|
226
227
|
handleSelectWallet={handleSelectWallet}
|
|
227
228
|
handlePaymethodDataChange={handlePaymethodDataChange}
|
|
229
|
+
cartUuid={cartUuid}
|
|
228
230
|
/>
|
|
229
231
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
230
232
|
</ChSection>
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
OrdersSummary,
|
|
20
20
|
BorderLine
|
|
21
21
|
} from './styles'
|
|
22
|
+
import { NotFoundSource } from '../NotFoundSource'
|
|
22
23
|
|
|
23
24
|
export const MultiOrdersDetailsUI = (props: any) => {
|
|
24
25
|
const {
|
|
@@ -248,6 +249,19 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
248
249
|
))}
|
|
249
250
|
</>
|
|
250
251
|
)}
|
|
252
|
+
{!loading && (error || orders?.length === 0) && (
|
|
253
|
+
error?.includes('ERROR_ACCESS_EXPIRED') ? (
|
|
254
|
+
<NotFoundSource
|
|
255
|
+
content={t(error[0], 'Sorry, the order has expired.')}
|
|
256
|
+
/>
|
|
257
|
+
) : (
|
|
258
|
+
<NotFoundSource
|
|
259
|
+
content={t('NOT_FOUND_ORDER', theme?.defaultLanguages?.NOT_FOUND_ORDER || 'Sorry, we couldn\'t find the requested order.')}
|
|
260
|
+
btnTitle={t('ORDERS_REDIRECT', theme?.defaultLanguages?.ORDERS_REDIRECT || 'Go to Orders')}
|
|
261
|
+
onClickButton={navigation.navigate('BusinessList')}
|
|
262
|
+
/>
|
|
263
|
+
)
|
|
264
|
+
)}
|
|
251
265
|
<Divider />
|
|
252
266
|
</OrdersDetailsContainer>
|
|
253
267
|
)
|
|
@@ -60,12 +60,42 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
60
60
|
const [, { showToast }] = useToast()
|
|
61
61
|
const { loading, error, orders: values } = orderList
|
|
62
62
|
const [businessLoading, setBusinessLoading] = useState(true)
|
|
63
|
+
const [orders, setOrders] = useState([])
|
|
63
64
|
|
|
64
65
|
const imageFails = activeOrders
|
|
65
66
|
? theme.images.general.emptyActiveOrders
|
|
66
67
|
: theme.images.general.emptyPastOrders
|
|
67
68
|
|
|
68
|
-
const
|
|
69
|
+
const _orders = customArray || values || []
|
|
70
|
+
const uniqueOrders: any = []
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (loading || error) return
|
|
75
|
+
const orders = _orders.map((order: any) => order?.cart_group_id
|
|
76
|
+
? _orders
|
|
77
|
+
.filter((_order : any) => _order?.cart_group_id === order?.cart_group_id)
|
|
78
|
+
?.reduce((orderCompleted : any, currentOrder : any) => ({
|
|
79
|
+
...orderCompleted,
|
|
80
|
+
total: orderCompleted.summary?.total + currentOrder?.summary?.total,
|
|
81
|
+
business: [orderCompleted.business, currentOrder.business].flat(),
|
|
82
|
+
business_id: [orderCompleted.business_id, currentOrder.business_id].flat(),
|
|
83
|
+
id: [orderCompleted.id, currentOrder.id].flat(),
|
|
84
|
+
review: orderCompleted.review && currentOrder.review,
|
|
85
|
+
user_review: orderCompleted.user_review && currentOrder.user_review,
|
|
86
|
+
products: [orderCompleted.products, currentOrder.products].flat()
|
|
87
|
+
}))
|
|
88
|
+
: order)
|
|
89
|
+
.filter((order: any) => {
|
|
90
|
+
const isDuplicate = uniqueOrders.includes(order?.cart_group_id)
|
|
91
|
+
if (!isDuplicate) {
|
|
92
|
+
uniqueOrders.push(order?.cart_group_id)
|
|
93
|
+
return true
|
|
94
|
+
}
|
|
95
|
+
return false
|
|
96
|
+
})
|
|
97
|
+
setOrders(orders)
|
|
98
|
+
}, [JSON.stringify(_orders)])
|
|
69
99
|
|
|
70
100
|
const getOrderStatus = (s: string) => {
|
|
71
101
|
const status = parseInt(s)
|
|
@@ -219,7 +249,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
219
249
|
)}
|
|
220
250
|
</>
|
|
221
251
|
)}
|
|
222
|
-
{isBusiness && !!businessesSearchList && businesses?.loading &&
|
|
252
|
+
{isBusiness && !!businessesSearchList && businesses?.loading && (
|
|
223
253
|
<ScrollView horizontal>
|
|
224
254
|
<BusinessControllerSkeletons paginationProps={businessPaginationProps} />
|
|
225
255
|
</ScrollView>
|
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
ActionContainer,
|
|
12
12
|
SkipButton,
|
|
13
13
|
RatingBarContainer,
|
|
14
|
-
RatingTextContainer
|
|
14
|
+
RatingTextContainer,
|
|
15
|
+
MultiLogosContainer
|
|
15
16
|
} from './styles'
|
|
16
17
|
import { OButton, OIcon, OInput, OText } from '../shared'
|
|
17
18
|
import { TouchableOpacity, StyleSheet, View, I18nManager } from 'react-native';
|
|
@@ -215,14 +216,30 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
|
|
|
215
216
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
216
217
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
217
218
|
/>
|
|
218
|
-
<BusinessLogo>
|
|
219
|
-
|
|
220
|
-
<
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
219
|
+
<BusinessLogo isMulti={order?.business?.length > 1}>
|
|
220
|
+
{typeof order?.logo === 'string' || !order?.logo ? (
|
|
221
|
+
<View style={styles.logoWrapper}>
|
|
222
|
+
<OIcon
|
|
223
|
+
url={order?.logo}
|
|
224
|
+
width={80}
|
|
225
|
+
height={80}
|
|
226
|
+
/>
|
|
227
|
+
</View>
|
|
228
|
+
) : (
|
|
229
|
+
<MultiLogosContainer>
|
|
230
|
+
{order?.logo?.map((logo : string, i : number) => (
|
|
231
|
+
<React.Fragment key={logo}>
|
|
232
|
+
<View style={styles.logoWrapper}>
|
|
233
|
+
<OIcon
|
|
234
|
+
url={logo}
|
|
235
|
+
width={80}
|
|
236
|
+
height={80}
|
|
237
|
+
/>
|
|
238
|
+
</View>
|
|
239
|
+
</React.Fragment>
|
|
240
|
+
))}
|
|
241
|
+
</MultiLogosContainer>
|
|
242
|
+
)}
|
|
226
243
|
</BusinessLogo>
|
|
227
244
|
{order?.review ? (
|
|
228
245
|
<View style={styles.reviewedStyle}>
|
|
@@ -42,3 +42,10 @@ export const RatingTextContainer = styled.View`
|
|
|
42
42
|
justify-content: space-between;
|
|
43
43
|
margin-top: 10px;
|
|
44
44
|
`
|
|
45
|
+
|
|
46
|
+
export const MultiLogosContainer = styled.View`
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: space-around;
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
width: 100%;
|
|
51
|
+
`
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
FormReviews,
|
|
9
9
|
ActionContainer,
|
|
10
10
|
RatingStarContainer,
|
|
11
|
-
PlacedDate
|
|
11
|
+
PlacedDate,
|
|
12
|
+
MultiLogosContainer
|
|
12
13
|
} from './styles'
|
|
13
14
|
import { OButton, OIcon, OText } from '../shared'
|
|
14
15
|
import { StyleSheet, View, I18nManager } from 'react-native';
|
|
@@ -79,13 +80,30 @@ export const ReviewTrigger = (props: any) => {
|
|
|
79
80
|
<>
|
|
80
81
|
<ReviewOrderContainer>
|
|
81
82
|
<BusinessLogo>
|
|
82
|
-
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
{typeof order?.logo === 'string' || !order?.logo ? (
|
|
84
|
+
<View style={styles.logoWrapper}>
|
|
85
|
+
<OIcon
|
|
86
|
+
url={order?.logo}
|
|
87
|
+
width={80}
|
|
88
|
+
height={80}
|
|
89
|
+
/>
|
|
90
|
+
</View>
|
|
91
|
+
) : (
|
|
92
|
+
<MultiLogosContainer>
|
|
93
|
+
{order?.logo?.map((logo : string, i : number) => (
|
|
94
|
+
<React.Fragment key={logo}>
|
|
95
|
+
<View style={styles.logoWrapper}>
|
|
96
|
+
<OIcon
|
|
97
|
+
url={logo}
|
|
98
|
+
width={80}
|
|
99
|
+
height={80}
|
|
100
|
+
/>
|
|
101
|
+
</View>
|
|
102
|
+
</React.Fragment>
|
|
103
|
+
))}
|
|
104
|
+
</MultiLogosContainer>
|
|
105
|
+
|
|
106
|
+
)}
|
|
89
107
|
</BusinessLogo>
|
|
90
108
|
{!!order?.business_name && <OText style={{ textAlign: 'center', marginTop: 15 }} color={theme.colors.textNormal}>{order?.business_name}</OText>}
|
|
91
109
|
<View style={{ flex: 1, justifyContent: 'flex-end' }}>
|
|
@@ -115,4 +133,4 @@ export const ReviewTrigger = (props: any) => {
|
|
|
115
133
|
</FloatingBottomContainer>
|
|
116
134
|
</>
|
|
117
135
|
)
|
|
118
|
-
}
|
|
136
|
+
}
|
|
@@ -31,4 +31,11 @@ export const RatingStarContainer = styled.View`
|
|
|
31
31
|
`
|
|
32
32
|
export const PlacedDate = styled.View`
|
|
33
33
|
margin-top: 30px;
|
|
34
|
-
`
|
|
34
|
+
`
|
|
35
|
+
|
|
36
|
+
export const MultiLogosContainer = styled.View`
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: space-around;
|
|
39
|
+
flex-direction: row;
|
|
40
|
+
width: 100%;
|
|
41
|
+
`
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { Platform, View } from 'react-native'
|
|
3
|
+
import { useLanguage } from 'ordering-components/native';
|
|
4
|
+
import { useTheme } from 'styled-components/native';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Accordion,
|
|
8
|
+
AccordionSection,
|
|
9
|
+
DropdownWrapper,
|
|
10
|
+
} from './styles'
|
|
11
|
+
import { OIcon, OText } from '../shared';
|
|
12
|
+
|
|
13
|
+
export const ScheduleAccordion = (props: any) => {
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
scheduleFormatted,
|
|
17
|
+
schedule,
|
|
18
|
+
weekIndex
|
|
19
|
+
} = props
|
|
20
|
+
|
|
21
|
+
const [isActive, setActiveState] = useState(false)
|
|
22
|
+
const [, t] = useLanguage()
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
|
|
25
|
+
const daysOfWeek = [
|
|
26
|
+
t('DAY7', 'Sunday'),
|
|
27
|
+
t('DAY1', 'Monday'),
|
|
28
|
+
t('DAY2', 'Tuesday'),
|
|
29
|
+
t('DAY3', 'Wednesday'),
|
|
30
|
+
t('DAY4', 'Thursday'),
|
|
31
|
+
t('DAY5', 'Friday'),
|
|
32
|
+
t('DAY6', 'Saturday'),
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<AccordionSection>
|
|
37
|
+
<Accordion
|
|
38
|
+
onPress={() => setActiveState(!isActive)}
|
|
39
|
+
activeOpacity={1}
|
|
40
|
+
>
|
|
41
|
+
<DropdownWrapper>
|
|
42
|
+
<OText
|
|
43
|
+
mBottom={16}
|
|
44
|
+
mRight={8}
|
|
45
|
+
lineHeight={21}
|
|
46
|
+
size={14}
|
|
47
|
+
weight={Platform.OS === 'android' ? 'bold' : '600'}
|
|
48
|
+
>{daysOfWeek[weekIndex]}</OText>
|
|
49
|
+
<OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} />
|
|
50
|
+
</DropdownWrapper>
|
|
51
|
+
<View style={{ display: isActive ? 'flex' : 'none', paddingStart: 20 }}>
|
|
52
|
+
{schedule?.lapses?.map((lapse: any) => (
|
|
53
|
+
schedule?.enabled ?
|
|
54
|
+
<OText mBottom={16}>
|
|
55
|
+
{scheduleFormatted(lapse.open) +
|
|
56
|
+
' - ' +
|
|
57
|
+
scheduleFormatted(lapse.close)}
|
|
58
|
+
</OText>
|
|
59
|
+
:
|
|
60
|
+
<OText color={theme.colors.red} mBottom={16}>
|
|
61
|
+
{t('CLOSED', 'Closed')}
|
|
62
|
+
</OText>
|
|
63
|
+
))}
|
|
64
|
+
</View>
|
|
65
|
+
</Accordion>
|
|
66
|
+
</AccordionSection>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import styled from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const AccordionSection = styled.View`
|
|
4
|
+
background: #FFF;
|
|
5
|
+
`
|
|
6
|
+
|
|
7
|
+
export const Accordion = styled.TouchableOpacity`
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
export const DropdownWrapper = styled.View`
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
`
|
|
@@ -19,7 +19,8 @@ import {
|
|
|
19
19
|
ButtonWrapper,
|
|
20
20
|
ContentFooter,
|
|
21
21
|
UnreadMessageCounter,
|
|
22
|
-
Price
|
|
22
|
+
Price,
|
|
23
|
+
MultiLogosContainer
|
|
23
24
|
} from './styles';
|
|
24
25
|
import { LottieAnimation } from '../LottieAnimation';
|
|
25
26
|
import { CardAnimation } from '../shared/CardAnimation';
|
|
@@ -61,6 +62,11 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
61
62
|
width: 64,
|
|
62
63
|
height: 64
|
|
63
64
|
},
|
|
65
|
+
minilogo: {
|
|
66
|
+
borderRadius: 8,
|
|
67
|
+
width: 40,
|
|
68
|
+
height: 40
|
|
69
|
+
},
|
|
64
70
|
logoWrapper: {
|
|
65
71
|
overflow: 'hidden',
|
|
66
72
|
backgroundColor: 'white',
|
|
@@ -141,11 +147,12 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
141
147
|
order: {
|
|
142
148
|
id: order?.id,
|
|
143
149
|
business_id: order?.business_id,
|
|
144
|
-
logo: order?.business?.logo,
|
|
150
|
+
logo: order?.business?.length > 1 ? order?.business?.map?.((business : any) => business?.logo): order?.business?.logo,
|
|
145
151
|
driver: order?.driver,
|
|
146
152
|
products: order?.products,
|
|
147
153
|
review: order?.review,
|
|
148
|
-
user_review: order?.user_review
|
|
154
|
+
user_review: order?.user_review,
|
|
155
|
+
business: order?.business
|
|
149
156
|
},
|
|
150
157
|
});
|
|
151
158
|
return
|
|
@@ -158,13 +165,16 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
158
165
|
onNavigationRedirect('OrderDetails', { orderId: order?.uuid });
|
|
159
166
|
};
|
|
160
167
|
|
|
161
|
-
const handleClickViewOrder = (
|
|
168
|
+
const handleClickViewOrder = (order: any) => {
|
|
162
169
|
if (isMessageView) {
|
|
163
170
|
handleClickOrder(order?.uuid)
|
|
164
171
|
return
|
|
165
172
|
}
|
|
166
|
-
|
|
167
|
-
onNavigationRedirect('
|
|
173
|
+
if (order?.cart_group_id){
|
|
174
|
+
onNavigationRedirect?.('MultiOrdersDetails', { orderId: order?.cart_group_id });
|
|
175
|
+
} else {
|
|
176
|
+
onNavigationRedirect?.('OrderDetails', { orderId: order?.uuid });
|
|
177
|
+
}
|
|
168
178
|
};
|
|
169
179
|
|
|
170
180
|
const handleChangeFavorite = () => {
|
|
@@ -180,24 +190,49 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
180
190
|
return (
|
|
181
191
|
<>
|
|
182
192
|
<CardAnimation
|
|
183
|
-
onClick={() => handleClickViewOrder(order
|
|
193
|
+
onClick={() => handleClickViewOrder(order)}
|
|
184
194
|
style={[styles.container]}
|
|
185
195
|
>
|
|
186
196
|
<InnerContainer>
|
|
187
197
|
{(!!order.business?.logo || theme?.images?.dummies?.businessLogo) && (
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
198
|
+
<>
|
|
199
|
+
{order?.business?.length > 1 ? (
|
|
200
|
+
<MultiLogosContainer>
|
|
201
|
+
{order?.business?.map((business: any, i: number) => (
|
|
202
|
+
<View key={business?.id}>
|
|
203
|
+
{i > 1 ? (
|
|
204
|
+
<>
|
|
205
|
+
{console.log(order?.business?.length - 2)}
|
|
206
|
+
<OText mRight={3}> + {order?.business?.length - 2}</OText>
|
|
207
|
+
</>
|
|
208
|
+
) : (
|
|
209
|
+
<Logo style={styles.logoWrapper} isMulti>
|
|
210
|
+
<OIcon
|
|
211
|
+
url={optimizeImage(business?.logo, 'h_300,c_limit')}
|
|
212
|
+
src={optimizeImage(!business?.logo && theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
|
|
213
|
+
style={styles.minilogo}
|
|
214
|
+
/>
|
|
215
|
+
</Logo>
|
|
216
|
+
)}
|
|
217
|
+
</View>
|
|
218
|
+
))}
|
|
219
|
+
</MultiLogosContainer>
|
|
220
|
+
) : (
|
|
221
|
+
<Logo style={styles.logoWrapper}>
|
|
222
|
+
<OIcon
|
|
223
|
+
url={optimizeImage(order.business?.logo, 'h_300,c_limit')}
|
|
224
|
+
src={optimizeImage(!order.business?.logo && theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
|
|
225
|
+
style={styles.logo}
|
|
226
|
+
/>
|
|
227
|
+
</Logo>
|
|
228
|
+
)}
|
|
229
|
+
</>
|
|
195
230
|
)}
|
|
196
231
|
<CardInfoWrapper>
|
|
197
232
|
<ContentHeader>
|
|
198
233
|
<View style={{ flex: 1 }}>
|
|
199
234
|
<OText size={12} lineHeight={18} weight={'600'} numberOfLines={1} ellipsizeMode={'tail'}>
|
|
200
|
-
{order.business?.name}
|
|
235
|
+
{order?.business?.length > 1 ? `${t('GROUP_ORDER', 'Group Order')} ${t('No', 'No')}. ${order?.cart_group_id}` : order.business?.name}
|
|
201
236
|
</OText>
|
|
202
237
|
</View>
|
|
203
238
|
{!!!pastOrders && (
|
|
@@ -253,7 +288,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
253
288
|
<ContentFooter>
|
|
254
289
|
<View style={{ flex: 1 }}>
|
|
255
290
|
<View style={styles.infoText}>
|
|
256
|
-
{!!!pastOrders && (
|
|
291
|
+
{(!!!pastOrders || order?.business?.length > 1) && (
|
|
257
292
|
<>
|
|
258
293
|
<OText
|
|
259
294
|
size={10}
|
|
@@ -263,7 +298,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
263
298
|
lineHeight={15}
|
|
264
299
|
numberOfLines={1}
|
|
265
300
|
>
|
|
266
|
-
{t('ORDER_NO', 'Order No') + '.'}
|
|
301
|
+
{order?.business?.length > 1 ? order?.business?.length : (t('ORDER_NO', 'Order No') + '.')}
|
|
267
302
|
</OText>
|
|
268
303
|
<OText
|
|
269
304
|
size={10}
|
|
@@ -272,7 +307,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
272
307
|
lineHeight={15}
|
|
273
308
|
numberOfLines={1}
|
|
274
309
|
>
|
|
275
|
-
{order.id + ` \u2022 `}
|
|
310
|
+
{order?.business?.length > 1 ? t('ORDERS', 'orders') + ' \u2022 ' : order.id + ` \u2022 `}
|
|
276
311
|
</OText>
|
|
277
312
|
</>
|
|
278
313
|
)}
|
|
@@ -297,7 +332,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
297
332
|
{getOrderStatus(order.status)?.value}
|
|
298
333
|
</OText>
|
|
299
334
|
</View>
|
|
300
|
-
{!isMessageView && (
|
|
335
|
+
{!isMessageView && !order?.business?.length && (
|
|
301
336
|
<LottieAnimation
|
|
302
337
|
type='favorite'
|
|
303
338
|
onClick={handleChangeFavorite}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled from 'styled-components/native'
|
|
1
|
+
import styled, { css } from 'styled-components/native'
|
|
2
2
|
|
|
3
3
|
export const InnerContainer = styled.View`
|
|
4
4
|
flex-direction: row;
|
|
@@ -8,6 +8,9 @@ export const InnerContainer = styled.View`
|
|
|
8
8
|
export const Logo = styled.View`
|
|
9
9
|
border-radius: 7.6px;
|
|
10
10
|
margin-right: 12px;
|
|
11
|
+
${({ isMulti } : any) => isMulti && css`
|
|
12
|
+
margin-right: 5px;
|
|
13
|
+
`}
|
|
11
14
|
`
|
|
12
15
|
|
|
13
16
|
export const CardInfoWrapper = styled.View`
|
|
@@ -45,3 +48,9 @@ export const Price = styled.View`
|
|
|
45
48
|
margin-left: 10px;
|
|
46
49
|
width: 30%;
|
|
47
50
|
`
|
|
51
|
+
|
|
52
|
+
export const MultiLogosContainer = styled.View`
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
`
|
|
@@ -222,6 +222,7 @@ export interface BusinessControllerParams {
|
|
|
222
222
|
handleUpdateBusinessList?: any;
|
|
223
223
|
enableIntersection?: boolean;
|
|
224
224
|
isCustomLayout?: boolean;
|
|
225
|
+
getBusinessOffer?: any;
|
|
225
226
|
handleCustomUpdate?: (businessId: number, changes: any) => {};
|
|
226
227
|
}
|
|
227
228
|
export interface BusinessProductsListingParams {
|
|
@@ -529,6 +530,7 @@ export interface FloatingButtonParams {
|
|
|
529
530
|
handleClick?: any;
|
|
530
531
|
handleEmpty?: any;
|
|
531
532
|
iosBottom?: number
|
|
533
|
+
hideButton?: boolean
|
|
532
534
|
}
|
|
533
535
|
export interface MomentOptionParams {
|
|
534
536
|
navigation: any;
|