ordering-ui-react-native 0.17.61 → 0.17.63
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/original/src/components/AddressDetails/index.tsx +9 -7
- package/themes/original/src/components/AddressForm/index.tsx +7 -1
- package/themes/original/src/components/BusinessController/index.tsx +66 -40
- package/themes/original/src/components/BusinessController/styles.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +27 -11
- package/themes/original/src/components/BusinessProductsList/index.tsx +10 -8
- package/themes/original/src/components/BusinessProductsListing/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +17 -44
- package/themes/original/src/components/Checkout/index.tsx +36 -53
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/MyOrders/index.tsx +42 -42
- package/themes/original/src/components/ProductForm/index.tsx +9 -5
- package/themes/original/src/components/ProductForm/styles.tsx +2 -4
- package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -8
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
- package/themes/original/src/components/Promotions/index.tsx +232 -219
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +17 -21
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -0
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/original/src/types/index.tsx +4 -0
|
@@ -153,6 +153,7 @@ const CheckoutUI = (props: any) => {
|
|
|
153
153
|
const isWalletCreditPointsEnabled = businessConfigs.find((config: any) => config.key === 'wallet_credit_point_enabled')?.value === '1'
|
|
154
154
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletCreditPointsEnabled)
|
|
155
155
|
const isBusinessChangeEnabled = configs?.cart_change_business_validation?.value === '1'
|
|
156
|
+
const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
|
|
156
157
|
|
|
157
158
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
158
159
|
const subtotalWithTaxes = cart?.taxes?.reduce((acc: any, item: any) => {
|
|
@@ -162,7 +163,6 @@ const CheckoutUI = (props: any) => {
|
|
|
162
163
|
}, cart?.subtotal)
|
|
163
164
|
const isDisabledButtonPlace = loading || !cart?.valid || (!paymethodSelected && cart?.balance > 0) ||
|
|
164
165
|
placing || errorCash || subtotalWithTaxes < cart?.minimum ||
|
|
165
|
-
// (placeSpotTypes.includes(options?.type) && !cart?.place) ||
|
|
166
166
|
(options.type === 1 &&
|
|
167
167
|
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
168
168
|
validationFields?.fields?.checkout?.driver_tip?.required &&
|
|
@@ -268,10 +268,6 @@ const CheckoutUI = (props: any) => {
|
|
|
268
268
|
}
|
|
269
269
|
}, [errors])
|
|
270
270
|
|
|
271
|
-
// useEffect(() => {
|
|
272
|
-
// handlePaymethodChange(null)
|
|
273
|
-
// }, [cart?.total])
|
|
274
|
-
|
|
275
271
|
useEffect(() => {
|
|
276
272
|
if (cart?.products?.length === 0) {
|
|
277
273
|
onNavigationRedirect('Business', { store: cart?.business?.slug, header: null, logo: null })
|
|
@@ -282,6 +278,21 @@ const CheckoutUI = (props: any) => {
|
|
|
282
278
|
onFailPaypal()
|
|
283
279
|
}, [showGateway.closedByUser])
|
|
284
280
|
|
|
281
|
+
const HeaderTitle = (props: any) => {
|
|
282
|
+
const { text } = props
|
|
283
|
+
return (
|
|
284
|
+
<OText
|
|
285
|
+
size={16}
|
|
286
|
+
lineHeight={24}
|
|
287
|
+
weight={'500'}
|
|
288
|
+
mBottom={props.mb ?? 10}
|
|
289
|
+
color={theme.colors.textNormal}
|
|
290
|
+
>
|
|
291
|
+
{text}
|
|
292
|
+
</OText>
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
|
|
285
296
|
return (
|
|
286
297
|
<>
|
|
287
298
|
<Container noPadding>
|
|
@@ -299,13 +310,20 @@ const CheckoutUI = (props: any) => {
|
|
|
299
310
|
<ChContainer style={styles.pagePadding}>
|
|
300
311
|
<ChSection style={{ paddingTop: 0 }}>
|
|
301
312
|
<ChHeader>
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
313
|
+
<CHMomentWrapper isCustomColor={isChewLayout} onPress={() => navigation.navigate('OrderTypes', { configTypes: configTypes })}>
|
|
314
|
+
<OText
|
|
315
|
+
size={12}
|
|
316
|
+
numberOfLines={1}
|
|
317
|
+
ellipsizeMode={'tail'}
|
|
318
|
+
color={theme.colors?.[isChewLayout ? 'white' : 'textSecondary']}
|
|
319
|
+
>
|
|
320
|
+
{t(getTypesText(options?.type || 1), 'Delivery')}
|
|
321
|
+
</OText>
|
|
305
322
|
<OIcon
|
|
306
323
|
src={theme.images.general.arrow_down}
|
|
307
324
|
width={10}
|
|
308
325
|
style={{ marginStart: 8 }}
|
|
326
|
+
{...(isChewLayout && { color: 'white' })}
|
|
309
327
|
/>
|
|
310
328
|
</CHMomentWrapper>
|
|
311
329
|
<CHMomentWrapper
|
|
@@ -348,9 +366,7 @@ const CheckoutUI = (props: any) => {
|
|
|
348
366
|
Object.values(businessDetails?.business).length > 0 &&
|
|
349
367
|
(
|
|
350
368
|
<>
|
|
351
|
-
<
|
|
352
|
-
{t('BUSINESS_DETAILS', 'Business Details')}
|
|
353
|
-
</OText>
|
|
369
|
+
<HeaderTitle text={t('BUSINESS_DETAILS', 'Business Details')} />
|
|
354
370
|
<View>
|
|
355
371
|
<OText size={12} lineHeight={18} weight={'400'}>
|
|
356
372
|
{businessDetails?.business?.name}
|
|
@@ -369,9 +385,7 @@ const CheckoutUI = (props: any) => {
|
|
|
369
385
|
)}
|
|
370
386
|
{businessDetails?.error && businessDetails?.error?.length > 0 && (
|
|
371
387
|
<View>
|
|
372
|
-
<
|
|
373
|
-
{t('BUSINESS_DETAILS', 'Business Details')}
|
|
374
|
-
</OText>
|
|
388
|
+
<HeaderTitle text={t('BUSINESS_DETAILS', 'Business Details')} />
|
|
375
389
|
<NotFoundSource
|
|
376
390
|
content={businessDetails?.error[0]?.message || businessDetails?.error[0]}
|
|
377
391
|
/>
|
|
@@ -393,6 +407,7 @@ const CheckoutUI = (props: any) => {
|
|
|
393
407
|
) : (
|
|
394
408
|
<UserDetails
|
|
395
409
|
isUserDetailsEdit={isUserDetailsEdit}
|
|
410
|
+
HeaderTitle={<HeaderTitle text={t('CUSTOMER_DETAILS', 'Customer Details')} mb={0} />}
|
|
396
411
|
cartStatus={cart?.status}
|
|
397
412
|
businessId={cart?.business_id}
|
|
398
413
|
useValidationFields
|
|
@@ -417,8 +432,8 @@ const CheckoutUI = (props: any) => {
|
|
|
417
432
|
</Placeholder>
|
|
418
433
|
</View>
|
|
419
434
|
) : (
|
|
420
|
-
|
|
421
|
-
<
|
|
435
|
+
<ChSection>
|
|
436
|
+
<HeaderTitle text={t('DELIVERY_OPTIONS', 'Delivery options')} />
|
|
422
437
|
<View
|
|
423
438
|
style={{
|
|
424
439
|
backgroundColor: theme.colors.inputDisabled,
|
|
@@ -464,7 +479,7 @@ const CheckoutUI = (props: any) => {
|
|
|
464
479
|
/>
|
|
465
480
|
</View>
|
|
466
481
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginHorizontal: -40 }} />
|
|
467
|
-
|
|
482
|
+
</ChSection>
|
|
468
483
|
)}
|
|
469
484
|
|
|
470
485
|
</DeliveryOptionsContainer>
|
|
@@ -486,29 +501,6 @@ const CheckoutUI = (props: any) => {
|
|
|
486
501
|
</ChSection>
|
|
487
502
|
)}
|
|
488
503
|
|
|
489
|
-
{/* <ChSection>
|
|
490
|
-
<ChTotal>
|
|
491
|
-
{
|
|
492
|
-
(
|
|
493
|
-
<>
|
|
494
|
-
<OIcon
|
|
495
|
-
url={businessLogo || businessDetails?.business?.logo}
|
|
496
|
-
width={80}
|
|
497
|
-
height={80}
|
|
498
|
-
borderRadius={80}
|
|
499
|
-
/>
|
|
500
|
-
<View style={{ marginLeft: 10, width: '85%' }}>
|
|
501
|
-
<OText size={22} numberOfLines={2} ellipsizeMode='tail' style={{ width: '85%' }}>
|
|
502
|
-
{businessName || businessDetails?.business?.name}
|
|
503
|
-
</OText>
|
|
504
|
-
<OText size={22}>
|
|
505
|
-
{cart?.total >= 1 && parsePrice(cart?.total) || cartTotal >= 1 && parsePrice(cartTotal)}
|
|
506
|
-
</OText>
|
|
507
|
-
</View>
|
|
508
|
-
</>
|
|
509
|
-
)}
|
|
510
|
-
</ChTotal>
|
|
511
|
-
</ChSection> */}
|
|
512
504
|
<ChSection>
|
|
513
505
|
<ChAddress>
|
|
514
506
|
{(businessDetails?.loading || cartState.loading) ? (
|
|
@@ -525,6 +517,7 @@ const CheckoutUI = (props: any) => {
|
|
|
525
517
|
uuid={cartUuid}
|
|
526
518
|
apiKey={configs?.google_maps_api_key?.value}
|
|
527
519
|
mapConfigs={mapConfigs}
|
|
520
|
+
HeaderTitle={<HeaderTitle text={t('DELIVERY_ADDRESS', 'Delivery address')} mb={0} />}
|
|
528
521
|
/>
|
|
529
522
|
)}
|
|
530
523
|
</ChAddress>
|
|
@@ -541,9 +534,7 @@ const CheckoutUI = (props: any) => {
|
|
|
541
534
|
(
|
|
542
535
|
<ChSection>
|
|
543
536
|
<ChDriverTips>
|
|
544
|
-
<
|
|
545
|
-
{t('DRIVER_TIPS', 'Driver Tips')}
|
|
546
|
-
</OText>
|
|
537
|
+
<HeaderTitle text={t('DRIVER_TIPS', 'Driver Tips')} mb={0} />
|
|
547
538
|
<DriverTips
|
|
548
539
|
uuid={cartUuid}
|
|
549
540
|
businessId={cart?.business_id}
|
|
@@ -562,9 +553,7 @@ const CheckoutUI = (props: any) => {
|
|
|
562
553
|
{!cartState.loading && cart && cart?.status !== 2 && cart?.valid && (
|
|
563
554
|
<ChSection>
|
|
564
555
|
<ChPaymethods>
|
|
565
|
-
<
|
|
566
|
-
{t('PAYMENT_METHOD', 'Payment Method')}
|
|
567
|
-
</OText>
|
|
556
|
+
<HeaderTitle text={t('PAYMENT_METHOD', 'Payment Method')} mb={0} />
|
|
568
557
|
{!cartState.loading && cart?.status === 4 && (
|
|
569
558
|
<OText
|
|
570
559
|
style={{ textAlign: 'center', marginTop: 20 }}
|
|
@@ -630,13 +619,7 @@ const CheckoutUI = (props: any) => {
|
|
|
630
619
|
) : (
|
|
631
620
|
<>
|
|
632
621
|
<CartHeader>
|
|
633
|
-
<
|
|
634
|
-
size={16}
|
|
635
|
-
lineHeight={24}
|
|
636
|
-
color={theme.colors.textNormal}
|
|
637
|
-
>
|
|
638
|
-
{t('MOBILE_FRONT_YOUR_ORDER', 'Your order')}
|
|
639
|
-
</OText>
|
|
622
|
+
<HeaderTitle text={t('MOBILE_FRONT_YOUR_ORDER', 'Your order')} mb={0} />
|
|
640
623
|
<TouchableOpacity
|
|
641
624
|
onPress={() => onNavigationRedirect('Business', { store: cart?.business?.slug })}
|
|
642
625
|
>
|
|
@@ -6,7 +6,7 @@ export const ChContainer = styled.View`
|
|
|
6
6
|
`
|
|
7
7
|
|
|
8
8
|
export const ChSection = styled.View`
|
|
9
|
-
padding-top:
|
|
9
|
+
padding-top: 20px;
|
|
10
10
|
`
|
|
11
11
|
|
|
12
12
|
export const ChHeader = styled.View`
|
|
@@ -40,7 +40,9 @@ export const ChMoment = styled(ChAddress)`
|
|
|
40
40
|
`
|
|
41
41
|
|
|
42
42
|
export const CHMomentWrapper = styled.TouchableOpacity`
|
|
43
|
-
background-color: ${(props: any) => props.
|
|
43
|
+
background-color: ${(props: any) => props.isCustomColor
|
|
44
|
+
? props.theme.colors.primary
|
|
45
|
+
: props.theme.colors.backgroundGray100};
|
|
44
46
|
border-radius: 7.6px;
|
|
45
47
|
font-size: 12px;
|
|
46
48
|
max-width: 240px;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { StyleSheet, useWindowDimensions, Keyboard, View } from 'react-native';
|
|
3
|
+
import { useLanguage, useOrder } from 'ordering-components/native';
|
|
4
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
|
+
import { useTheme } from 'styled-components/native';
|
|
6
|
+
|
|
7
|
+
import { OButton, OIcon, OText } from '../shared';
|
|
8
|
+
|
|
9
|
+
import { CityElement, Container } from './styles'
|
|
10
|
+
|
|
11
|
+
export const CitiesControl = (props: any) => {
|
|
12
|
+
const {
|
|
13
|
+
cities,
|
|
14
|
+
onClose,
|
|
15
|
+
handleChangeCity
|
|
16
|
+
} = props;
|
|
17
|
+
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const [, t] = useLanguage();
|
|
20
|
+
const [orderState] = useOrder();
|
|
21
|
+
const { height } = useWindowDimensions();
|
|
22
|
+
const { top, bottom } = useSafeAreaInsets();
|
|
23
|
+
|
|
24
|
+
const [isKeyboardShow, setIsKeyboardShow] = useState(false);
|
|
25
|
+
const [cityState, setCityState] = useState(orderState?.options?.city_id)
|
|
26
|
+
|
|
27
|
+
const handleClick = () => {
|
|
28
|
+
cityState !== orderState?.options?.city_id && handleChangeCity(cityState)
|
|
29
|
+
onClose && onClose()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const keyboardDidShowListener = Keyboard.addListener(
|
|
34
|
+
'keyboardDidShow',
|
|
35
|
+
() => setIsKeyboardShow(true)
|
|
36
|
+
);
|
|
37
|
+
const keyboardDidHideListener = Keyboard.addListener(
|
|
38
|
+
'keyboardDidHide',
|
|
39
|
+
() => setIsKeyboardShow(false)
|
|
40
|
+
);
|
|
41
|
+
return () => {
|
|
42
|
+
keyboardDidShowListener.remove();
|
|
43
|
+
keyboardDidHideListener.remove();
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Container height={height - top - bottom - 60 - (isKeyboardShow ? 250 : 0)}>
|
|
49
|
+
<View>
|
|
50
|
+
{cities?.map((city: any) => (
|
|
51
|
+
<CityElement
|
|
52
|
+
key={city?.id}
|
|
53
|
+
activeOpacity={1}
|
|
54
|
+
disabled={orderState?.loading}
|
|
55
|
+
onPress={() => setCityState(city?.id === cityState ? null : city?.id)}
|
|
56
|
+
>
|
|
57
|
+
<OIcon
|
|
58
|
+
src={cityState === city?.id
|
|
59
|
+
? theme.images.general.option_checked
|
|
60
|
+
: theme.images.general.option_normal}
|
|
61
|
+
width={16}
|
|
62
|
+
style={{ marginEnd: 24 }}
|
|
63
|
+
/>
|
|
64
|
+
<OText color={theme.colors.black}>
|
|
65
|
+
{city?.name}
|
|
66
|
+
</OText>
|
|
67
|
+
</CityElement>
|
|
68
|
+
))}
|
|
69
|
+
</View>
|
|
70
|
+
<OButton
|
|
71
|
+
text={t('CONTINUE', 'Continue')}
|
|
72
|
+
bgColor={theme.colors.primary}
|
|
73
|
+
borderColor={theme.colors.primary}
|
|
74
|
+
style={styles.btnStyle}
|
|
75
|
+
textStyle={{ color: 'white' }}
|
|
76
|
+
onClick={() => handleClick()}
|
|
77
|
+
/>
|
|
78
|
+
</Container>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const styles = StyleSheet.create({
|
|
83
|
+
btnStyle: {
|
|
84
|
+
marginTop: 20,
|
|
85
|
+
borderRadius: 8,
|
|
86
|
+
shadowOpacity: 0,
|
|
87
|
+
height: 44
|
|
88
|
+
},
|
|
89
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components/native'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.View`
|
|
4
|
+
width: 100%;
|
|
5
|
+
padding: 0 40px;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
padding-bottom: 12px;
|
|
8
|
+
|
|
9
|
+
${(props: any) => props.height && css`
|
|
10
|
+
height: ${props.height}px;
|
|
11
|
+
`}
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
export const CityElement = styled.TouchableOpacity`
|
|
15
|
+
padding: 10px;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
`
|
|
@@ -67,51 +67,51 @@ export const MyOrders = (props: any) => {
|
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
|
-
<Container
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
<Container
|
|
71
|
+
pt={0}
|
|
72
|
+
noPadding
|
|
73
|
+
refreshControl={
|
|
74
|
+
<RefreshControl
|
|
75
|
+
refreshing={refreshing}
|
|
76
|
+
onRefresh={() => handleOnRefresh()}
|
|
77
|
+
/>
|
|
78
|
+
}
|
|
79
|
+
>
|
|
76
80
|
{(isChewLayout || showNavbar) && (
|
|
77
81
|
<View style={{
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
...{
|
|
83
|
+
width: '100%',
|
|
84
|
+
display: 'flex',
|
|
85
|
+
flexDirection: 'row',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
paddingHorizontal: 40,
|
|
88
|
+
marginTop: Platform.OS === 'android' ? 50 : 30,
|
|
89
|
+
},
|
|
90
|
+
...props.titleStyle
|
|
84
91
|
}}>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
textTransform: 'capitalize',
|
|
109
|
-
marginLeft: 20,
|
|
110
|
-
top: 2
|
|
111
|
-
}}
|
|
112
|
-
>
|
|
113
|
-
{t('MY_ORDERS', 'My Orders')}
|
|
114
|
-
</OText>
|
|
92
|
+
{!props.hideBackBtn && (
|
|
93
|
+
<OButton
|
|
94
|
+
imgLeftStyle={{ width: 18 }}
|
|
95
|
+
imgRightSrc={null}
|
|
96
|
+
style={{
|
|
97
|
+
borderWidth: 0,
|
|
98
|
+
width: 26,
|
|
99
|
+
height: 26,
|
|
100
|
+
backgroundColor: '#FFF',
|
|
101
|
+
borderColor: '#FFF',
|
|
102
|
+
shadowColor: '#FFF',
|
|
103
|
+
paddingLeft: 0,
|
|
104
|
+
paddingRight: 0
|
|
105
|
+
}}
|
|
106
|
+
onClick={goToBack}
|
|
107
|
+
icon={AntDesignIcon}
|
|
108
|
+
iconProps={{
|
|
109
|
+
name: 'arrowleft',
|
|
110
|
+
size: 26
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
)}
|
|
114
|
+
<HeaderTitle ph={0} text={t('MY_ORDERS', 'My Orders')} />
|
|
115
115
|
</View>
|
|
116
116
|
)}
|
|
117
117
|
{!hideOrders && !isChewLayout && !showNavbar && (
|
|
@@ -358,7 +358,10 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
358
358
|
useEffect(() => {
|
|
359
359
|
const imageList: any = []
|
|
360
360
|
const videoList: any = []
|
|
361
|
-
product?.images?.length > 0
|
|
361
|
+
imageList.push(product?.images?.length > 0
|
|
362
|
+
? product.images
|
|
363
|
+
: theme?.images?.dummies?.product)
|
|
364
|
+
|
|
362
365
|
if (product?.gallery && product?.gallery.length > 0) {
|
|
363
366
|
for (const img of product?.gallery) {
|
|
364
367
|
if (img?.file) {
|
|
@@ -537,7 +540,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
537
540
|
style={styles.slide1}
|
|
538
541
|
key={i}
|
|
539
542
|
>
|
|
540
|
-
{String(img).includes('
|
|
543
|
+
{(String(img).includes('http') || typeof img === 'number') ? (
|
|
541
544
|
<FastImage
|
|
542
545
|
style={{ height: '100%', opacity: isSoldOut ? 0.5 : 1, aspectRatio: 3 / 2 }}
|
|
543
546
|
source={typeof img !== 'number' ? {
|
|
@@ -548,7 +551,8 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
548
551
|
) : (
|
|
549
552
|
<>
|
|
550
553
|
<YoutubePlayer
|
|
551
|
-
height={
|
|
554
|
+
height={'100%'}
|
|
555
|
+
width={'100%'}
|
|
552
556
|
play={playing}
|
|
553
557
|
videoId={img}
|
|
554
558
|
onChangeState={onStateChange}
|
|
@@ -579,7 +583,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
579
583
|
opacity: index === thumbsSwiper ? 1 : 0.8
|
|
580
584
|
}}
|
|
581
585
|
>
|
|
582
|
-
{String(img).includes('
|
|
586
|
+
{String(img).includes('http') ? (
|
|
583
587
|
<OIcon
|
|
584
588
|
url={img}
|
|
585
589
|
style={{
|
|
@@ -594,7 +598,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
594
598
|
/>
|
|
595
599
|
) : (
|
|
596
600
|
<OIcon
|
|
597
|
-
url={'
|
|
601
|
+
url={'https://img.youtube.com/vi/' + img + '/0.jpg'}
|
|
598
602
|
style={{
|
|
599
603
|
borderColor: theme.colors.lightGray,
|
|
600
604
|
borderRadius: 8,
|
|
@@ -44,9 +44,7 @@ export const ProductTitle = styled.View`
|
|
|
44
44
|
padding-bottom: 7px;
|
|
45
45
|
`
|
|
46
46
|
|
|
47
|
-
export const ProductDescription = styled.View
|
|
48
|
-
margin-bottom: 20px;
|
|
49
|
-
`
|
|
47
|
+
export const ProductDescription = styled.View``
|
|
50
48
|
|
|
51
49
|
export const ProductEditions = styled.View`
|
|
52
50
|
padding: 0 40px;
|
|
@@ -96,7 +94,7 @@ export const WeightUnitItem = styled.View`
|
|
|
96
94
|
`}
|
|
97
95
|
`
|
|
98
96
|
export const ProductSummary = styled.View`
|
|
99
|
-
padding: 26px 40px;
|
|
97
|
+
padding: 26px 40px 0;
|
|
100
98
|
position: relative;
|
|
101
99
|
background-color: white;
|
|
102
100
|
z-index: 100;
|
|
@@ -236,12 +236,12 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
236
236
|
<MaterialCommunityIcon name='chevron-down' size={18} />
|
|
237
237
|
)}
|
|
238
238
|
</View>
|
|
239
|
-
<View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start' }}>
|
|
239
|
+
<View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start', height: 20 }}>
|
|
240
240
|
{onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
|
|
241
|
-
<TouchableOpacity onPress={() => handleEditProduct(product)} style={{
|
|
242
|
-
<
|
|
243
|
-
|
|
244
|
-
|
|
241
|
+
<TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginRight: 5 }}>
|
|
242
|
+
<MaterialCommunityIcon
|
|
243
|
+
name='pencil-outline'
|
|
244
|
+
size={20}
|
|
245
245
|
color={theme.colors.textSecondary}
|
|
246
246
|
/>
|
|
247
247
|
</TouchableOpacity>
|
|
@@ -252,9 +252,9 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
252
252
|
message={t('QUESTION_DELETE_PRODUCT', 'Are you sure that you want to delete the product?')}
|
|
253
253
|
onAccept={() => onDeleteProduct(product)}
|
|
254
254
|
>
|
|
255
|
-
<
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
<MaterialCommunityIcon
|
|
256
|
+
name='trash-can-outline'
|
|
257
|
+
size={20}
|
|
258
258
|
color={theme.colors.textSecondary}
|
|
259
259
|
/>
|
|
260
260
|
</OAlert>
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from 'ordering-components/native'
|
|
7
7
|
import { useTheme } from 'styled-components/native';
|
|
8
8
|
import { StyleSheet, View } from 'react-native'
|
|
9
|
+
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
Container,
|
|
@@ -33,13 +34,16 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
33
34
|
|
|
34
35
|
const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
|
|
35
36
|
const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
|
|
36
|
-
|
|
37
|
+
|
|
37
38
|
const theme = useTheme();
|
|
38
39
|
const [, t] = useLanguage()
|
|
39
40
|
const [{ parsePrice }] = useUtils()
|
|
40
41
|
const [showMessage, setShowMessage] = useState(false)
|
|
41
42
|
const [isDirty, setIsDirty] = useState(false)
|
|
42
43
|
|
|
44
|
+
const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
|
|
45
|
+
const iconsSize = isChewLayout ? 20 : 16
|
|
46
|
+
|
|
43
47
|
const handleSuboptionClick = () => {
|
|
44
48
|
toggleSelect()
|
|
45
49
|
setIsDirty(true)
|
|
@@ -87,9 +91,9 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
87
91
|
{option?.allow_suboption_quantity && state?.selected && (
|
|
88
92
|
<>
|
|
89
93
|
<Checkbox disabled={disabled || state.quantity === 0} onPress={decrement}>
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
<IconAntDesign
|
|
95
|
+
name='minuscircleo'
|
|
96
|
+
size={iconsSize}
|
|
93
97
|
color={state.quantity === 0 || disabled ? theme.colors.disabled : theme.colors.primary}
|
|
94
98
|
/>
|
|
95
99
|
</Checkbox>
|
|
@@ -97,9 +101,9 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
97
101
|
{state.quantity}
|
|
98
102
|
</OText>
|
|
99
103
|
<Checkbox disabled={disabled || disableIncrement} onPress={increment}>
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
<IconAntDesign
|
|
105
|
+
name='pluscircleo'
|
|
106
|
+
size={iconsSize}
|
|
103
107
|
color={disableIncrement || disabled ? theme.colors.disabled : theme.colors.primary}
|
|
104
108
|
/>
|
|
105
109
|
</Checkbox>
|
|
@@ -140,7 +144,11 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
140
144
|
</OText>
|
|
141
145
|
)}
|
|
142
146
|
</Container>
|
|
143
|
-
{showMessage &&
|
|
147
|
+
{showMessage && (
|
|
148
|
+
<OText size={10} mLeft={4} mRight={4} style={{ flex: 1, textAlign: 'center' }} color={theme.colors.primary}>
|
|
149
|
+
{`${t('OPTIONS_MAX_LIMIT', 'Maximum options to choose')}: ${option?.max}`}
|
|
150
|
+
</OText>
|
|
151
|
+
)}
|
|
144
152
|
</View>
|
|
145
153
|
)
|
|
146
154
|
}
|