ordering-ui-react-native 0.16.3 → 0.16.6
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/LoginForm/index.tsx +3 -1
- package/src/components/SignupForm/index.tsx +3 -1
- package/src/components/shared/OModal.tsx +1 -1
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +6 -0
- package/themes/business/src/components/shared/OModal.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +12 -3
- package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
- package/themes/kiosk/src/components/OrderDetails/index.tsx +2 -2
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +1 -1
- package/themes/original/src/components/BusinessPreorder/index.tsx +1 -1
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +2 -2
- package/themes/original/src/components/Cart/index.tsx +1 -1
- package/themes/original/src/components/Checkout/index.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +1 -0
- package/themes/original/src/components/LoginForm/index.tsx +3 -1
- package/themes/original/src/components/OrderDetails/index.tsx +18 -24
- package/themes/original/src/components/OrderSummary/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +31 -26
- package/themes/original/src/components/PreviousOrders/index.tsx +1 -1
- package/themes/original/src/components/SignupForm/index.tsx +2 -1
- package/themes/original/src/components/shared/OInput.tsx +2 -0
- package/themes/original/src/components/shared/OModal.tsx +1 -1
- package/themes/original/src/types/index.tsx +4 -1
package/package.json
CHANGED
|
@@ -92,6 +92,8 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
92
92
|
|
|
93
93
|
const inputRef = useRef<any>({})
|
|
94
94
|
|
|
95
|
+
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
96
|
+
|
|
95
97
|
const anySocialButtonActivated = ((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value) ||
|
|
96
98
|
(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) ||
|
|
97
99
|
(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null)
|
|
@@ -381,7 +383,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
381
383
|
handleSuccessFacebookLogin={handleSuccessFacebook}
|
|
382
384
|
/>
|
|
383
385
|
)}
|
|
384
|
-
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && (
|
|
386
|
+
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
|
|
385
387
|
<GoogleLogin
|
|
386
388
|
notificationState={notificationState}
|
|
387
389
|
webClientId={configs?.google_login_client_id?.value}
|
|
@@ -115,6 +115,8 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
115
115
|
const phoneRef = useRef<any>(null)
|
|
116
116
|
const passwordRef = useRef<any>(null)
|
|
117
117
|
|
|
118
|
+
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
119
|
+
|
|
118
120
|
const anySocialButtonActivated = ((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value) ||
|
|
119
121
|
(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) ||
|
|
120
122
|
(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null)
|
|
@@ -543,7 +545,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
543
545
|
handleSuccessFacebookLogin={handleSuccessFacebook}
|
|
544
546
|
/>
|
|
545
547
|
)}
|
|
546
|
-
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && (
|
|
548
|
+
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
|
|
547
549
|
<GoogleLogin
|
|
548
550
|
notificationState={notificationState}
|
|
549
551
|
webClientId={configs?.google_login_client_id?.value}
|
|
@@ -78,7 +78,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
78
78
|
animationType="slide"
|
|
79
79
|
transparent={isTransparent}
|
|
80
80
|
visible={open}
|
|
81
|
-
onRequestClose={() => { onClose() }}
|
|
81
|
+
onRequestClose={() => { onClose && onClose() }}
|
|
82
82
|
style={{ height: '100%', flex: 1, position: 'absolute', ...style, zIndex: 9999 }}
|
|
83
83
|
>
|
|
84
84
|
{isAvoidKeyBoardView ? (
|
|
@@ -323,6 +323,12 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
323
323
|
{order?.customer?.zipcode}
|
|
324
324
|
</OText>
|
|
325
325
|
)}
|
|
326
|
+
|
|
327
|
+
{!!order?.on_behalf_of && (
|
|
328
|
+
<OText numberOfLines={1} mBottom={4} ellipsizeMode="tail">
|
|
329
|
+
{t('ON_BEHALF_OF', 'On behalf of')}{': '} {order?.on_behalf_of}
|
|
330
|
+
</OText>
|
|
331
|
+
)}
|
|
326
332
|
{((order?.delivery_option !== undefined && order?.delivery_type === 1) || !!order?.comment) && (
|
|
327
333
|
<View style={{ marginTop: 10 }}>
|
|
328
334
|
{order?.delivery_option !== undefined && order?.delivery_type === 1 && (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
|
|
2
|
+
import { _retrieveStoreData } from '../../../../../src/providers/StoreUtil';
|
|
3
3
|
import {
|
|
4
4
|
Checkout as CheckoutController,
|
|
5
5
|
useOrder,
|
|
@@ -35,10 +35,18 @@ const CheckoutUI = (props: any) => {
|
|
|
35
35
|
} = props
|
|
36
36
|
|
|
37
37
|
const [errorCash, setErrorCash] = useState(false);
|
|
38
|
+
const [customerName, setCustomerName] = useState(null);
|
|
39
|
+
|
|
40
|
+
const getCustomerName = async () => {
|
|
41
|
+
const data = await _retrieveStoreData('customer_name');
|
|
42
|
+
setCustomerName(data?.customerName)
|
|
43
|
+
}
|
|
38
44
|
|
|
39
45
|
useEffect(() => {
|
|
40
46
|
if (!cartState.loading && cart && !cart?.valid && cart?.status === 2) {
|
|
41
47
|
navigation?.canGoBack() && navigation.goBack()
|
|
48
|
+
} else {
|
|
49
|
+
getCustomerName()
|
|
42
50
|
}
|
|
43
51
|
}, [cart])
|
|
44
52
|
|
|
@@ -48,6 +56,7 @@ const CheckoutUI = (props: any) => {
|
|
|
48
56
|
navigation={navigation}
|
|
49
57
|
cart={cart}
|
|
50
58
|
errors={errors}
|
|
59
|
+
customerName={customerName}
|
|
51
60
|
onPaymentChange={handlePaymethodChange}
|
|
52
61
|
onNavigationRedirect={onNavigationRedirect}
|
|
53
62
|
paySelected={paymethodSelected}
|
|
@@ -110,7 +119,7 @@ export const Checkout = (props: any) => {
|
|
|
110
119
|
loading: false,
|
|
111
120
|
cart: result
|
|
112
121
|
})
|
|
113
|
-
} catch (error) {
|
|
122
|
+
} catch (error: any) {
|
|
114
123
|
showToast(ToastType.Error, error?.toString() || error.message)
|
|
115
124
|
}
|
|
116
125
|
} else {
|
|
@@ -122,7 +131,7 @@ export const Checkout = (props: any) => {
|
|
|
122
131
|
error: cart ? null : result
|
|
123
132
|
})
|
|
124
133
|
}
|
|
125
|
-
} catch (e) {
|
|
134
|
+
} catch (e: any) {
|
|
126
135
|
setCartState({
|
|
127
136
|
...cartState,
|
|
128
137
|
loading: false,
|
|
@@ -113,12 +113,6 @@ const CustomerName = (props: Props): React.ReactElement => {
|
|
|
113
113
|
style={{ bottom: 20 }}
|
|
114
114
|
>
|
|
115
115
|
{t('WHATS_YOUR_NAME', "What's your name?")}
|
|
116
|
-
{/* <OText
|
|
117
|
-
size={orientationState?.dimensions?.width * 0.05}
|
|
118
|
-
weight={'700'}
|
|
119
|
-
>
|
|
120
|
-
{`${t('ORDER_BE_FOR', 'order be for?')}`}
|
|
121
|
-
</OText> */}
|
|
122
116
|
</OText>
|
|
123
117
|
<Controller
|
|
124
118
|
control={control}
|
|
@@ -395,7 +395,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
395
395
|
</View>
|
|
396
396
|
</OSTable>
|
|
397
397
|
|
|
398
|
-
{order?.products?.length && (
|
|
398
|
+
{order?.products?.length > 0 && (
|
|
399
399
|
<>
|
|
400
400
|
<View
|
|
401
401
|
style={{
|
|
@@ -598,7 +598,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
598
598
|
<>
|
|
599
599
|
<Spinner visible={!order || Object.keys(order).length === 0} />
|
|
600
600
|
|
|
601
|
-
{order && Object.keys(order).length > 0 && (
|
|
601
|
+
{!!order && Object.keys(order).length > 0 && (
|
|
602
602
|
<>
|
|
603
603
|
<Container>
|
|
604
604
|
<NavBar
|
|
@@ -107,7 +107,7 @@ const PaymentOptionsUI = (props: any) => {
|
|
|
107
107
|
|
|
108
108
|
const handlePlaceOrder = () => {
|
|
109
109
|
if (!userErrors.length) {
|
|
110
|
-
handlerClickPlaceOrder && handlerClickPlaceOrder();
|
|
110
|
+
handlerClickPlaceOrder && handlerClickPlaceOrder(null, { on_behalf_of: props.customerName });
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
let stringError = '';
|
|
@@ -144,7 +144,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
|
|
|
144
144
|
|
|
145
145
|
const validateSelectedDate = (curdate: any, menu: any) => {
|
|
146
146
|
const day = moment(curdate).format('d')
|
|
147
|
-
setIsEnabled(menu?.schedule[day]?.enabled || false)
|
|
147
|
+
setIsEnabled(menu?.schedule?.[day]?.enabled || false)
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
const getTimes = (curdate: any, menu: any) => {
|
|
@@ -57,12 +57,12 @@ const BusinessProductsCategoriesUI = (props: any) => {
|
|
|
57
57
|
|
|
58
58
|
if (!lazyLoadProductsRecommended) {
|
|
59
59
|
if (category?.id) {
|
|
60
|
-
scrollViewRef.current.scrollTo({
|
|
60
|
+
scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({
|
|
61
61
|
y: categoriesLayout[`cat_${category?.id}`]?.y + productListLayout?.y - 70,
|
|
62
62
|
animated: true
|
|
63
63
|
})
|
|
64
64
|
} else {
|
|
65
|
-
scrollViewRef.current.scrollTo({
|
|
65
|
+
scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({
|
|
66
66
|
y: productListLayout?.y - 70,
|
|
67
67
|
animated: true
|
|
68
68
|
})
|
|
@@ -106,7 +106,7 @@ const CartUI = (props: any) => {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
const getIncludedTaxes = () => {
|
|
109
|
-
if (cart?.taxes === null) {
|
|
109
|
+
if (cart?.taxes === null || !cart?.taxes) {
|
|
110
110
|
return cart.business.tax_type === 1 ? cart?.tax : 0
|
|
111
111
|
} else {
|
|
112
112
|
return cart?.taxes.reduce((taxIncluded: number, tax: any) => {
|
|
@@ -269,7 +269,7 @@ const CheckoutUI = (props: any) => {
|
|
|
269
269
|
onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
|
|
270
270
|
showCall={false}
|
|
271
271
|
btnStyle={{ paddingLeft: 0 }}
|
|
272
|
-
style={{
|
|
272
|
+
style={{ marginTop: Platform.OS === 'ios' ? 0 : 30 }}
|
|
273
273
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
274
274
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
275
275
|
/>
|
|
@@ -99,6 +99,8 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
99
99
|
const theme = useTheme();
|
|
100
100
|
const isOtpEmail = loginTab === 'otp' && otpType === 'email'
|
|
101
101
|
const isOtpCellphone = loginTab === 'otp' && otpType === 'cellphone'
|
|
102
|
+
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
103
|
+
|
|
102
104
|
const loginStyle = StyleSheet.create({
|
|
103
105
|
btnOutline: {
|
|
104
106
|
backgroundColor: '#FFF',
|
|
@@ -710,7 +712,7 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
710
712
|
handleSuccessFacebookLogin={handleSuccessFacebook}
|
|
711
713
|
/>
|
|
712
714
|
)}
|
|
713
|
-
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && (
|
|
715
|
+
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
|
|
714
716
|
<GoogleLogin
|
|
715
717
|
notificationState={notificationState}
|
|
716
718
|
webClientId={configs?.google_login_client_id?.value}
|
|
@@ -333,7 +333,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
333
333
|
};
|
|
334
334
|
|
|
335
335
|
const getIncludedTaxes = () => {
|
|
336
|
-
if (order?.taxes?.length === 0) {
|
|
336
|
+
if (order?.taxes?.length === 0 || !order?.taxes) {
|
|
337
337
|
return order.tax_type === 1 ? order?.summary?.tax ?? 0 : 0
|
|
338
338
|
} else {
|
|
339
339
|
return order?.taxes.reduce((taxIncluded: number, tax: any) => {
|
|
@@ -364,27 +364,6 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
364
364
|
)
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
const RenderGoogleMap = () => {
|
|
368
|
-
const driverLocationString = typeof order?.driver?.location?.location === 'string' && order?.driver?.location?.location?.split(',').map((l: string) => l.replace(/[^-.0-9]/g, ''))
|
|
369
|
-
const parsedLocations = locations.map(location => typeof location?.location === 'string' ? {
|
|
370
|
-
...location,
|
|
371
|
-
lat: parseFloat(location?.location?.split(',')[0].replace(/[^-.0-9]/g, '')),
|
|
372
|
-
lng: parseFloat(location?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
|
|
373
|
-
} : location)
|
|
374
|
-
|
|
375
|
-
return (
|
|
376
|
-
<GoogleMap
|
|
377
|
-
location={typeof order?.driver?.location?.location === 'string'
|
|
378
|
-
? {
|
|
379
|
-
lat: parseFloat(driverLocationString[0]),
|
|
380
|
-
lng: parseFloat(driverLocationString[1]),
|
|
381
|
-
} : order?.driver?.location
|
|
382
|
-
}
|
|
383
|
-
locations={parsedLocations}
|
|
384
|
-
readOnly
|
|
385
|
-
/>
|
|
386
|
-
)
|
|
387
|
-
}
|
|
388
367
|
|
|
389
368
|
useEffect(() => {
|
|
390
369
|
const _businessId = 'businessId:' + businessData?.id
|
|
@@ -436,6 +415,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
436
415
|
'https://res.cloudinary.com/demo/image/upload/c_thumb,g_face,r_max/d_avatar.png/non_existing_id.png',
|
|
437
416
|
},
|
|
438
417
|
];
|
|
418
|
+
const driverLocationString = typeof order?.driver?.location?.location === 'string' && order?.driver?.location?.location?.split(',').map((l: string) => l.replace(/[^-.0-9]/g, ''))
|
|
419
|
+
const parsedLocations = locations.map(location => typeof location?.location === 'string' ? {
|
|
420
|
+
...location,
|
|
421
|
+
lat: parseFloat(location?.location?.split(',')[0].replace(/[^-.0-9]/g, '')),
|
|
422
|
+
lng: parseFloat(location?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
|
|
423
|
+
} : location)
|
|
439
424
|
|
|
440
425
|
useEffect(() => {
|
|
441
426
|
if (driverLocation) {
|
|
@@ -697,7 +682,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
697
682
|
</OText>
|
|
698
683
|
</View>
|
|
699
684
|
)}
|
|
700
|
-
{order?.comment && (
|
|
685
|
+
{!!order?.comment && (
|
|
701
686
|
<View style={{ marginTop: 15 }}>
|
|
702
687
|
<OText size={16} style={{ textAlign: 'left' }} color={theme.colors.textNormal}>
|
|
703
688
|
{t('COMMENT', 'Comment')}
|
|
@@ -709,7 +694,16 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
709
694
|
<>
|
|
710
695
|
{order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
|
|
711
696
|
<Map>
|
|
712
|
-
<
|
|
697
|
+
<GoogleMap
|
|
698
|
+
location={typeof order?.driver?.location?.location === 'string'
|
|
699
|
+
? {
|
|
700
|
+
lat: parseFloat(driverLocationString[0]),
|
|
701
|
+
lng: parseFloat(driverLocationString[1]),
|
|
702
|
+
} : driverLocation ?? order?.driver?.location
|
|
703
|
+
}
|
|
704
|
+
locations={parsedLocations}
|
|
705
|
+
readOnly
|
|
706
|
+
/>
|
|
713
707
|
</Map>
|
|
714
708
|
)}
|
|
715
709
|
</>
|
|
@@ -71,7 +71,7 @@ const OrderSummaryUI = (props: any) => {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
const getIncludedTaxes = () => {
|
|
74
|
-
if (cart?.taxes === null) {
|
|
74
|
+
if (cart?.taxes === null || !cart?.taxes) {
|
|
75
75
|
return cart.business.tax_type === 1 ? cart?.tax : 0
|
|
76
76
|
} else {
|
|
77
77
|
return cart?.taxes.reduce((taxIncluded: number, tax: any) => {
|
|
@@ -9,7 +9,7 @@ import { PreviousOrders } from '../PreviousOrders'
|
|
|
9
9
|
|
|
10
10
|
import { OptionTitle, NoOrdersWrapper } from './styles'
|
|
11
11
|
import { OrdersOptionParams } from '../../types'
|
|
12
|
-
|
|
12
|
+
import { _setStoreData } from '../../providers/StoreUtil';
|
|
13
13
|
import {
|
|
14
14
|
Placeholder,
|
|
15
15
|
PlaceholderLine,
|
|
@@ -35,13 +35,15 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
35
35
|
setOrdersLength,
|
|
36
36
|
ordersLength,
|
|
37
37
|
refreshOrders,
|
|
38
|
-
setRefreshOrders
|
|
38
|
+
setRefreshOrders,
|
|
39
|
+
reorderState,
|
|
40
|
+
handleReorder
|
|
39
41
|
} = props
|
|
40
42
|
|
|
41
43
|
const theme = useTheme();
|
|
42
44
|
|
|
43
45
|
const [, t] = useLanguage()
|
|
44
|
-
const [
|
|
46
|
+
const [{ carts }] = useOrder()
|
|
45
47
|
const { showToast } = useToast()
|
|
46
48
|
const { loading, error, orders: values } = orderList
|
|
47
49
|
|
|
@@ -51,26 +53,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
51
53
|
|
|
52
54
|
const orders = customArray || values || []
|
|
53
55
|
|
|
54
|
-
const [reorderLoading, setReorderLoading] = useState(false)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const handleReorder = async (orderId: number) => {
|
|
58
|
-
setReorderLoading(true)
|
|
59
|
-
try {
|
|
60
|
-
const { error, result } = await reorder(orderId)
|
|
61
|
-
if (!error) {
|
|
62
|
-
onNavigationRedirect && onNavigationRedirect('CheckoutNavigator', { cartUuid: result.uuid })
|
|
63
|
-
setReorderLoading(false)
|
|
64
|
-
return
|
|
65
|
-
}
|
|
66
|
-
setReorderLoading(false)
|
|
67
|
-
|
|
68
|
-
} catch (err: any) {
|
|
69
|
-
showToast(ToastType.Error, t('ERROR', err.message))
|
|
70
|
-
setReorderLoading(false)
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
56
|
const getOrderStatus = (s: string) => {
|
|
75
57
|
const status = parseInt(s)
|
|
76
58
|
const orderStatus = [
|
|
@@ -105,6 +87,29 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
105
87
|
return objectStatus && objectStatus
|
|
106
88
|
}
|
|
107
89
|
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
const _businessId = 'businessId:' + reorderState?.result?.business_id
|
|
92
|
+
if (reorderState?.error) {
|
|
93
|
+
if (reorderState?.result?.business_id) {
|
|
94
|
+
_setStoreData('adjust-cart-products', JSON.stringify(_businessId))
|
|
95
|
+
navigation.navigate('Business', { store: reorderState?.result?.business?.slug })
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (!reorderState?.error && reorderState.loading === false && reorderState?.result?.business_id) {
|
|
99
|
+
const cartProducts = carts?.[_businessId]?.products
|
|
100
|
+
const available = cartProducts.every((product: any) => product.valid === true)
|
|
101
|
+
const orderProducts = orders.find((order: any) => order?.id === reorderState?.result?.orderId)?.products
|
|
102
|
+
|
|
103
|
+
if (available && reorderState?.result?.uuid && (cartProducts?.length === orderProducts?.length)) {
|
|
104
|
+
onNavigationRedirect && onNavigationRedirect('CheckoutNavigator', { cartUuid: reorderState?.result.uuid })
|
|
105
|
+
} else {
|
|
106
|
+
_setStoreData('adjust-cart-products', JSON.stringify(_businessId))
|
|
107
|
+
cartProducts?.length !== orderProducts?.length && _setStoreData('already-removed', JSON.stringify('removed'))
|
|
108
|
+
navigation.navigate('Business', { store: reorderState?.result?.business?.slug })
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, [reorderState])
|
|
112
|
+
|
|
108
113
|
useFocusEffect(
|
|
109
114
|
React.useCallback(() => {
|
|
110
115
|
loadOrders(false, false, false, true)
|
|
@@ -213,7 +218,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
213
218
|
orders={orders.filter((order: any) => orderStatus.includes(order.status))}
|
|
214
219
|
pagination={pagination}
|
|
215
220
|
loadMoreOrders={loadMoreOrders}
|
|
216
|
-
reorderLoading={
|
|
221
|
+
reorderLoading={reorderState?.loading}
|
|
217
222
|
customArray={customArray}
|
|
218
223
|
getOrderStatus={getOrderStatus}
|
|
219
224
|
onNavigationRedirect={onNavigationRedirect}
|
|
@@ -222,14 +227,14 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
222
227
|
<ActiveOrders
|
|
223
228
|
orders={orders.filter((order: any) => orderStatus.includes(order.status))}
|
|
224
229
|
pagination={pagination}
|
|
225
|
-
reorderLoading={
|
|
230
|
+
reorderLoading={reorderState?.loading}
|
|
226
231
|
customArray={customArray}
|
|
227
232
|
getOrderStatus={getOrderStatus}
|
|
228
233
|
onNavigationRedirect={onNavigationRedirect}
|
|
229
234
|
/>
|
|
230
235
|
) : (
|
|
231
236
|
<PreviousOrders
|
|
232
|
-
reorderLoading={
|
|
237
|
+
reorderLoading={reorderState?.loading}
|
|
233
238
|
orders={orders.filter((order: any) => orderStatus.includes(order.status)).sort((a: any, b: any) => a?.id < b?.id)}
|
|
234
239
|
pagination={pagination}
|
|
235
240
|
loadMoreOrders={loadMoreOrders}
|
|
@@ -135,6 +135,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
135
135
|
const recaptchaRef = useRef<any>({});
|
|
136
136
|
|
|
137
137
|
const showInputPhoneNumber = (validationFields?.fields?.checkout?.cellphone?.enabled ?? false) || configs?.verification_phone_required?.value === '1'
|
|
138
|
+
const googleLoginEnabled = configs?.google_login_enabled?.value === '1' || !configs?.google_login_enabled?.enabled
|
|
138
139
|
|
|
139
140
|
const handleRefs = (ref: any, code: string) => {
|
|
140
141
|
switch (code) {
|
|
@@ -787,7 +788,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
787
788
|
handleSuccessFacebookLogin={handleSuccessFacebook}
|
|
788
789
|
/>
|
|
789
790
|
)}
|
|
790
|
-
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && (
|
|
791
|
+
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
|
|
791
792
|
<GoogleLogin
|
|
792
793
|
notificationState={notificationState}
|
|
793
794
|
webClientId={configs?.google_login_client_id?.value}
|
|
@@ -21,6 +21,7 @@ interface Props extends TextInputProps {
|
|
|
21
21
|
isSecured?: boolean;
|
|
22
22
|
style?: ViewStyle;
|
|
23
23
|
placeholder?: string;
|
|
24
|
+
placeholderTextColor?:string;
|
|
24
25
|
icon?: ImageSourcePropType | string;
|
|
25
26
|
iconRight?: ImageSourcePropType;
|
|
26
27
|
iconColor?: string;
|
|
@@ -80,6 +81,7 @@ const OInput = (props: Props): React.ReactElement => {
|
|
|
80
81
|
onChangeText={(txt: any) => props.name ? props.onChange({ target: { name: props.name, value: txt } }) : props.onChange(txt)}
|
|
81
82
|
defaultValue={props.value}
|
|
82
83
|
placeholder={props.placeholder ? props.placeholder : ''}
|
|
84
|
+
placeholderTextColor={props?.placeholderTextColor ? props?.placeholderTextColor : 'initial'}
|
|
83
85
|
keyboardType={props.type || 'default'}
|
|
84
86
|
multiline={props.multiline}
|
|
85
87
|
scrollEnabled={props.multiline}
|
|
@@ -91,7 +91,7 @@ const OModal = (props: Props): React.ReactElement => {
|
|
|
91
91
|
animationType="slide"
|
|
92
92
|
transparent={isTransparent}
|
|
93
93
|
visible={open}
|
|
94
|
-
onRequestClose={() => onClose()}
|
|
94
|
+
onRequestClose={() => onClose && onClose()}
|
|
95
95
|
style={{ height: '100%', flex: 1, position: 'absolute', ...style, zIndex: 9999 }}
|
|
96
96
|
>
|
|
97
97
|
{isAvoidKeyBoardView ? (
|
|
@@ -311,6 +311,8 @@ export interface OrdersOptionParams {
|
|
|
311
311
|
loadOrders?: any,
|
|
312
312
|
setOrderList?: any,
|
|
313
313
|
preOrders?: boolean,
|
|
314
|
+
reorderState?: any,
|
|
315
|
+
handleReorder?: (orderId: number) => {},
|
|
314
316
|
setOrdersLength?: ({ activeOrdersLength, previousOrdersLength }: { activeOrdersLength: number, previousOrdersLength: number }) => void,
|
|
315
317
|
ordersLength: { activeOrdersLength: number, previousOrdersLength: number },
|
|
316
318
|
setSelectedOrderId?: any,
|
|
@@ -339,7 +341,7 @@ export interface PreviousOrdersParams {
|
|
|
339
341
|
orderID?: number
|
|
340
342
|
reorderLoading?: boolean,
|
|
341
343
|
loadMoreOrders?: () => {},
|
|
342
|
-
handleReorder
|
|
344
|
+
handleReorder?: (orderId: number) => {},
|
|
343
345
|
onNavigationRedirect?: (route: string, params?: any) => {}
|
|
344
346
|
}
|
|
345
347
|
export interface OrderDetailsParams {
|
|
@@ -579,6 +581,7 @@ export interface BusinessSearchParams {
|
|
|
579
581
|
setFilters: (filters: any) => void,
|
|
580
582
|
lazySearch?: boolean,
|
|
581
583
|
brandList?: any;
|
|
584
|
+
tags?: any;
|
|
582
585
|
}
|
|
583
586
|
|
|
584
587
|
export interface NoNetworkParams {
|