ordering-ui-react-native 0.17.79 → 0.17.81
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/NewOrderNotification/index.tsx +5 -0
- package/themes/original/src/components/BusinessProductsListing/index.tsx +2 -1
- package/themes/original/src/components/Checkout/index.tsx +2 -2
- package/themes/original/src/components/Favorite/index.tsx +1 -1
- package/themes/original/src/components/Help/index.tsx +2 -2
- package/themes/original/src/components/HelpGuide/index.tsx +2 -2
- package/themes/original/src/components/HelpGuide/styles.tsx +1 -0
- package/themes/original/src/components/ProductForm/index.tsx +16 -7
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +1 -1
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +4 -0
- package/themes/original/src/components/SingleOrderCard/index.tsx +7 -5
- package/themes/original/src/components/UpsellingProducts/index.tsx +4 -12
- package/themes/original/src/components/UserProfileForm/index.tsx +3 -1
- package/themes/original/src/components/UserProfileForm/styles.tsx +1 -1
package/package.json
CHANGED
|
@@ -96,10 +96,15 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
96
96
|
events.on('message_added_notification', (o: any) => handleEventNotification(1, o))
|
|
97
97
|
events.on('order_added_notification', (o: any) => handleEventNotification(2, o))
|
|
98
98
|
events.on('order_updated_notification', (o: any) => handleEventNotification(3, o))
|
|
99
|
+
events.on('request_register_notification', (o: any) => handleEventNotification(2, o))
|
|
100
|
+
events.on('request_update_notification', (o: any) => handleEventNotification(3, o))
|
|
101
|
+
|
|
99
102
|
return () => {
|
|
100
103
|
events.off('message_added_notification', (o: any) => handleEventNotification(1, o))
|
|
101
104
|
events.off('order_added_notification', (o: any) => handleEventNotification(2, o))
|
|
102
105
|
events.off('order_updated_notification', (o: any) => handleEventNotification(3, o))
|
|
106
|
+
events.off('request_register_notification', (o: any) => handleEventNotification(2, o))
|
|
107
|
+
events.off('request_update_notification', (o: any) => handleEventNotification(3, o))
|
|
103
108
|
}
|
|
104
109
|
}, [])
|
|
105
110
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
|
-
import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView } from 'react-native'
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView, Vibration } from 'react-native'
|
|
3
3
|
import { IOScrollView } from 'react-native-intersection-observer'
|
|
4
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
5
5
|
import { useTheme } from 'styled-components/native';
|
|
@@ -156,6 +156,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
156
156
|
code: isProductAddedToCart?.code,
|
|
157
157
|
quantity: productQuantity + 1
|
|
158
158
|
}
|
|
159
|
+
Vibration.vibrate()
|
|
159
160
|
const cartData = currentCart?.business_id ? currentCart : { business_id: business.id }
|
|
160
161
|
if (isProductAddedToCart) {
|
|
161
162
|
await updateProduct(updateCurrentProduct, cartData, isQuickAddProduct)
|
|
@@ -308,7 +308,7 @@ const CheckoutUI = (props: any) => {
|
|
|
308
308
|
titleAlign={'center'}
|
|
309
309
|
onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
|
|
310
310
|
showCall={false}
|
|
311
|
-
btnStyle={{ paddingLeft: 0 }}
|
|
311
|
+
btnStyle={{ paddingLeft: 0, paddingTop: Platform.OS == 'ios' ? 0 : 2 }}
|
|
312
312
|
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
313
313
|
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
314
314
|
/>
|
|
@@ -578,7 +578,7 @@ const CheckoutUI = (props: any) => {
|
|
|
578
578
|
cart={cart}
|
|
579
579
|
isDisabled={cart?.status === 2}
|
|
580
580
|
businessId={!isGiftCardCart ? businessDetails?.business?.id : -1}
|
|
581
|
-
|
|
581
|
+
isLoading={!isGiftCardCart ? businessDetails.loading : false}
|
|
582
582
|
paymethods={businessDetails?.business?.paymethods}
|
|
583
583
|
onPaymentChange={handlePaymethodChange}
|
|
584
584
|
errorCash={errorCash}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { RefreshControl } from 'react-native'
|
|
2
|
+
import { Platform, RefreshControl } from 'react-native'
|
|
3
3
|
import { HelpParams } from '../../types'
|
|
4
4
|
import { useLanguage } from 'ordering-components/native'
|
|
5
5
|
import NavBar from '../NavBar'
|
|
@@ -31,7 +31,7 @@ export const Help = (props: HelpParams) => {
|
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<Container
|
|
34
|
-
pt={10}
|
|
34
|
+
pt={Platform.OS === 'ios' ? 20 : 10}
|
|
35
35
|
noPadding
|
|
36
36
|
refreshControl={
|
|
37
37
|
<RefreshControl
|
|
@@ -3,7 +3,7 @@ import { useLanguage } from 'ordering-components/native'
|
|
|
3
3
|
import { HelpGuideParams } from '../../types'
|
|
4
4
|
import { OText, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet } from 'react-native'
|
|
6
|
+
import { Platform, StyleSheet } from 'react-native'
|
|
7
7
|
import NavBar from '../NavBar'
|
|
8
8
|
import {
|
|
9
9
|
Content,
|
|
@@ -37,7 +37,7 @@ export const HelpGuide = (props: HelpGuideParams) => {
|
|
|
37
37
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
|
-
<Container>
|
|
40
|
+
<Container pdng={Platform.OS === 'ios' ? '10px' : '0px'}>
|
|
41
41
|
<NavBar
|
|
42
42
|
title={t('GUIDE_TO_ORDERING', 'Guide to Ordering')}
|
|
43
43
|
onActionLeft={goToBack}
|
|
@@ -51,6 +51,7 @@ import { ScrollView } from 'react-native-gesture-handler';
|
|
|
51
51
|
import { ProductOptionSubOption } from '../ProductOptionSubOption';
|
|
52
52
|
import { NotFoundSource } from '../NotFoundSource';
|
|
53
53
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
54
|
+
import NavBar from '../NavBar';
|
|
54
55
|
const windowWidth = Dimensions.get('window').width;
|
|
55
56
|
|
|
56
57
|
export const ProductOptionsUI = (props: any) => {
|
|
@@ -166,6 +167,11 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
166
167
|
justifyContent: 'space-between',
|
|
167
168
|
width: '100%',
|
|
168
169
|
marginTop: 10
|
|
170
|
+
},
|
|
171
|
+
wrapperNavbar: {
|
|
172
|
+
paddingVertical: 0,
|
|
173
|
+
paddingHorizontal: 40,
|
|
174
|
+
marginVertical: 2
|
|
169
175
|
}
|
|
170
176
|
});
|
|
171
177
|
|
|
@@ -208,7 +214,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
208
214
|
};
|
|
209
215
|
|
|
210
216
|
const handleSaveProduct = () => {
|
|
211
|
-
|
|
217
|
+
Vibration.vibrate()
|
|
212
218
|
if (!productCart.quantity) {
|
|
213
219
|
showToast(ToastType.Error, t('VALIDATION_ERROR_REQUIRED', 'The quantity field is required').replace('_attribute_', t('PRODUCT_POTIONS_QUANTITY', 'Quantity')))
|
|
214
220
|
return
|
|
@@ -483,14 +489,17 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
483
489
|
}
|
|
484
490
|
}, [])
|
|
485
491
|
|
|
486
|
-
|
|
487
492
|
return (
|
|
488
493
|
<SafeAreaView style={{ flex: 1 }}>
|
|
489
|
-
<
|
|
490
|
-
<
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
+
<View style={styles.wrapperNavbar}>
|
|
495
|
+
<NavBar
|
|
496
|
+
onActionLeft={() => handleGoBack()}
|
|
497
|
+
showCall={false}
|
|
498
|
+
btnStyle={{ paddingLeft: 0, paddingTop: Platform.OS == 'ios' ? 0 : 2 }}
|
|
499
|
+
titleWrapStyle={{ paddingHorizontal: 0 }}
|
|
500
|
+
titleStyle={{ marginRight: 0, marginLeft: 0 }}
|
|
501
|
+
/>
|
|
502
|
+
</View>
|
|
494
503
|
{!error && (
|
|
495
504
|
<ScrollView
|
|
496
505
|
ref={scrollViewRef}
|
|
@@ -32,7 +32,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
32
32
|
setIsScrollAvailable
|
|
33
33
|
} = props
|
|
34
34
|
|
|
35
|
-
const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
|
|
35
|
+
const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max || state.quantity === suboption?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
|
|
36
36
|
const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
|
|
37
37
|
|
|
38
38
|
const theme = useTheme();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { View, TouchableOpacity } from 'react-native'
|
|
2
|
+
import { View, TouchableOpacity, Platform } from 'react-native'
|
|
3
3
|
import { useLanguage, useSession, useUtils, Sessions as SessionsController } from 'ordering-components/native'
|
|
4
4
|
import NavBar from '../NavBar'
|
|
5
5
|
import { SessionsParams } from '../../types'
|
|
@@ -12,7 +12,8 @@ import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
|
12
12
|
import {
|
|
13
13
|
SessionsWrapper,
|
|
14
14
|
SessionItem,
|
|
15
|
-
DurationWrapper
|
|
15
|
+
DurationWrapper,
|
|
16
|
+
Container
|
|
16
17
|
} from './styles'
|
|
17
18
|
|
|
18
19
|
export const SessionsUI = (props: SessionsParams) => {
|
|
@@ -27,7 +28,7 @@ export const SessionsUI = (props: SessionsParams) => {
|
|
|
27
28
|
const [, t] = useLanguage()
|
|
28
29
|
const [{ user }] = useSession()
|
|
29
30
|
const [{ parseDate }] = useUtils()
|
|
30
|
-
|
|
31
|
+
const theme = useTheme()
|
|
31
32
|
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
32
33
|
const goToBack = () => navigation?.canGoBack() && navigation.goBack()
|
|
33
34
|
|
|
@@ -61,7 +62,9 @@ export const SessionsUI = (props: SessionsParams) => {
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
return (
|
|
64
|
-
|
|
65
|
+
<Container
|
|
66
|
+
pdng={Platform.OS === 'ios' ? '10px' : '0'}
|
|
67
|
+
>
|
|
65
68
|
<NavBar
|
|
66
69
|
title={t('SESSIONS', 'Sessions')}
|
|
67
70
|
titleAlign={'center'}
|
|
@@ -77,11 +80,11 @@ export const SessionsUI = (props: SessionsParams) => {
|
|
|
77
80
|
<SessionItem key={i}>
|
|
78
81
|
<Placeholder Animation={Fade}>
|
|
79
82
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
80
|
-
<View style={{ flex: 1}}>
|
|
83
|
+
<View style={{ flex: 1 }}>
|
|
81
84
|
<PlaceholderLine width={40} />
|
|
82
85
|
<PlaceholderLine width={40} />
|
|
83
86
|
</View>
|
|
84
|
-
<PlaceholderLine width={5}/>
|
|
87
|
+
<PlaceholderLine width={5} />
|
|
85
88
|
</View>
|
|
86
89
|
</Placeholder>
|
|
87
90
|
</SessionItem>
|
|
@@ -120,7 +123,7 @@ export const SessionsUI = (props: SessionsParams) => {
|
|
|
120
123
|
style={{ borderRadius: 7.6, marginTop: 20 }}
|
|
121
124
|
/>
|
|
122
125
|
</SessionsWrapper>
|
|
123
|
-
|
|
126
|
+
) : (
|
|
124
127
|
<OText>{t('YOU_DONT_HAVE_ANY_SESSIONS', 'You don\'t have any sessions')}</OText>
|
|
125
128
|
)
|
|
126
129
|
)}
|
|
@@ -147,7 +150,7 @@ export const SessionsUI = (props: SessionsParams) => {
|
|
|
147
150
|
onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
148
151
|
onClose={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
149
152
|
/>
|
|
150
|
-
|
|
153
|
+
</Container>
|
|
151
154
|
)
|
|
152
155
|
}
|
|
153
156
|
|
|
@@ -84,9 +84,13 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
84
84
|
marginRight: 2,
|
|
85
85
|
},
|
|
86
86
|
reorderLoading: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
height: 23,
|
|
88
|
+
paddingLeft: 20,
|
|
89
|
+
paddingRight: 20,
|
|
90
|
+
borderRadius: 23,
|
|
91
|
+
shadowOpacity: 0,
|
|
92
|
+
backgroundColor: theme.colors.primary,
|
|
93
|
+
borderWidth: 0,
|
|
90
94
|
},
|
|
91
95
|
reorderbutton: {
|
|
92
96
|
height: 23,
|
|
@@ -183,8 +187,6 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
183
187
|
|
|
184
188
|
const handleOriginalReorder = () => {
|
|
185
189
|
setConfirm({ ...confirm, open: false, title: null })
|
|
186
|
-
setReorderSelected(order?.id);
|
|
187
|
-
handleReorder && handleReorder(order?.id);
|
|
188
190
|
}
|
|
189
191
|
|
|
190
192
|
return (
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
import { OrderSummary } from '../OrderSummary';
|
|
22
22
|
import { ScrollView } from 'react-native-gesture-handler';
|
|
23
23
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
24
|
-
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
25
24
|
|
|
26
25
|
const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
27
26
|
const {
|
|
@@ -166,17 +165,10 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
|
|
|
166
165
|
const UpsellingContent = () => {
|
|
167
166
|
return (
|
|
168
167
|
<>
|
|
169
|
-
<View style={{ ...styles.headerItem, flex: 1, marginTop: Platform.OS == 'ios' ? 35 :
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
onClick={() => onGoBack()}
|
|
174
|
-
icon={AntDesignIcon}
|
|
175
|
-
iconProps={{
|
|
176
|
-
name: 'arrowleft',
|
|
177
|
-
size: 26
|
|
178
|
-
}}
|
|
179
|
-
/>
|
|
168
|
+
<View style={{ ...styles.headerItem, flex: 1, marginTop: Platform.OS == 'ios' ? 35 : 14 }}>
|
|
169
|
+
<TouchableOpacity onPress={() => onGoBack()} style={styles.btnBackArrow}>
|
|
170
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
171
|
+
</TouchableOpacity>
|
|
180
172
|
</View>
|
|
181
173
|
<ScrollView style={{ marginTop: 10, marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
|
|
182
174
|
{productsList.length > 0 &&
|