ordering-ui-react-native 0.21.87 → 0.21.89
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/UserProfileForm/index.tsx +4 -4
- package/themes/original/src/components/AddressDetails/index.tsx +2 -2
- package/themes/original/src/components/CartContent/index.tsx +19 -4
- package/themes/original/src/components/Checkout/index.tsx +1 -1
- package/themes/original/src/components/OrderProgress/index.tsx +12 -2
- package/themes/original/src/components/SingleOrderCard/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -118,14 +118,14 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
118
118
|
includeBase64: true,
|
|
119
119
|
},
|
|
120
120
|
(image: any) => {
|
|
121
|
-
const response = image?.assets[0];
|
|
122
|
-
if (response
|
|
121
|
+
const response = image?.assets?.[0];
|
|
122
|
+
if (response?.didCancel) {
|
|
123
123
|
console.log('User cancelled image picker');
|
|
124
|
-
} else if (response
|
|
124
|
+
} else if (response?.errorMessage) {
|
|
125
125
|
console.log('ImagePicker Error: ', response.errorMessage);
|
|
126
126
|
showToast(ToastType.Error, response.errorMessage);
|
|
127
127
|
} else {
|
|
128
|
-
if (response
|
|
128
|
+
if (response?.uri) {
|
|
129
129
|
const url = `data:${response.type};base64,${response.base64}`;
|
|
130
130
|
handleButtonUpdateClick(null, true, url);
|
|
131
131
|
} else {
|
|
@@ -24,7 +24,7 @@ const AddressDetailsUI = (props: any) => {
|
|
|
24
24
|
|
|
25
25
|
const styles = StyleSheet.create({
|
|
26
26
|
productStyle: {
|
|
27
|
-
width
|
|
27
|
+
width,
|
|
28
28
|
height: 151,
|
|
29
29
|
marginVertical: 10
|
|
30
30
|
}
|
|
@@ -45,7 +45,7 @@ const AddressDetailsUI = (props: any) => {
|
|
|
45
45
|
</ADHeader>
|
|
46
46
|
{!!apiKey && googleMapsUrl && (
|
|
47
47
|
<ADMap
|
|
48
|
-
style={{
|
|
48
|
+
style={{ width, flex: 1, marginStart: -20, marginEnd: -20, }}>
|
|
49
49
|
<FastImage
|
|
50
50
|
style={styles.productStyle}
|
|
51
51
|
source={{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useLanguage, useConfig, useUtils, useOrder } from 'ordering-components/native';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
@@ -13,7 +13,8 @@ export const CartContent = (props: any) => {
|
|
|
13
13
|
const {
|
|
14
14
|
onNavigationRedirect,
|
|
15
15
|
singleBusiness,
|
|
16
|
-
businessSlug
|
|
16
|
+
businessSlug,
|
|
17
|
+
navigation
|
|
17
18
|
} = props
|
|
18
19
|
|
|
19
20
|
const theme = useTheme();
|
|
@@ -22,7 +23,7 @@ export const CartContent = (props: any) => {
|
|
|
22
23
|
const [{ parsePrice }] = useUtils();
|
|
23
24
|
const [isCartsLoading, setIsCartsLoading] = useState(false)
|
|
24
25
|
const [cartsOpened, setCartsOpened] = useState([])
|
|
25
|
-
const [{ carts: cartsContext }] = useOrder();
|
|
26
|
+
const [{ carts: cartsContext }, { confirmCart }] = useOrder();
|
|
26
27
|
const cartsList =
|
|
27
28
|
(cartsContext &&
|
|
28
29
|
Object.values(cartsContext).filter((cart: any) => cart.products.length > 0)) ??
|
|
@@ -71,7 +72,7 @@ export const CartContent = (props: any) => {
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
const changeActiveState = useCallback((isClosed
|
|
75
|
+
const changeActiveState = useCallback((isClosed: boolean, uuid: string) => {
|
|
75
76
|
const isActive = cartsOpened?.includes?.(uuid) || !!singleBusiness
|
|
76
77
|
if (isActive || !isClosed) {
|
|
77
78
|
setCartsOpened(cartsOpened?.filter?.((_uuid) => _uuid !== uuid))
|
|
@@ -83,6 +84,20 @@ export const CartContent = (props: any) => {
|
|
|
83
84
|
}
|
|
84
85
|
}, [cartsOpened])
|
|
85
86
|
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const unsuscribe = navigation.addListener('focus', () => {
|
|
89
|
+
const cartsListBlockedByPaypal = carts?.filter((cart: any) => cart?.status === 2 && cart?.paymethod_data?.gateway === 'paypal')
|
|
90
|
+
if (cartsListBlockedByPaypal?.length > 0) {
|
|
91
|
+
cartsListBlockedByPaypal.map(async (cart: any) => {
|
|
92
|
+
await confirmCart(cart?.uuid)
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
return () => {
|
|
97
|
+
return unsuscribe()
|
|
98
|
+
}
|
|
99
|
+
}, [carts, navigation])
|
|
100
|
+
|
|
86
101
|
return (
|
|
87
102
|
<CCContainer
|
|
88
103
|
style={{ paddingHorizontal: 20 }}
|
|
@@ -474,7 +474,7 @@ const CheckoutUI = (props: any) => {
|
|
|
474
474
|
</TopHeader>
|
|
475
475
|
</View>
|
|
476
476
|
</SafeAreaView>
|
|
477
|
-
<Container pt={0} forwardRef={containerRef} noPadding onScroll={handleScroll}>
|
|
477
|
+
<Container pt={0} forwardRef={containerRef} showsVerticalScrollIndicator={false} noPadding onScroll={handleScroll}>
|
|
478
478
|
<View style={styles.wrapperNavbar}>
|
|
479
479
|
<NavBar
|
|
480
480
|
hideArrowLeft
|
|
@@ -110,7 +110,7 @@ const OrderProgressUI = (props: any) => {
|
|
|
110
110
|
setInitialLoaded(true)
|
|
111
111
|
}, [orderList.loading, initialLoaded])
|
|
112
112
|
|
|
113
|
-
const progressBarObjt = lastOrder?.delivery_type && lastOrder?.delivery_type === 2 ? getOrderStatuPickUp : getOrderStatus
|
|
113
|
+
const progressBarObjt = (s: any) => lastOrder?.delivery_type && lastOrder?.delivery_type === 2 ? getOrderStatuPickUp(s) : getOrderStatus(s)
|
|
114
114
|
|
|
115
115
|
return (
|
|
116
116
|
<>
|
|
@@ -130,7 +130,7 @@ const OrderProgressUI = (props: any) => {
|
|
|
130
130
|
<View style={styles.logoWrapper}>
|
|
131
131
|
<FastImage
|
|
132
132
|
style={{ width: 50, height: 50 }}
|
|
133
|
-
source={orderList?.orders.length === 1 ? {
|
|
133
|
+
source={orderList?.orders.length === 1 && lastOrder?.business?.logo.includes('http') ? {
|
|
134
134
|
uri: optimizeImage(lastOrder?.business?.logo, 'h_50,c_limit'),
|
|
135
135
|
priority: FastImage.priority.normal,
|
|
136
136
|
} : theme.images.logos.logotype}
|
|
@@ -209,6 +209,16 @@ export const OrderProgress = (props: any) => {
|
|
|
209
209
|
pageSize: 10,
|
|
210
210
|
controlType: 'infinity'
|
|
211
211
|
},
|
|
212
|
+
propsToFetch: [
|
|
213
|
+
'id',
|
|
214
|
+
'name',
|
|
215
|
+
'business',
|
|
216
|
+
'status',
|
|
217
|
+
'delivery_type',
|
|
218
|
+
'delivery_datetime_utc',
|
|
219
|
+
'delivery_datetime',
|
|
220
|
+
'reporting_data'
|
|
221
|
+
],
|
|
212
222
|
noGiftCardOrders: true
|
|
213
223
|
}
|
|
214
224
|
|