ordering-ui-react-native 0.21.11 → 0.21.13
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
CHANGED
|
@@ -118,7 +118,7 @@ export const Otp = (props: otpParams) => {
|
|
|
118
118
|
</OText>
|
|
119
119
|
<OtpInputs
|
|
120
120
|
ref={inputRef}
|
|
121
|
-
autofillFromClipboard
|
|
121
|
+
autofillFromClipboard={false}
|
|
122
122
|
numberOfInputs={pinCount || 6}
|
|
123
123
|
style={loginStyle.container}
|
|
124
124
|
inputStyles={loginStyle.underlineStyleBase}
|
|
@@ -64,7 +64,8 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
64
64
|
cartGroup,
|
|
65
65
|
walletState,
|
|
66
66
|
onNavigationRedirectReplace,
|
|
67
|
-
merchantId
|
|
67
|
+
merchantId,
|
|
68
|
+
cartsInvalid
|
|
68
69
|
} = props
|
|
69
70
|
|
|
70
71
|
const theme = useTheme();
|
|
@@ -89,7 +90,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
89
90
|
const isMultiDriverTips = configs?.checkout_multi_business_enabled?.value === '1'
|
|
90
91
|
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) || []
|
|
91
92
|
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
92
|
-
|
|
93
|
+
const cartsToShow = openCarts?.length > 0 ? openCarts : cartsInvalid
|
|
93
94
|
const walletName: any = {
|
|
94
95
|
cash: {
|
|
95
96
|
name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
|
|
@@ -138,7 +139,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
138
139
|
const isDisablePlaceOrderButton = cartGroup?.loading || (!(paymethodSelected?.paymethod_id || paymethodSelected?.wallet_id) && cartGroup?.result?.balance > 0) ||
|
|
139
140
|
(paymethodSelected?.paymethod?.gateway === 'stripe' && !paymethodSelected?.paymethod_data) ||
|
|
140
141
|
walletCarts.length > 0
|
|
141
|
-
|| (methodsPay.includes(paymethodSelected?.gateway) && (!methodPaySupported.enabled || methodPaySupported.loading))
|
|
142
|
+
|| (methodsPay.includes(paymethodSelected?.gateway) && (!methodPaySupported.enabled || methodPaySupported.loading)) || openCarts?.length === 0
|
|
142
143
|
|
|
143
144
|
const handleMomentClick = () => {
|
|
144
145
|
if (isPreOrder) {
|
|
@@ -179,7 +180,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
179
180
|
setPhoneUpdate(val)
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
const handlePlaceOrder = (confirmPayment
|
|
183
|
+
const handlePlaceOrder = (confirmPayment?: any) => {
|
|
183
184
|
if (!userErrors.length) {
|
|
184
185
|
handleGroupPlaceOrder && handleGroupPlaceOrder(confirmPayment)
|
|
185
186
|
return
|
|
@@ -199,14 +200,14 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
199
200
|
}, [validationFields, user])
|
|
200
201
|
|
|
201
202
|
useEffect(() => {
|
|
202
|
-
if (
|
|
203
|
+
if (cartsToShow?.length === 1) {
|
|
203
204
|
onNavigationRedirectReplace('CheckoutPage', {
|
|
204
|
-
cartUuid:
|
|
205
|
+
cartUuid: cartsToShow[0]?.uuid,
|
|
205
206
|
fromMulti: true
|
|
206
207
|
})
|
|
207
208
|
return
|
|
208
209
|
}
|
|
209
|
-
}, [
|
|
210
|
+
}, [cartsToShow])
|
|
210
211
|
|
|
211
212
|
useEffect(() => {
|
|
212
213
|
if (walletState.error) {
|
|
@@ -221,14 +222,14 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
221
222
|
}, [cartUuid])
|
|
222
223
|
|
|
223
224
|
useEffect(() => {
|
|
224
|
-
if(paymethodSelected?.gateway === 'global_google_pay'){
|
|
225
|
+
if (paymethodSelected?.gateway === 'global_google_pay') {
|
|
225
226
|
setMethodPaySupported({
|
|
226
227
|
enabled: true,
|
|
227
228
|
loading: false,
|
|
228
229
|
message: null
|
|
229
230
|
})
|
|
230
231
|
}
|
|
231
|
-
|
|
232
|
+
}, [paymethodSelected])
|
|
232
233
|
|
|
233
234
|
return (
|
|
234
235
|
<>
|
|
@@ -309,27 +310,27 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
309
310
|
</ChAddress>
|
|
310
311
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
311
312
|
</ChSection>
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
313
|
+
{openCarts?.length > 0 && (
|
|
314
|
+
<ChSection>
|
|
315
|
+
<MultiCartsPaymethodsAndWallets
|
|
316
|
+
openCarts={openCarts}
|
|
317
|
+
paymethodSelected={paymethodSelected}
|
|
318
|
+
walletsPaymethod={cartGroup?.result?.wallets}
|
|
319
|
+
handleSelectPaymethod={handleSelectPaymethod}
|
|
320
|
+
handleSelectWallet={handleSelectWallet}
|
|
321
|
+
handlePaymethodDataChange={handlePaymethodDataChange}
|
|
322
|
+
cartUuid={cartUuid}
|
|
323
|
+
merchantId={merchantId}
|
|
324
|
+
setMethodPaySupported={setMethodPaySupported}
|
|
325
|
+
methodPaySupported={methodPaySupported}
|
|
326
|
+
placeByMethodPay={placeByMethodPay}
|
|
327
|
+
setPlaceByMethodPay={setPlaceByMethodPay}
|
|
328
|
+
cartTotal={totalCartsPrice}
|
|
329
|
+
handlePlaceOrder={handlePlaceOrder}
|
|
330
|
+
/>
|
|
331
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
332
|
+
</ChSection>
|
|
333
|
+
)}
|
|
333
334
|
{
|
|
334
335
|
isMultiDriverTips &&
|
|
335
336
|
options?.type === 1 &&
|
|
@@ -364,6 +365,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
364
365
|
validationFields?.fields?.checkout?.coupon?.enabled &&
|
|
365
366
|
openCarts.every((cart: any) => cart.business_id && cart.status !== 2) &&
|
|
366
367
|
configs?.multi_business_checkout_coupon_input_style?.value === 'group' &&
|
|
368
|
+
openCarts?.length > 0 &&
|
|
367
369
|
(
|
|
368
370
|
<ChSection>
|
|
369
371
|
<OText size={14} lineHeight={20} color={theme.colors.textNormal}>
|
|
@@ -390,7 +392,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
390
392
|
{t('MOBILE_FRONT_YOUR_ORDER', 'Your order')}
|
|
391
393
|
</OText>
|
|
392
394
|
</CartsHeader>
|
|
393
|
-
{
|
|
395
|
+
{cartsToShow.map((cart: any) => (
|
|
394
396
|
<React.Fragment key={cart.uuid}>
|
|
395
397
|
<Cart
|
|
396
398
|
cart={cart}
|
|
@@ -407,7 +409,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
407
409
|
)}
|
|
408
410
|
</React.Fragment>
|
|
409
411
|
))}
|
|
410
|
-
{!cartGroup?.loading && openCarts.length === 0 && (
|
|
412
|
+
{!cartGroup?.loading && openCarts.length === 0 && cartsInvalid?.length === 0 && (
|
|
411
413
|
<CCNotCarts>
|
|
412
414
|
<OText size={24} style={{ textAlign: 'center' }}>
|
|
413
415
|
{t('CARTS_NOT_FOUND', 'You don\'t have carts available')}
|
|
@@ -465,6 +467,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
465
467
|
</OText>
|
|
466
468
|
</View>
|
|
467
469
|
)}
|
|
470
|
+
|
|
468
471
|
<OText size={12} color={theme.colors.mediumGray} mRight={70} style={{ marginTop: 10 }}>
|
|
469
472
|
{t('MULTI_CHECKOUT_DESCRIPTION', 'You will receive a receipt for each business. The payment is not combined between multiple stores. Each payment is processed by the store')}
|
|
470
473
|
</OText>
|
|
@@ -472,6 +475,14 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
472
475
|
)}
|
|
473
476
|
</ChCarts>
|
|
474
477
|
</ChSection>
|
|
478
|
+
{cartsToShow?.some((cart: any) => !cart?.valid_products && cart?.status !== 2) && (
|
|
479
|
+
<OText
|
|
480
|
+
color={theme.colors.error}
|
|
481
|
+
size={12}
|
|
482
|
+
>
|
|
483
|
+
{t('WARNING_INVALID_PRODUCTS_CHECKOUT', 'To continue with your checkout, please remove from your cart the products that are not available.')}
|
|
484
|
+
</OText>
|
|
485
|
+
)}
|
|
475
486
|
</ChContainer>
|
|
476
487
|
</Container>
|
|
477
488
|
|
|
@@ -147,9 +147,6 @@ const OrderProgressUI = (props: any) => {
|
|
|
147
147
|
marginBottom: 3
|
|
148
148
|
}}
|
|
149
149
|
>{statusToShow.includes(lastOrder?.status) ? t('ORDER_IN_PROGRESS', 'Order in progress') : t('ORDER', 'Order')}</OText>
|
|
150
|
-
{statusToShow.includes(lastOrder?.status) && (
|
|
151
|
-
<OText size={11} numberOfLines={1} ellipsizeMode='tail'>{t('RESTAURANT_PREPARING_YOUR_ORDER', 'The restaurant is preparing your order')}</OText>
|
|
152
|
-
)}
|
|
153
150
|
<TouchableOpacity onPress={() => handleGoToOrder('MyOrders')}>
|
|
154
151
|
<View style={styles.navigationButton}>
|
|
155
152
|
<OText size={11} color={theme.colors.primary}>{t('GO_TO_MY_ORDERS', 'Go to my orders')}</OText>
|