ordering-ui-react-native 0.17.26 → 0.17.27
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/BusinessProductsListing/index.tsx +9 -0
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/LoginForm/index.tsx +3 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/original/src/components/OrdersOption/index.tsx +33 -32
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/SignupForm/index.tsx +50 -49
- package/themes/original/src/components/SingleProductReview/index.tsx +8 -2
- package/themes/original/src/types/index.tsx +1 -0
package/package.json
CHANGED
|
@@ -23,6 +23,7 @@ import { BusinessProductsList } from '../BusinessProductsList'
|
|
|
23
23
|
import { BusinessProductsListingParams } from '../../types'
|
|
24
24
|
import { _retrieveStoreData, _removeStoreData } from '../../providers/StoreUtil';
|
|
25
25
|
import IconAntDesign from 'react-native-vector-icons/AntDesign';
|
|
26
|
+
import { useIsFocused } from '@react-navigation/native';
|
|
26
27
|
|
|
27
28
|
import {
|
|
28
29
|
TopHeader,
|
|
@@ -77,6 +78,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
77
78
|
const [{ parsePrice }] = useUtils()
|
|
78
79
|
const [, { showToast }] = useToast()
|
|
79
80
|
const [{ configs }] = useConfig()
|
|
81
|
+
const isFocused = useIsFocused();
|
|
80
82
|
const isPreOrder = configs?.preorder_status_enabled?.value === '1'
|
|
81
83
|
|
|
82
84
|
const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
|
|
@@ -245,6 +247,13 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
245
247
|
removeCartByReOrder()
|
|
246
248
|
}, [currentCart])
|
|
247
249
|
|
|
250
|
+
useEffect(() => {
|
|
251
|
+
if (!isFocused) {
|
|
252
|
+
handleChangeSearch('')
|
|
253
|
+
setIsOpenSearchBar(false)
|
|
254
|
+
}
|
|
255
|
+
}, [isFocused])
|
|
256
|
+
|
|
248
257
|
return (
|
|
249
258
|
<>
|
|
250
259
|
<View style={{ flex: 1 }}>
|
|
@@ -719,8 +719,9 @@ const LoginFormUI = (props: LoginParams) => {
|
|
|
719
719
|
)}
|
|
720
720
|
|
|
721
721
|
{configs && Object.keys(configs).length > 0 ? (
|
|
722
|
-
(((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value) ||
|
|
723
|
-
|
|
722
|
+
(((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value && facebookLoginEnabled) ||
|
|
723
|
+
((configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled) ||
|
|
724
|
+
((configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled)) &&
|
|
724
725
|
(
|
|
725
726
|
<>
|
|
726
727
|
<View
|
|
@@ -95,7 +95,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
|
|
|
95
95
|
<>
|
|
96
96
|
<NavBar
|
|
97
97
|
onActionLeft={() => goToBack()}
|
|
98
|
-
btnStyle={{ paddingLeft: 0 }}
|
|
98
|
+
btnStyle={{ paddingLeft: 0, width: 50 }}
|
|
99
99
|
paddingTop={0}
|
|
100
100
|
style={{ paddingBottom: 0 }}
|
|
101
101
|
title={t('HOW_WILL_YOU_DELIVERY_TYPE', 'How will your order type?')}
|
|
@@ -262,38 +262,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
262
262
|
)}
|
|
263
263
|
</>
|
|
264
264
|
)}
|
|
265
|
-
{
|
|
266
|
-
<>
|
|
267
|
-
{!activeOrders ? (
|
|
268
|
-
<Placeholder style={{ marginTop: 30 }} Animation={Fade}>
|
|
269
|
-
<View style={{ width: '100%', flexDirection: 'row' }}>
|
|
270
|
-
<PlaceholderLine width={20} height={70} style={{ marginRight: 20, marginBottom: 35 }} />
|
|
271
|
-
<Placeholder>
|
|
272
|
-
<PlaceholderLine width={30} style={{ marginTop: 5 }} />
|
|
273
|
-
<PlaceholderLine width={50} />
|
|
274
|
-
<PlaceholderLine width={70} />
|
|
275
|
-
</Placeholder>
|
|
276
|
-
</View>
|
|
277
|
-
</Placeholder>
|
|
278
|
-
) : (
|
|
279
|
-
<View style={{ marginTop: 30 }}>
|
|
280
|
-
{[...Array(5)].map((item, i) => (
|
|
281
|
-
<Placeholder key={i} Animation={Fade}>
|
|
282
|
-
<View style={{ width: '100%', flexDirection: 'row' }}>
|
|
283
|
-
<PlaceholderLine width={20} height={70} style={{ marginRight: 20, marginBottom: 20 }} />
|
|
284
|
-
<Placeholder>
|
|
285
|
-
<PlaceholderLine width={30} style={{ marginTop: 5 }} />
|
|
286
|
-
<PlaceholderLine width={50} />
|
|
287
|
-
<PlaceholderLine width={20} />
|
|
288
|
-
</Placeholder>
|
|
289
|
-
</View>
|
|
290
|
-
</Placeholder>
|
|
291
|
-
))}
|
|
292
|
-
</View>
|
|
293
|
-
)}
|
|
294
|
-
</>
|
|
295
|
-
)}
|
|
296
|
-
{!loading && !error && orders.length > 0 && !hideOrders && (
|
|
265
|
+
{!error && orders.length > 0 && !hideOrders && (
|
|
297
266
|
preOrders ? (
|
|
298
267
|
<ActiveOrders
|
|
299
268
|
orders={orders.filter((order: any) => orderStatus.includes(order.status))}
|
|
@@ -325,9 +294,41 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
325
294
|
onNavigationRedirect={onNavigationRedirect}
|
|
326
295
|
handleReorder={handleReorder}
|
|
327
296
|
handleUpdateOrderList={handleUpdateOrderList}
|
|
297
|
+
loading={loading}
|
|
328
298
|
/>
|
|
329
299
|
)
|
|
330
300
|
)}
|
|
301
|
+
{loading && !hideOrders && (
|
|
302
|
+
<>
|
|
303
|
+
{!activeOrders ? (
|
|
304
|
+
<Placeholder style={{ marginTop: 30 }} Animation={Fade}>
|
|
305
|
+
<View style={{ width: '100%', flexDirection: 'row' }}>
|
|
306
|
+
<PlaceholderLine width={20} height={70} style={{ marginRight: 20, marginBottom: 35 }} />
|
|
307
|
+
<Placeholder>
|
|
308
|
+
<PlaceholderLine width={30} style={{ marginTop: 5 }} />
|
|
309
|
+
<PlaceholderLine width={50} />
|
|
310
|
+
<PlaceholderLine width={70} />
|
|
311
|
+
</Placeholder>
|
|
312
|
+
</View>
|
|
313
|
+
</Placeholder>
|
|
314
|
+
) : (
|
|
315
|
+
<View style={{ marginTop: 30 }}>
|
|
316
|
+
{[...Array(5)].map((item, i) => (
|
|
317
|
+
<Placeholder key={i} Animation={Fade}>
|
|
318
|
+
<View style={{ width: '100%', flexDirection: 'row' }}>
|
|
319
|
+
<PlaceholderLine width={20} height={70} style={{ marginRight: 20, marginBottom: 20 }} />
|
|
320
|
+
<Placeholder>
|
|
321
|
+
<PlaceholderLine width={30} style={{ marginTop: 5 }} />
|
|
322
|
+
<PlaceholderLine width={50} />
|
|
323
|
+
<PlaceholderLine width={20} />
|
|
324
|
+
</Placeholder>
|
|
325
|
+
</View>
|
|
326
|
+
</Placeholder>
|
|
327
|
+
))}
|
|
328
|
+
</View>
|
|
329
|
+
)}
|
|
330
|
+
</>
|
|
331
|
+
)}
|
|
331
332
|
</>
|
|
332
333
|
)
|
|
333
334
|
}
|
|
@@ -19,7 +19,8 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
|
|
|
19
19
|
handleReorder,
|
|
20
20
|
reorderLoading,
|
|
21
21
|
orderID,
|
|
22
|
-
handleUpdateOrderList
|
|
22
|
+
handleUpdateOrderList,
|
|
23
|
+
loading
|
|
23
24
|
} = props;
|
|
24
25
|
|
|
25
26
|
const theme = useTheme();
|
|
@@ -42,7 +43,7 @@ export const PreviousOrders = (props: PreviousOrdersParams) => {
|
|
|
42
43
|
handleUpdateOrderList={handleUpdateOrderList}
|
|
43
44
|
/>
|
|
44
45
|
))}
|
|
45
|
-
{pagination.totalPages && pagination.currentPage < pagination.totalPages && (
|
|
46
|
+
{!loading && pagination.totalPages && pagination.currentPage < pagination.totalPages && (
|
|
46
47
|
<WrappButton>
|
|
47
48
|
<OButton
|
|
48
49
|
onClick={loadMoreOrders}
|
|
@@ -886,64 +886,65 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
886
886
|
</View>
|
|
887
887
|
)
|
|
888
888
|
}
|
|
889
|
-
<View
|
|
890
|
-
style={{
|
|
891
|
-
flexDirection: 'row',
|
|
892
|
-
width: '100%',
|
|
893
|
-
justifyContent: 'space-between',
|
|
894
|
-
alignItems: 'center',
|
|
895
|
-
marginVertical: 30,
|
|
896
|
-
}}>
|
|
897
|
-
<View style={style.line} />
|
|
898
|
-
<OText
|
|
899
|
-
size={14}
|
|
900
|
-
mBottom={10}
|
|
901
|
-
style={{ paddingHorizontal: 19 }}
|
|
902
|
-
color={theme.colors.disabled}>
|
|
903
|
-
{t('OR', 'or')}
|
|
904
|
-
</OText>
|
|
905
|
-
<View style={style.line} />
|
|
906
|
-
</View>
|
|
907
|
-
|
|
908
889
|
{configs && Object.keys(configs).length > 0 && (
|
|
909
|
-
(((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value) ||
|
|
910
|
-
(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null))
|
|
890
|
+
(((configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') && configs?.facebook_id?.value && facebookLoginEnabled) ||
|
|
891
|
+
((configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled) ||
|
|
892
|
+
((configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled)) &&
|
|
911
893
|
(
|
|
912
|
-
|
|
913
|
-
<
|
|
914
|
-
{
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
894
|
+
<>
|
|
895
|
+
<View
|
|
896
|
+
style={{
|
|
897
|
+
flexDirection: 'row',
|
|
898
|
+
width: '100%',
|
|
899
|
+
justifyContent: 'space-between',
|
|
900
|
+
alignItems: 'center',
|
|
901
|
+
marginVertical: 30,
|
|
902
|
+
}}>
|
|
903
|
+
<View style={style.line} />
|
|
904
|
+
<OText
|
|
905
|
+
size={14}
|
|
906
|
+
mBottom={10}
|
|
907
|
+
style={{ paddingHorizontal: 19 }}
|
|
908
|
+
color={theme.colors.disabled}>
|
|
909
|
+
{t('OR', 'or')}
|
|
910
|
+
</OText>
|
|
911
|
+
<View style={style.line} />
|
|
912
|
+
</View>
|
|
913
|
+
<ButtonsWrapper>
|
|
914
|
+
<SocialButtons>
|
|
915
|
+
{(configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1') &&
|
|
916
|
+
configs?.facebook_id?.value &&
|
|
917
|
+
facebookLoginEnabled &&
|
|
918
|
+
(
|
|
919
|
+
<FacebookLogin
|
|
920
|
+
notificationState={notificationState}
|
|
921
|
+
handleErrors={(err: any) => showToast(ToastType.Error, err)}
|
|
922
|
+
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
923
|
+
handleSuccessFacebookLogin={handleSuccessFacebook}
|
|
924
|
+
/>
|
|
925
|
+
)}
|
|
926
|
+
{(configs?.google_login_client_id?.value !== '' && configs?.google_login_client_id?.value !== null) && googleLoginEnabled && (
|
|
927
|
+
<GoogleLogin
|
|
919
928
|
notificationState={notificationState}
|
|
929
|
+
webClientId={configs?.google_login_client_id?.value}
|
|
920
930
|
handleErrors={(err: any) => showToast(ToastType.Error, err)}
|
|
921
931
|
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
922
|
-
|
|
932
|
+
handleSuccessGoogleLogin={handleSuccessFacebook}
|
|
923
933
|
/>
|
|
924
934
|
)}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
notificationState={notificationState}
|
|
937
|
-
handleErrors={(err: any) => showToast(ToastType.Error, err)}
|
|
938
|
-
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
939
|
-
handleSuccessAppleLogin={handleSuccessFacebook}
|
|
940
|
-
/>
|
|
941
|
-
)}
|
|
942
|
-
</SocialButtons>
|
|
943
|
-
</ButtonsWrapper>
|
|
935
|
+
{(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled && (
|
|
936
|
+
<AppleLogin
|
|
937
|
+
notificationState={notificationState}
|
|
938
|
+
handleErrors={(err: any) => showToast(ToastType.Error, err)}
|
|
939
|
+
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
940
|
+
handleSuccessAppleLogin={handleSuccessFacebook}
|
|
941
|
+
/>
|
|
942
|
+
)}
|
|
943
|
+
</SocialButtons>
|
|
944
|
+
</ButtonsWrapper>
|
|
945
|
+
</>
|
|
944
946
|
)
|
|
945
947
|
)}
|
|
946
|
-
|
|
947
948
|
</FormSide>
|
|
948
949
|
<OModal
|
|
949
950
|
open={willVerifyOtpState}
|
|
@@ -64,6 +64,12 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
|
|
|
64
64
|
return found
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
const handleChangeQualification = (index: number) => {
|
|
68
|
+
if (qualification === index) return
|
|
69
|
+
setQualification(index)
|
|
70
|
+
setComments([])
|
|
71
|
+
}
|
|
72
|
+
|
|
67
73
|
const handleChangeComment = (commentItem: any) => {
|
|
68
74
|
const found = comments.find((comment: any) => comment?.key === commentItem.key)
|
|
69
75
|
if (found) {
|
|
@@ -132,11 +138,11 @@ export const SingleProductReview = (props: SingleProductReviewParams) => {
|
|
|
132
138
|
<LikeHandsActionContainer>
|
|
133
139
|
<LikeHandsButton
|
|
134
140
|
isLike
|
|
135
|
-
onPress={() =>
|
|
141
|
+
onPress={() => handleChangeQualification(5)}
|
|
136
142
|
>
|
|
137
143
|
<AntDesignIcons name='like2' size={20} color={qualification === 5 ? theme.colors.primary : theme.colors.lightGray} />
|
|
138
144
|
</LikeHandsButton>
|
|
139
|
-
<LikeHandsButton onPress={() =>
|
|
145
|
+
<LikeHandsButton onPress={() => handleChangeQualification(1)}>
|
|
140
146
|
<AntDesignIcons name='dislike2' size={20} color={qualification === 1 ? theme.colors.primary : theme.colors.lightGray} />
|
|
141
147
|
</LikeHandsButton>
|
|
142
148
|
</LikeHandsActionContainer>
|
|
@@ -396,6 +396,7 @@ export interface PreviousOrdersParams {
|
|
|
396
396
|
getOrderStatus?: any,
|
|
397
397
|
orderID?: number
|
|
398
398
|
reorderLoading?: boolean,
|
|
399
|
+
loading?: boolean,
|
|
399
400
|
loadMoreOrders?: () => {},
|
|
400
401
|
handleReorder?: (orderId: number) => {},
|
|
401
402
|
onNavigationRedirect?: (route: string, params?: any) => {}
|