ordering-ui-react-native 0.17.90 → 0.17.92
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/OrderCreating/index.tsx +2 -2
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +2 -2
- package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
- package/themes/business/src/components/LoginForm/index.tsx +10 -20
- package/themes/business/src/types/index.tsx +2 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +0 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +1 -1
- package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- package/themes/original/src/components/Cart/index.tsx +12 -4
- package/themes/original/src/components/CartContent/index.tsx +1 -1
- package/themes/original/src/components/Checkout/index.tsx +1 -1
- package/themes/original/src/components/DriverTips/index.tsx +2 -2
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +2 -2
- package/themes/original/src/components/MultiCheckout/index.tsx +35 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +22 -18
- package/themes/original/src/components/MyOrders/index.tsx +3 -3
- package/themes/original/src/components/ProductForm/index.tsx +1 -1
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +1 -1
- package/themes/original/src/components/Wallets/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -131,7 +131,7 @@ export const OrderCreating = (props: any) => {
|
|
|
131
131
|
<OText size={14}>{address}</OText>
|
|
132
132
|
</LocationWrapper>
|
|
133
133
|
)}
|
|
134
|
-
{cart && (
|
|
134
|
+
{cart && !orderState?.options?.moment && (
|
|
135
135
|
<DeliveryWrapper>
|
|
136
136
|
<DeliveryContentWrapper>
|
|
137
137
|
<SimpleIcon
|
|
@@ -175,4 +175,4 @@ export const OrderCreating = (props: any) => {
|
|
|
175
175
|
)}
|
|
176
176
|
</OrderCreatingContainer>
|
|
177
177
|
)
|
|
178
|
-
}
|
|
178
|
+
}
|
|
@@ -95,7 +95,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
95
95
|
upper: {
|
|
96
96
|
flex: 1,
|
|
97
97
|
zIndex: 1001,
|
|
98
|
-
paddingTop: isPage ? 30 :
|
|
98
|
+
paddingTop: isPage ? 30 : 50,
|
|
99
99
|
marginBottom: 10,
|
|
100
100
|
backgroundColor: theme.colors.backgroundPage
|
|
101
101
|
},
|
|
@@ -418,7 +418,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
418
418
|
</Header>
|
|
419
419
|
|
|
420
420
|
{action === 'accept' && (
|
|
421
|
-
<View style={{ height:
|
|
421
|
+
<View style={{ height: 300, justifyContent: 'center' }}>
|
|
422
422
|
<Timer onPress={() => openTimerIOnput()}>
|
|
423
423
|
<OText weight="600" style={{ textAlign: 'center' }} size={55}>
|
|
424
424
|
{hour}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { useEffect } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { formatSeconds } from '../../../utils'
|
|
3
|
-
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { StyleSheet, TouchableOpacity, Alert } from 'react-native';
|
|
4
4
|
import { useCountdownTimer } from '../../../../../../src/hooks/useCountdownTimer';
|
|
5
5
|
import { useLanguage } from 'ordering-components/native';
|
|
6
6
|
import { OTPContainer } from './styles';
|
|
@@ -16,11 +16,13 @@ export const Otp = (props: otpParams) => {
|
|
|
16
16
|
onSubmit,
|
|
17
17
|
handleLoginOtp,
|
|
18
18
|
setAlertState,
|
|
19
|
-
pinCount
|
|
19
|
+
pinCount,
|
|
20
|
+
formState
|
|
20
21
|
} = props
|
|
21
22
|
|
|
22
23
|
const theme = useTheme();
|
|
23
24
|
const [, t] = useLanguage();
|
|
25
|
+
const [code, setCode] = useState('')
|
|
24
26
|
const [otpLeftTime, _, resetOtpLeftTime]: any = useCountdownTimer(
|
|
25
27
|
600, willVerifyOtpState)
|
|
26
28
|
|
|
@@ -44,6 +46,30 @@ export const Otp = (props: otpParams) => {
|
|
|
44
46
|
}
|
|
45
47
|
}, [otpLeftTime])
|
|
46
48
|
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!formState?.loading && formState?.result?.error) {
|
|
51
|
+
Alert.alert(
|
|
52
|
+
t('ERROR', 'Error'),
|
|
53
|
+
typeof formState.result?.result === 'string'
|
|
54
|
+
? formState.result?.result
|
|
55
|
+
: formState.result?.result[0],
|
|
56
|
+
[
|
|
57
|
+
{
|
|
58
|
+
text: t('ACCEPT', 'Accept'),
|
|
59
|
+
onPress: () => {},
|
|
60
|
+
style: 'cancel'
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
{ cancelable: false }
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
if (code.length === (pinCount || 6)) {
|
|
67
|
+
setCode('')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
}, [formState])
|
|
72
|
+
|
|
47
73
|
const loginStyle = StyleSheet.create({
|
|
48
74
|
underlineStyleBase: {
|
|
49
75
|
width: 45,
|
|
@@ -72,6 +98,8 @@ export const Otp = (props: otpParams) => {
|
|
|
72
98
|
onCodeFilled={(code: string) => handleLoginOtp(code)}
|
|
73
99
|
selectionColor={theme.colors.primary}
|
|
74
100
|
editable
|
|
101
|
+
code={code}
|
|
102
|
+
onCodeChanged={(code: string) => setCode(code)}
|
|
75
103
|
/>
|
|
76
104
|
<TouchableOpacity onPress={() => handleOnSubmit()} disabled={otpLeftTime > 520}>
|
|
77
105
|
<OText size={16} mBottom={30} color={otpLeftTime > 520 ? theme.colors.disabled : theme.colors.primary}>
|
|
@@ -280,7 +280,6 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
280
280
|
|
|
281
281
|
const handleLoginOtp = (code: string) => {
|
|
282
282
|
handleButtonLoginClick({ code })
|
|
283
|
-
setWillVerifyOtpState(false)
|
|
284
283
|
}
|
|
285
284
|
|
|
286
285
|
const closeAlert = () => {
|
|
@@ -329,27 +328,17 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
329
328
|
showToast(ToastType.Info, t('TRY_AGAIN', 'Please try again'))
|
|
330
329
|
return
|
|
331
330
|
}
|
|
332
|
-
formState
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
typeof formState.result?.result !== 'string'
|
|
339
|
-
? getTraduction(formState.result?.result[0])
|
|
340
|
-
: loginTab === 'cellphone' &&
|
|
341
|
-
typeof formState.result?.result === 'string'
|
|
342
|
-
? getTraduction(formState.result?.result).replace(
|
|
343
|
-
t('USER', 'user').toLowerCase(),
|
|
344
|
-
t('PHONE_NUMER', 'Phone number'),
|
|
345
|
-
)
|
|
346
|
-
: getTraduction(formState.result?.result[0]).replace(
|
|
347
|
-
t('USER', 'user').toLowerCase(),
|
|
348
|
-
t('PHONE_NUMER', 'Phone number'),
|
|
349
|
-
),
|
|
350
|
-
);
|
|
331
|
+
formState.result?.result && showToast(
|
|
332
|
+
ToastType.Error,
|
|
333
|
+
typeof formState.result?.result === 'string'
|
|
334
|
+
? formState.result?.result
|
|
335
|
+
: formState.result?.result[0]
|
|
336
|
+
)
|
|
351
337
|
setSubmitted(false)
|
|
352
338
|
}
|
|
339
|
+
if (!formState?.loading && !formState?.result?.error) {
|
|
340
|
+
setWillVerifyOtpState(false)
|
|
341
|
+
}
|
|
353
342
|
}, [formState]);
|
|
354
343
|
|
|
355
344
|
useEffect(() => {
|
|
@@ -929,6 +918,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
929
918
|
handleLoginOtp={handleLoginOtp}
|
|
930
919
|
onSubmit={handleLogin}
|
|
931
920
|
setAlertState={setAlertState}
|
|
921
|
+
formState={formState}
|
|
932
922
|
/>
|
|
933
923
|
</OModal>
|
|
934
924
|
<Alert
|
|
@@ -36,7 +36,8 @@ export interface otpParams {
|
|
|
36
36
|
setWillVerifyOtpState: (val : boolean) => void,
|
|
37
37
|
onSubmit: () => void,
|
|
38
38
|
handleLoginOtp: (code : string) => void,
|
|
39
|
-
setAlertState: any
|
|
39
|
+
setAlertState: any,
|
|
40
|
+
formState?: any
|
|
40
41
|
}
|
|
41
42
|
export interface ProfileParams {
|
|
42
43
|
navigation?: any;
|
|
@@ -116,10 +116,6 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
if (values?.project_name) {
|
|
119
|
-
setOrdering({
|
|
120
|
-
...ordering,
|
|
121
|
-
project: values?.project_name
|
|
122
|
-
})
|
|
123
119
|
_setStoreData('project_name', values?.project_name)
|
|
124
120
|
setFormsStateValues({
|
|
125
121
|
...formsStateValues,
|
|
@@ -46,7 +46,7 @@ export const BusinessBasicInformation = (
|
|
|
46
46
|
const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
|
|
47
47
|
const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
|
|
48
48
|
const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
|
|
49
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
49
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
50
50
|
const hideLogo = theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
|
|
51
51
|
const hideDeliveryFee = theme?.business_view?.components?.header?.components?.business?.components?.fee?.hidden
|
|
52
52
|
const hideTime = theme?.business_view?.components?.header?.components?.business?.components?.time?.hidden
|
|
@@ -76,7 +76,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
|
|
|
76
76
|
{ text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
|
|
77
77
|
]
|
|
78
78
|
|
|
79
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
79
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
80
80
|
|
|
81
81
|
const priceList = [
|
|
82
82
|
{ level: '1', content: '$' },
|
|
@@ -82,7 +82,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
82
82
|
const isFocused = useIsFocused();
|
|
83
83
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
84
84
|
|
|
85
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
85
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
86
86
|
const showLogo = !theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
|
|
87
87
|
const hideBusinessNearCity = theme?.business_view?.components?.near_business?.hidden ?? true
|
|
88
88
|
const backgroundColor = theme?.business_view?.components?.style?.backgroundColor
|
|
@@ -82,7 +82,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
82
82
|
const [{ parseDate }] = useUtils();
|
|
83
83
|
|
|
84
84
|
const appState = useRef(AppState.currentState)
|
|
85
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
85
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
86
86
|
const [refreshing] = useState(false);
|
|
87
87
|
const hideCities = (theme?.business_listing_view?.components?.cities?.hidden || orderState?.options?.type !== 2) ?? true
|
|
88
88
|
const hideHero = theme?.business_listing_view?.components?.business_hero?.hidden
|
|
@@ -315,9 +315,11 @@ const CartUI = (props: any) => {
|
|
|
315
315
|
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => setOpenTaxModal({ open: true, data: offer, type: 'offer_target_3' })}>
|
|
316
316
|
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
317
317
|
</TouchableOpacity>
|
|
318
|
-
|
|
319
|
-
<
|
|
320
|
-
|
|
318
|
+
{!offer?.type && (
|
|
319
|
+
<TouchableOpacity style={{ marginLeft: 3 }} onPress={() => onRemoveOffer(offer?.id)}>
|
|
320
|
+
<AntIcon name='closecircle' size={16} color={theme.colors.primary} />
|
|
321
|
+
</TouchableOpacity>
|
|
322
|
+
)}
|
|
321
323
|
</OSRow>
|
|
322
324
|
<OText size={12} lineHeight={18}>
|
|
323
325
|
- {parsePrice(offer?.summary?.discount)}
|
|
@@ -352,6 +354,12 @@ const CartUI = (props: any) => {
|
|
|
352
354
|
</OSTable>
|
|
353
355
|
))
|
|
354
356
|
}
|
|
357
|
+
{orderState?.options?.type === 1 && cart?.delivery_price > 0 && cart?.delivery_price_with_discount >= 0 && !hideDeliveryFee && (
|
|
358
|
+
<OSTable>
|
|
359
|
+
<OText size={12} lineHeight={18}>{t('DELIVERY_FEE_AFTER_DISCOUNT', 'Delivery Fee After Discount')}</OText>
|
|
360
|
+
<OText size={12} lineHeight={18}>{parsePrice(cart?.delivery_price_with_discount)}</OText>
|
|
361
|
+
</OSTable>
|
|
362
|
+
)}
|
|
355
363
|
{cart?.driver_tip > 0 && !hideDriverTip && (
|
|
356
364
|
<OSTable>
|
|
357
365
|
<OText size={12} lineHeight={18}>
|
|
@@ -385,7 +393,7 @@ const CartUI = (props: any) => {
|
|
|
385
393
|
</OSTable>
|
|
386
394
|
)}
|
|
387
395
|
|
|
388
|
-
{isMultiCheckout &&
|
|
396
|
+
{!isMultiCheckout &&
|
|
389
397
|
cart &&
|
|
390
398
|
cart?.valid &&
|
|
391
399
|
orderState?.options?.type === 1 &&
|
|
@@ -20,7 +20,7 @@ export const CartContent = (props: any) => {
|
|
|
20
20
|
const [{ configs }] = useConfig()
|
|
21
21
|
const [isCartsLoading, setIsCartsLoading] = useState(false)
|
|
22
22
|
|
|
23
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
23
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
24
24
|
const isMultiCheckout = configs?.checkout_multi_business_enabled?.value === '1'
|
|
25
25
|
const cartsAvailable: any = Object.values(carts)?.filter((cart: any) => cart?.valid && cart?.status !== 2)
|
|
26
26
|
|
|
@@ -154,7 +154,7 @@ const CheckoutUI = (props: any) => {
|
|
|
154
154
|
const isWalletCreditPointsEnabled = businessConfigs.find((config: any) => config.key === 'wallet_credit_point_enabled')?.value === '1'
|
|
155
155
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletCreditPointsEnabled)
|
|
156
156
|
const isBusinessChangeEnabled = configs?.cart_change_business_validation?.value === '1'
|
|
157
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
157
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
158
158
|
const hideBusinessAddress = theme?.checkout?.components?.business?.components?.address?.hidden
|
|
159
159
|
const hideBusinessDetails = theme?.checkout?.components?.business?.hidden
|
|
160
160
|
const hideBusinessMap = theme?.checkout?.components?.business?.components?.map?.hidden
|
|
@@ -22,7 +22,7 @@ const DriverTipsUI = (props: any) => {
|
|
|
22
22
|
const {
|
|
23
23
|
driverTip,
|
|
24
24
|
driverTipsOptions,
|
|
25
|
-
|
|
25
|
+
isMulti,
|
|
26
26
|
cart,
|
|
27
27
|
isDriverTipUseCustom,
|
|
28
28
|
handlerChangeOption,
|
|
@@ -33,7 +33,7 @@ const DriverTipsUI = (props: any) => {
|
|
|
33
33
|
const theme = useTheme();
|
|
34
34
|
const [, t] = useLanguage();
|
|
35
35
|
const [{ configs }] = useConfig();
|
|
36
|
-
const [customTip, setCustomTip] = useState((isDriverTipUseCustom && !driverTipsOptions.includes(driverTip)) ?? false)
|
|
36
|
+
const [customTip, setCustomTip] = useState((!isMulti && isDriverTipUseCustom && !driverTipsOptions.includes(driverTip)) ?? false)
|
|
37
37
|
const currentTip = customTip ? parseFloat(driverTip || 0) > 0 : (!customTip && !driverTipsOptions.includes(driverTip) && parseFloat(driverTip || 0)) > 0
|
|
38
38
|
const [value, setvalue] = useState('');
|
|
39
39
|
|
|
@@ -61,7 +61,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
61
61
|
case 'paypal':
|
|
62
62
|
return theme.images.general.paypal
|
|
63
63
|
case 'stripe':
|
|
64
|
-
return theme.images.general.
|
|
64
|
+
return theme.images.general.creditCard
|
|
65
65
|
case 'stripe_direct':
|
|
66
66
|
return theme.images.general.stripecc
|
|
67
67
|
case 'stripe_connect':
|
|
@@ -83,7 +83,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
83
83
|
isActive={paymethodSelected?.id === item.id}
|
|
84
84
|
>
|
|
85
85
|
<OIcon
|
|
86
|
-
src={getPayIcon(item.paymethod?.gateway)}
|
|
86
|
+
src={getPayIcon(item?.gateway ?? item.paymethod?.gateway)}
|
|
87
87
|
width={20}
|
|
88
88
|
height={20}
|
|
89
89
|
color={paymethodSelected?.id === item.id ? theme.colors.white : theme.colors.backgroundDark}
|
|
@@ -21,6 +21,8 @@ import { AddressDetails } from '../AddressDetails'
|
|
|
21
21
|
import { MultiCartsPaymethodsAndWallets } from '../MultiCartsPaymethodsAndWallets'
|
|
22
22
|
import { Cart } from '../Cart'
|
|
23
23
|
import { FloatingButton } from '../FloatingButton'
|
|
24
|
+
import { DriverTips } from '../DriverTips'
|
|
25
|
+
import { DriverTipsContainer } from '../Cart/styles'
|
|
24
26
|
|
|
25
27
|
import {
|
|
26
28
|
ChContainer,
|
|
@@ -78,8 +80,12 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
78
80
|
|
|
79
81
|
const configTypes = configs?.order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
|
|
80
82
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
83
|
+
const isMultiDriverTips = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
81
84
|
const isDisablePlaceOrderButton = !(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) || (paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data)
|
|
82
85
|
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) || []
|
|
86
|
+
const driverTipsOptions = typeof configs?.driver_tip_options?.value === 'string'
|
|
87
|
+
? JSON.parse(configs?.driver_tip_options?.value) || []
|
|
88
|
+
: configs?.driver_tip_options?.value || []
|
|
83
89
|
|
|
84
90
|
const [isUserDetailsEdit, setIsUserDetailsEdit] = useState(false);
|
|
85
91
|
const [phoneUpdate, setPhoneUpdate] = useState(false);
|
|
@@ -227,6 +233,35 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
227
233
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
228
234
|
</ChSection>
|
|
229
235
|
|
|
236
|
+
{
|
|
237
|
+
isMultiDriverTips &&
|
|
238
|
+
options?.type === 1 &&
|
|
239
|
+
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
240
|
+
openCarts.every((cart: any) => cart.business_id && cart.status !== 2) &&
|
|
241
|
+
driverTipsOptions && driverTipsOptions?.length > 0 &&
|
|
242
|
+
(
|
|
243
|
+
<ChSection>
|
|
244
|
+
<DriverTipsContainer>
|
|
245
|
+
<OText size={14} lineHeight={20} color={theme.colors.textNormal}>
|
|
246
|
+
{t('DRIVER_TIPS', 'Driver Tips')}
|
|
247
|
+
</OText>
|
|
248
|
+
<DriverTips
|
|
249
|
+
isMulti
|
|
250
|
+
carts={openCarts}
|
|
251
|
+
businessIds={openCarts.map((cart: any) => cart.business_id)}
|
|
252
|
+
driverTipsOptions={driverTipsOptions}
|
|
253
|
+
isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
|
|
254
|
+
isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
|
|
255
|
+
driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
|
|
256
|
+
? openCarts[0]?.driver_tip
|
|
257
|
+
: openCarts[0]?.driver_tip_rate}
|
|
258
|
+
useOrderContext
|
|
259
|
+
/>
|
|
260
|
+
</DriverTipsContainer>
|
|
261
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
262
|
+
</ChSection>
|
|
263
|
+
)}
|
|
264
|
+
|
|
230
265
|
<ChSection>
|
|
231
266
|
<ChCarts>
|
|
232
267
|
<CartsHeader>
|
|
@@ -3,7 +3,6 @@ import { useLanguage, useUtils, useToast, ToastType, useConfig, MultiOrdersDetai
|
|
|
3
3
|
import { View, StyleSheet, BackHandler, TouchableOpacity } from 'react-native'
|
|
4
4
|
import { useTheme } from 'styled-components/native'
|
|
5
5
|
import { OText, OButton } from '../shared'
|
|
6
|
-
import { Container } from '../../layouts/Container'
|
|
7
6
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
|
|
8
7
|
import { SingleOrderCard } from './SingleOrderCard'
|
|
9
8
|
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
@@ -53,6 +52,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
53
52
|
const [, { showToast }] = useToast();
|
|
54
53
|
const [{ configs }] = useConfig()
|
|
55
54
|
|
|
55
|
+
const isTaxIncludedOnPrice = orders.every((_order: any) => _order.taxes?.length ? _order.taxes?.every((_tax: any) => _tax.type === 1) : true)
|
|
56
56
|
const progressBarStyle = configs.multi_business_checkout_progress_bar_style?.value
|
|
57
57
|
const showBarInOrder = ['group', 'both']
|
|
58
58
|
const showBarInIndividual = ['individual', 'both']
|
|
@@ -225,23 +225,27 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
225
225
|
</Row>
|
|
226
226
|
))}
|
|
227
227
|
<BorderLine />
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
228
|
+
{!isTaxIncludedOnPrice && (
|
|
229
|
+
<>
|
|
230
|
+
<Row>
|
|
231
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
232
|
+
{t('TOTAL_BEFORE_TAX', 'Total before tax')}:
|
|
233
|
+
</OText>
|
|
234
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
235
|
+
{parsePrice(ordersSummary?.subtotal)}
|
|
236
|
+
</OText>
|
|
237
|
+
</Row>
|
|
238
|
+
<Row>
|
|
239
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
240
|
+
{t('ESTIMATED_TAX_TO_BE_COLLECTED', 'Estimated tax to be collected')}:
|
|
241
|
+
</OText>
|
|
242
|
+
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal}>
|
|
243
|
+
{parsePrice(ordersSummary?.tax)}
|
|
244
|
+
</OText>
|
|
245
|
+
</Row>
|
|
246
|
+
<BorderLine />
|
|
247
|
+
</>
|
|
248
|
+
)}
|
|
245
249
|
<Row style={{ marginTop: 10 }}>
|
|
246
250
|
<OText size={14} lineHeight={18} weight={'500'} color={theme.colors.textNormal}>
|
|
247
251
|
{t('PAYMENT_TOTAL', 'Payment total')}:
|
|
@@ -31,7 +31,7 @@ export const MyOrders = (props: any) => {
|
|
|
31
31
|
const notOrderOptions = ['business', 'products']
|
|
32
32
|
const allEmpty = (ordersLength?.activeOrdersLength === 0 && ordersLength?.previousOrdersLength === 0) || ((isEmptyBusinesses || businessOrderIds?.length === 0) && hideOrders)
|
|
33
33
|
|
|
34
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
34
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
35
35
|
const showNavbar = theme?.bar_menu?.components?.orders?.hidden
|
|
36
36
|
const hideOrdersTheme = theme?.bar_menu?.components?.orders?.hidden
|
|
37
37
|
const hideProductsTab = theme?.orders?.components?.products_tab?.hidden
|
|
@@ -90,7 +90,7 @@ export const MyOrders = (props: any) => {
|
|
|
90
90
|
},
|
|
91
91
|
...props.titleStyle
|
|
92
92
|
}}>
|
|
93
|
-
{
|
|
93
|
+
{!props.hideBackBtn && (!isChewLayout || (isChewLayout && hideOrdersTheme)) && (
|
|
94
94
|
<OButton
|
|
95
95
|
imgLeftStyle={{ width: 18 }}
|
|
96
96
|
imgRightSrc={null}
|
|
@@ -103,7 +103,7 @@ export const MyOrders = (props: any) => {
|
|
|
103
103
|
shadowColor: '#FFF',
|
|
104
104
|
paddingLeft: 0,
|
|
105
105
|
paddingRight: 0,
|
|
106
|
-
marginTop:
|
|
106
|
+
marginTop: 30,
|
|
107
107
|
}}
|
|
108
108
|
onClick={goToBack}
|
|
109
109
|
icon={AntDesignIcon}
|
|
@@ -77,7 +77,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
77
77
|
const theme = useTheme();
|
|
78
78
|
const [, { showToast }] = useToast()
|
|
79
79
|
|
|
80
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
80
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
81
81
|
|
|
82
82
|
const styles = StyleSheet.create({
|
|
83
83
|
mainContainer: {
|
|
@@ -41,7 +41,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
41
41
|
const [showMessage, setShowMessage] = useState(false)
|
|
42
42
|
const [isDirty, setIsDirty] = useState(false)
|
|
43
43
|
|
|
44
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
44
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
45
45
|
const iconsSize = isChewLayout ? 20 : 16
|
|
46
46
|
|
|
47
47
|
const handleSuboptionClick = () => {
|
|
@@ -45,7 +45,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
45
45
|
|
|
46
46
|
const theme = useTheme();
|
|
47
47
|
const hideAddButton = theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden ?? true
|
|
48
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
48
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
49
49
|
const hideProductDescription = theme?.business_view?.components?.products?.components?.product?.components?.description?.hidden
|
|
50
50
|
const hideProductLogo = viewString
|
|
51
51
|
? theme?.[viewString]?.components?.cart?.components?.products?.image?.hidden
|
|
@@ -49,7 +49,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
49
49
|
|
|
50
50
|
const theme = useTheme();
|
|
51
51
|
|
|
52
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
52
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
53
53
|
const hideProfileImage = theme?.profile?.components?.picture?.hidden
|
|
54
54
|
const hideOrders = theme?.profile?.components?.orders?.hidden
|
|
55
55
|
const hideProfile = theme?.profile?.components?.profile?.hidden
|
|
@@ -71,7 +71,7 @@ const WalletsUI = (props: any) => {
|
|
|
71
71
|
|
|
72
72
|
const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
|
|
73
73
|
const [openHistory, setOpenHistory] = useState(false)
|
|
74
|
-
const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
|
|
74
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
75
75
|
const hideWalletsTheme = theme?.bar_menu?.components?.wallets?.hidden
|
|
76
76
|
|
|
77
77
|
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
|