ordering-ui-react-native 0.16.16 → 0.16.17
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/Cart/index.tsx +29 -25
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +2 -2
- package/themes/original/src/components/MultiCheckout/index.tsx +1 -0
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +13 -11
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +11 -3
package/package.json
CHANGED
|
@@ -418,31 +418,35 @@ const CartUI = (props: any) => {
|
|
|
418
418
|
)}
|
|
419
419
|
</OSBill>
|
|
420
420
|
)}
|
|
421
|
-
{
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
{
|
|
444
|
-
|
|
445
|
-
|
|
421
|
+
{!isMultiCheckout && (
|
|
422
|
+
<>
|
|
423
|
+
{cart?.valid_products ? (
|
|
424
|
+
<CheckoutAction>
|
|
425
|
+
<OButton
|
|
426
|
+
text={(cart?.subtotal >= cart?.minimum || !cart?.minimum) && cart?.valid_address ? (
|
|
427
|
+
!openUpselling !== canOpenUpselling ? t('CHECKOUT', 'Checkout') : t('LOADING', 'Loading')
|
|
428
|
+
) : !cart?.valid_address ? (
|
|
429
|
+
`${t('OUT_OF_COVERAGE', 'Out of Coverage')}`
|
|
430
|
+
) : (
|
|
431
|
+
`${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(cart?.minimum)}`
|
|
432
|
+
)}
|
|
433
|
+
bgColor={(cart?.subtotal < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
|
|
434
|
+
isDisabled={(openUpselling && !canOpenUpselling) || cart?.subtotal < cart?.minimum || !cart?.valid_address}
|
|
435
|
+
borderColor={theme.colors.primary}
|
|
436
|
+
imgRightSrc={null}
|
|
437
|
+
textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
|
|
438
|
+
onClick={() => setOpenUpselling(true)}
|
|
439
|
+
style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
|
|
440
|
+
/>
|
|
441
|
+
</CheckoutAction>
|
|
442
|
+
) : (
|
|
443
|
+
<View style={{ alignItems: 'center', width: '100%' }}>
|
|
444
|
+
<OText size={12} color={theme.colors.red} style={{ textAlign: 'center', marginTop: 5 }}>
|
|
445
|
+
{t('WARNING_INVALID_PRODUCTS_CHECKOUT', 'To continue with your checkout, please remove from your cart the products that are not available.')}
|
|
446
|
+
</OText>
|
|
447
|
+
</View>
|
|
448
|
+
)}
|
|
449
|
+
</>
|
|
446
450
|
)}
|
|
447
451
|
</BusinessItemAccordion>
|
|
448
452
|
|
|
@@ -107,7 +107,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
107
107
|
{t('PAYMENT_METHODS', 'Payment Methods')}
|
|
108
108
|
</OText>
|
|
109
109
|
{paymethodsAndWallets.loading ? (
|
|
110
|
-
<Placeholder style={{ marginTop: 10 }} Animation={Fade}>
|
|
110
|
+
<Placeholder style={{ marginTop: 10, marginBottom: 10 }} Animation={Fade}>
|
|
111
111
|
<View style={{ display: 'flex', flexDirection: 'row' }}>
|
|
112
112
|
{[...Array(3)].map((_, i) => (
|
|
113
113
|
<PlaceholderLine
|
|
@@ -115,7 +115,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
|
|
|
115
115
|
width={37}
|
|
116
116
|
height={80}
|
|
117
117
|
noMargin
|
|
118
|
-
style={{ borderRadius: 10, marginRight: 10 }}
|
|
118
|
+
style={{ borderRadius: 10, marginRight: 10, }}
|
|
119
119
|
/>
|
|
120
120
|
))}
|
|
121
121
|
</View>
|
|
@@ -240,6 +240,7 @@ const MultiCheckoutUI = (props: any) => {
|
|
|
240
240
|
cart={cart}
|
|
241
241
|
cartuuid={cart.uuid}
|
|
242
242
|
isMultiCheckout
|
|
243
|
+
onNavigationRedirect={(route: string, params: any) => props.navigation.navigate(route, params)}
|
|
243
244
|
/>
|
|
244
245
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginTop: 13, marginHorizontal: -40 }} />
|
|
245
246
|
</React.Fragment>
|
|
@@ -258,25 +258,27 @@ const SingleOrderCardUI = (props: any) => {
|
|
|
258
258
|
return (
|
|
259
259
|
<SingleOrderContainer>
|
|
260
260
|
<View style={{ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 35 }}>
|
|
261
|
-
<View>
|
|
261
|
+
<View style={{ flex: 1, marginRight: 10 }}>
|
|
262
262
|
<OText size={16} lineHeight={24} mBottom={5} weight={'500'} color={theme.colors.textNormal}>
|
|
263
263
|
{t('ORDER', 'Order')} #{order.id}
|
|
264
264
|
</OText>
|
|
265
|
-
<View style={{ flexDirection: 'row'
|
|
265
|
+
<View style={{ flexDirection: 'row' }}>
|
|
266
266
|
<OText size={12} lineHeight={18} color={theme.colors.textNormal}>{orderTypes?.find((type: any) => order?.delivery_type === type?.value)?.text}:</OText>
|
|
267
|
-
<
|
|
268
|
-
{
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
267
|
+
<View style={{ flex: 1 }}>
|
|
268
|
+
<OText mLeft={5} size={12} lineHeight={18} color={theme.colors.textNormal}>
|
|
269
|
+
{
|
|
270
|
+
order?.delivery_datetime_utc
|
|
271
|
+
? parseDate(order?.delivery_datetime_utc)
|
|
272
|
+
: parseDate(order?.delivery_datetime, { utc: false })
|
|
273
|
+
}
|
|
274
|
+
</OText>
|
|
275
|
+
</View>
|
|
274
276
|
</View>
|
|
275
277
|
</View>
|
|
276
278
|
<OButton
|
|
277
279
|
onClick={() => handleGoToOrderDetails(order?.uuid)}
|
|
278
|
-
textStyle={{ color: theme.colors.primary, textAlign: 'center' }}
|
|
279
|
-
style={{ flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
|
|
280
|
+
textStyle={{ color: theme.colors.primary, textAlign: 'center', fontSize: 14 }}
|
|
281
|
+
style={{ flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0, paddingLeft: 5, paddingRight: 5, height: 44 }}
|
|
280
282
|
text={t('ORDER_DETAILS', 'Order Details')}
|
|
281
283
|
bgColor={theme.colors.white}
|
|
282
284
|
borderColor={theme.colors.primary}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from 'react'
|
|
2
2
|
import { useLanguage, useUtils, useToast, ToastType, MultiOrdersDetails as MultiOrdersDetailsController } from 'ordering-components/native'
|
|
3
|
-
import { View, StyleSheet } from 'react-native'
|
|
3
|
+
import { View, StyleSheet, BackHandler } from 'react-native'
|
|
4
4
|
import { useTheme } from 'styled-components/native'
|
|
5
5
|
import { OText, OButton } from '../shared'
|
|
6
6
|
import { Container } from '../../layouts/Container'
|
|
@@ -53,12 +53,13 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const
|
|
56
|
+
const handleArrowBack: any = () => {
|
|
57
57
|
if (!isFromMultiCheckout) {
|
|
58
58
|
navigation?.canGoBack() && navigation.goBack();
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
navigation.navigate('BottomTab');
|
|
62
|
+
return true
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
const handleGoToOrderDetails = (uuid: any) => {
|
|
@@ -71,6 +72,13 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
71
72
|
}
|
|
72
73
|
}, [error])
|
|
73
74
|
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
BackHandler.addEventListener('hardwareBackPress', handleArrowBack)
|
|
77
|
+
return () => {
|
|
78
|
+
BackHandler.removeEventListener('hardwareBackPress', handleArrowBack)
|
|
79
|
+
}
|
|
80
|
+
}, [])
|
|
81
|
+
|
|
74
82
|
return (
|
|
75
83
|
<OrdersDetailsContainer keyboardShouldPersistTaps="handled" contentContainerStyle={{ paddingHorizontal: 40 }}>
|
|
76
84
|
<View style={{ flexDirection: 'row' }}>
|
|
@@ -78,7 +86,7 @@ export const MultiOrdersDetailsUI = (props: any) => {
|
|
|
78
86
|
imgLeftSrc={theme.images.general.arrow_left}
|
|
79
87
|
imgRightSrc={null}
|
|
80
88
|
style={styles.btnBackArrow}
|
|
81
|
-
onClick={() =>
|
|
89
|
+
onClick={() => handleArrowBack()}
|
|
82
90
|
imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
|
|
83
91
|
/>
|
|
84
92
|
</View>
|