ordering-ui-react-native 0.18.38 → 0.18.40-test
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/DriverMap/index.tsx +1 -1
- package/themes/business/src/components/OrderSummary/index.tsx +120 -124
- package/themes/original/src/components/AddressForm/index.tsx +7 -4
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +18 -3
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +0 -3
- package/themes/original/src/components/BusinessController/index.tsx +3 -3
- package/themes/original/src/components/BusinessListingSearch/index.tsx +331 -276
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +49 -8
- package/themes/original/src/components/CartContent/index.tsx +56 -14
- package/themes/original/src/components/CartContent/styles.tsx +4 -0
- package/themes/original/src/components/Checkout/index.tsx +6 -5
- package/themes/original/src/components/GoogleMap/index.tsx +11 -2
- package/themes/original/src/components/LoginForm/index.tsx +15 -14
- package/themes/original/src/components/MultiCheckout/index.tsx +6 -5
- package/themes/original/src/components/MyOrders/index.tsx +14 -1
- package/themes/original/src/components/NavBar/index.tsx +9 -4
- package/themes/original/src/components/OrderSummary/index.tsx +4 -2
- package/themes/original/src/components/OrdersOption/index.tsx +3 -1
- package/themes/original/src/components/ProductForm/index.tsx +23 -11
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +7 -5
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +2 -2
- package/themes/original/src/components/SignupForm/index.tsx +14 -14
- package/themes/original/src/components/SingleOrderCard/index.tsx +7 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +17 -16
- package/themes/original/src/components/UserFormDetails/index.tsx +34 -5
- package/themes/original/src/components/UserProfile/index.tsx +2 -20
- package/themes/original/src/components/UserProfileForm/index.tsx +7 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +4 -4
- package/themes/original/src/types/index.tsx +2 -2
- package/themes/original/src/utils/index.tsx +11 -0
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
I18nManager,
|
|
10
10
|
SafeAreaView,
|
|
11
11
|
Platform,
|
|
12
|
-
Button
|
|
13
|
-
Vibration
|
|
12
|
+
Button
|
|
14
13
|
} from 'react-native';
|
|
15
14
|
import {
|
|
16
15
|
ProductForm as ProductOptions,
|
|
@@ -55,7 +54,7 @@ import { ProductOptionSubOption } from '../ProductOptionSubOption';
|
|
|
55
54
|
import { NotFoundSource } from '../NotFoundSource';
|
|
56
55
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
57
56
|
import NavBar from '../NavBar';
|
|
58
|
-
import { orderTypeList } from '../../utils';
|
|
57
|
+
import { orderTypeList, vibrateApp } from '../../utils';
|
|
59
58
|
const windowWidth = Dimensions.get('window').width;
|
|
60
59
|
|
|
61
60
|
export const ProductOptionsUI = (props: any) => {
|
|
@@ -206,6 +205,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
206
205
|
const [isScrollAvailable, setIsScrollAvailable] = useState(null)
|
|
207
206
|
const [editionsLayoutY, setEditionsLayoutY] = useState(null)
|
|
208
207
|
const [viewedProduct, setViewedProduct] = useState<any>(null)
|
|
208
|
+
const [showTitle, setShowTitle] = useState(false)
|
|
209
209
|
|
|
210
210
|
const guestCheckoutEnabled = configs?.guest_checkout_enabled?.value === '1'
|
|
211
211
|
const orderTypeEnabled = !orderTypeList[orderState?.options?.type - 1] || configs?.allowed_order_types_guest_checkout?.value?.includes(orderTypeList[orderState?.options?.type - 1])
|
|
@@ -225,7 +225,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
225
225
|
};
|
|
226
226
|
|
|
227
227
|
const handleSaveProduct = () => {
|
|
228
|
-
|
|
228
|
+
vibrateApp()
|
|
229
229
|
if (!productCart.quantity) {
|
|
230
230
|
showToast(ToastType.Error, t('VALIDATION_ERROR_REQUIRED', 'The quantity field is required').replace('_attribute_', t('PRODUCT_POTIONS_QUANTITY', 'Quantity')))
|
|
231
231
|
return
|
|
@@ -363,7 +363,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
363
363
|
);
|
|
364
364
|
|
|
365
365
|
const handleScroll = ({ nativeEvent: { contentOffset, layoutMeasurement } }: any) => {
|
|
366
|
-
|
|
366
|
+
setShowTitle(contentOffset.y > 30)
|
|
367
367
|
const _topOption = Object.keys(optionLayout).find(((option: any) => Math.abs(contentOffset?.y - layoutMeasurement?.height - optionLayout[option]?.y) < 20))
|
|
368
368
|
if (_topOption) {
|
|
369
369
|
const _topOptionId = Number(_topOption.replace('id:', ''))
|
|
@@ -527,12 +527,24 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
527
527
|
return (
|
|
528
528
|
<SafeAreaView style={{ flex: 1 }}>
|
|
529
529
|
<View style={styles.wrapperNavbar}>
|
|
530
|
-
<
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
530
|
+
<TopHeader>
|
|
531
|
+
<>
|
|
532
|
+
<TopActions onPress={() => handleGoBack()}>
|
|
533
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
534
|
+
</TopActions>
|
|
535
|
+
{showTitle && (
|
|
536
|
+
<OText
|
|
537
|
+
size={16}
|
|
538
|
+
style={{ flex: 1, textAlign: 'center' }}
|
|
539
|
+
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
540
|
+
numberOfLines={2}
|
|
541
|
+
ellipsizeMode='tail'
|
|
542
|
+
>
|
|
543
|
+
{product?.name}
|
|
544
|
+
</OText>
|
|
545
|
+
)}
|
|
546
|
+
</>
|
|
547
|
+
</TopHeader>
|
|
536
548
|
</View>
|
|
537
549
|
{!error && (
|
|
538
550
|
<ScrollView
|
|
@@ -41,8 +41,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
41
41
|
const [showMessage, setShowMessage] = useState(false)
|
|
42
42
|
const [isDirty, setIsDirty] = useState(false)
|
|
43
43
|
|
|
44
|
-
const
|
|
45
|
-
const iconsSize = isChewLayout ? 20 : 16
|
|
44
|
+
const iconsSize = 20
|
|
46
45
|
|
|
47
46
|
const handleSuboptionClick = () => {
|
|
48
47
|
toggleSelect()
|
|
@@ -117,7 +116,8 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
117
116
|
<OIcon
|
|
118
117
|
src={theme.images.general.half_l}
|
|
119
118
|
color={state.selected && state.position === 'left' ? theme.colors.primary : '#cbcbcb'}
|
|
120
|
-
width={
|
|
119
|
+
width={20}
|
|
120
|
+
height={20}
|
|
121
121
|
style={styles.inverse}
|
|
122
122
|
/>
|
|
123
123
|
</Circle>
|
|
@@ -125,14 +125,16 @@ export const ProductOptionSubOptionUI = (props: any) => {
|
|
|
125
125
|
<OIcon
|
|
126
126
|
src={theme.images.general.half_f}
|
|
127
127
|
color={state.selected && state.position === 'whole' ? theme.colors.primary : '#cbcbcb'}
|
|
128
|
-
width={
|
|
128
|
+
width={20}
|
|
129
|
+
height={20}
|
|
129
130
|
/>
|
|
130
131
|
</Circle>
|
|
131
132
|
<Circle disabled={disabled} onPress={() => changePosition('right')}>
|
|
132
133
|
<OIcon
|
|
133
134
|
src={theme.images.general.half_r}
|
|
134
135
|
color={state.selected && state.position === 'right' ? theme.colors.primary : '#cbcbcb'}
|
|
135
|
-
width={
|
|
136
|
+
width={20}
|
|
137
|
+
height={20}
|
|
136
138
|
/>
|
|
137
139
|
</Circle>
|
|
138
140
|
</>
|
|
@@ -10,7 +10,7 @@ export const Container = styled.TouchableOpacity`
|
|
|
10
10
|
export const IconControl = styled.TouchableOpacity`
|
|
11
11
|
flex-direction: row;
|
|
12
12
|
padding: 10px;
|
|
13
|
-
width:
|
|
13
|
+
width: 38%;
|
|
14
14
|
align-items: center;
|
|
15
15
|
`
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ export const QuantityControl = styled.View`
|
|
|
18
18
|
flex-direction: row;
|
|
19
19
|
align-items: center;
|
|
20
20
|
justify-content: flex-start;
|
|
21
|
-
margin-
|
|
21
|
+
margin-right: 5px;
|
|
22
22
|
flex: 1;
|
|
23
23
|
width: 60px;
|
|
24
24
|
`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { View, Pressable, StyleSheet, Linking, Platform, TouchableOpacity
|
|
2
|
+
import { View, Pressable, StyleSheet, Linking, Platform, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { useForm, Controller } from 'react-hook-form';
|
|
4
4
|
import Spinner from 'react-native-loading-spinner-overlay';
|
|
5
5
|
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
@@ -37,7 +37,7 @@ import Alert from '../../../../../src/providers/AlertProvider'
|
|
|
37
37
|
import { OText, OButton, OInput } from '../shared';
|
|
38
38
|
import { OModal } from '../../../../../src/components/shared';
|
|
39
39
|
import { SignupParams } from '../../types';
|
|
40
|
-
import { sortInputFields } from '../../utils';
|
|
40
|
+
import { sortInputFields, vibrateApp } from '../../utils';
|
|
41
41
|
import { GoogleLogin } from '../GoogleLogin';
|
|
42
42
|
import { AppleLogin } from '../AppleLogin';
|
|
43
43
|
|
|
@@ -246,7 +246,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
246
246
|
const onSubmit = (values?: any) => {
|
|
247
247
|
if (phoneInputData.error && signUpTab !== 'otpEmail') {
|
|
248
248
|
showToast(ToastType.Error, phoneInputData.error);
|
|
249
|
-
|
|
249
|
+
vibrateApp()
|
|
250
250
|
return;
|
|
251
251
|
}
|
|
252
252
|
if (
|
|
@@ -264,7 +264,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
264
264
|
'The field Mobile phone is required.',
|
|
265
265
|
),
|
|
266
266
|
);
|
|
267
|
-
|
|
267
|
+
vibrateApp()
|
|
268
268
|
return;
|
|
269
269
|
}
|
|
270
270
|
if (signUpTab === 'otpEmail' || signUpTab === 'otpCellphone') {
|
|
@@ -333,7 +333,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
333
333
|
await Linking.openURL(url);
|
|
334
334
|
} else {
|
|
335
335
|
showToast(ToastType.Error, t('VALIDATION_ERROR_ACTIVE_URL', 'The _attribute_ is not a valid URL.').replace('_attribute_', t('URL', 'URL')))
|
|
336
|
-
|
|
336
|
+
vibrateApp()
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
|
|
@@ -341,12 +341,12 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
341
341
|
setRecaptchaVerified(false)
|
|
342
342
|
if (!recaptchaConfig?.siteKey) {
|
|
343
343
|
showToast(ToastType.Error, t('NO_RECAPTCHA_SITE_KEY', 'The config doesn\'t have recaptcha site key'));
|
|
344
|
-
|
|
344
|
+
vibrateApp()
|
|
345
345
|
return
|
|
346
346
|
}
|
|
347
347
|
if (!recaptchaConfig?.baseUrl) {
|
|
348
348
|
showToast(ToastType.Error, t('NO_RECAPTCHA_BASE_URL', 'The config doesn\'t have recaptcha base url'));
|
|
349
|
-
|
|
349
|
+
vibrateApp()
|
|
350
350
|
return
|
|
351
351
|
}
|
|
352
352
|
recaptchaRef.current.open()
|
|
@@ -390,11 +390,11 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
390
390
|
baseUrl: configs?.security_recaptcha_base_url?.value || null
|
|
391
391
|
})
|
|
392
392
|
showToast(ToastType.Info, t('TRY_AGAIN', 'Please try again'))
|
|
393
|
-
|
|
393
|
+
vibrateApp()
|
|
394
394
|
return
|
|
395
395
|
}
|
|
396
396
|
formState.result?.result && showToast(ToastType.Error, formState.result?.result[0]);
|
|
397
|
-
formState.result?.result &&
|
|
397
|
+
formState.result?.result && vibrateApp()
|
|
398
398
|
setIsLoadingVerifyModal(false);
|
|
399
399
|
}
|
|
400
400
|
}, [formState]);
|
|
@@ -402,7 +402,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
402
402
|
useEffect(() => {
|
|
403
403
|
if (Object.keys(errors).length > 0) {
|
|
404
404
|
setIsLoadingVerifyModal(false);
|
|
405
|
-
|
|
405
|
+
vibrateApp()
|
|
406
406
|
}
|
|
407
407
|
}, [errors])
|
|
408
408
|
|
|
@@ -431,7 +431,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
431
431
|
? verifyPhoneState?.result?.result
|
|
432
432
|
: verifyPhoneState?.result?.result[0];
|
|
433
433
|
verifyPhoneState.result?.result && showToast(ToastType.Error, message);
|
|
434
|
-
verifyPhoneState.result?.result &&
|
|
434
|
+
verifyPhoneState.result?.result && vibrateApp()
|
|
435
435
|
setIsLoadingVerifyModal(false);
|
|
436
436
|
return;
|
|
437
437
|
}
|
|
@@ -930,7 +930,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
930
930
|
(
|
|
931
931
|
<FacebookLogin
|
|
932
932
|
notificationState={notificationState}
|
|
933
|
-
handleErrors={(err: any) => { showToast(ToastType.Error, err),
|
|
933
|
+
handleErrors={(err: any) => { showToast(ToastType.Error, err), vibrateApp() }}
|
|
934
934
|
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
935
935
|
handleSuccessFacebookLogin={handleSuccessFacebook}
|
|
936
936
|
/>
|
|
@@ -939,7 +939,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
939
939
|
<GoogleLogin
|
|
940
940
|
notificationState={notificationState}
|
|
941
941
|
webClientId={configs?.google_login_client_id?.value}
|
|
942
|
-
handleErrors={(err: any) => { showToast(ToastType.Error, err),
|
|
942
|
+
handleErrors={(err: any) => { showToast(ToastType.Error, err), vibrateApp() }}
|
|
943
943
|
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
944
944
|
handleSuccessGoogleLogin={handleSuccessFacebook}
|
|
945
945
|
/>
|
|
@@ -947,7 +947,7 @@ const SignupFormUI = (props: SignupParams) => {
|
|
|
947
947
|
{(configs?.apple_login_client_id?.value !== '' && configs?.apple_login_client_id?.value !== null) && appleLoginEnabled && (
|
|
948
948
|
<AppleLogin
|
|
949
949
|
notificationState={notificationState}
|
|
950
|
-
handleErrors={(err: any) => { showToast(ToastType.Error, err),
|
|
950
|
+
handleErrors={(err: any) => { showToast(ToastType.Error, err), vibrateApp() }}
|
|
951
951
|
handleLoading={(val: boolean) => setIsFBLoading(val)}
|
|
952
952
|
handleSuccessAppleLogin={handleSuccessFacebook}
|
|
953
953
|
/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
SingleOrderCard as SingleOrderCardController,
|
|
4
4
|
useUtils,
|
|
@@ -11,6 +11,7 @@ import { OIcon, OText, OButton } from '../shared';
|
|
|
11
11
|
import { SingleOrderCardParams } from '../../types';
|
|
12
12
|
import { OAlert } from '../../../../../src/components/shared'
|
|
13
13
|
import { OrderEta } from '../OrderDetails/OrderEta'
|
|
14
|
+
import { useIsFocused } from '@react-navigation/native';
|
|
14
15
|
import {
|
|
15
16
|
InnerContainer,
|
|
16
17
|
Logo,
|
|
@@ -44,6 +45,7 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
44
45
|
const [, t] = useLanguage();
|
|
45
46
|
const [{ carts }] = useOrder()
|
|
46
47
|
const theme = useTheme();
|
|
48
|
+
const isFocused = useIsFocused();
|
|
47
49
|
|
|
48
50
|
const [reorderSelected, setReorderSelected] = useState<number | null>(null);
|
|
49
51
|
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
@@ -198,6 +200,10 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
|
|
|
198
200
|
const hideFavorite = theme?.orders?.components?.favorite?.hidden
|
|
199
201
|
const hideOrderStatus = theme?.orders?.components?.order_status?.hidden
|
|
200
202
|
|
|
203
|
+
useEffect(() => {
|
|
204
|
+
if (isFocused) setReorderSelected(null)
|
|
205
|
+
}, [isFocused])
|
|
206
|
+
|
|
201
207
|
return (
|
|
202
208
|
<>
|
|
203
209
|
<CardAnimation
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { View, StyleSheet, useWindowDimensions, Keyboard } from 'react-native';
|
|
2
|
+
import { View, StyleSheet, useWindowDimensions, Keyboard, Platform } from 'react-native';
|
|
3
3
|
import { useLanguage, useSession, useConfig } from 'ordering-components/native';
|
|
4
4
|
import {
|
|
5
5
|
StripeProvider,
|
|
@@ -45,6 +45,22 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
45
45
|
const { top, bottom } = useSafeAreaInsets();
|
|
46
46
|
const [isKeyboardShow, setIsKeyboardShow] = useState(false);
|
|
47
47
|
|
|
48
|
+
const styles = StyleSheet.create({
|
|
49
|
+
container: {
|
|
50
|
+
width: '100%',
|
|
51
|
+
paddingHorizontal: 40,
|
|
52
|
+
justifyContent: 'space-between',
|
|
53
|
+
paddingBottom: 12
|
|
54
|
+
},
|
|
55
|
+
btnAddStyle: {
|
|
56
|
+
marginTop: 20,
|
|
57
|
+
borderRadius: 7.6,
|
|
58
|
+
shadowOpacity: 0,
|
|
59
|
+
height: 44,
|
|
60
|
+
marginBottom: isKeyboardShow && Platform.OS === 'ios' ? 40 : 0
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
|
|
48
64
|
let billingDetails: any = {}
|
|
49
65
|
|
|
50
66
|
if (user?.name || user?.lastname) {
|
|
@@ -249,21 +265,6 @@ const StripeElementsFormUI = (props: any) => {
|
|
|
249
265
|
)
|
|
250
266
|
}
|
|
251
267
|
|
|
252
|
-
const styles = StyleSheet.create({
|
|
253
|
-
container: {
|
|
254
|
-
width: '100%',
|
|
255
|
-
paddingHorizontal: 40,
|
|
256
|
-
justifyContent: 'space-between',
|
|
257
|
-
paddingBottom: 12
|
|
258
|
-
},
|
|
259
|
-
btnAddStyle: {
|
|
260
|
-
marginTop: 20,
|
|
261
|
-
borderRadius: 7.6,
|
|
262
|
-
shadowOpacity: 0,
|
|
263
|
-
height: 44
|
|
264
|
-
},
|
|
265
|
-
})
|
|
266
|
-
|
|
267
268
|
export const StripeElementsForm = (props: any) => {
|
|
268
269
|
const stripeProps = {
|
|
269
270
|
...props,
|
|
@@ -7,11 +7,12 @@ import { SignupForm } from '../SignupForm'
|
|
|
7
7
|
|
|
8
8
|
import { UDForm, UDLoader, UDWrapper, WrapperPhone } from './styles';
|
|
9
9
|
|
|
10
|
-
import { OText, OButton, OInput, OModal } from '../shared';
|
|
11
|
-
import
|
|
10
|
+
import { OText, OButton, OInput, OModal, OIcon } from '../shared';
|
|
11
|
+
import { OAlert } from '../../../../../src/components/shared'
|
|
12
12
|
|
|
13
13
|
import { PhoneInputNumber } from '../PhoneInputNumber';
|
|
14
14
|
import { sortInputFields } from '../../utils';
|
|
15
|
+
import { ListItem } from '../UserProfile/styles';
|
|
15
16
|
|
|
16
17
|
export const UserFormDetailsUI = (props: any) => {
|
|
17
18
|
const {
|
|
@@ -31,7 +32,9 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
31
32
|
setWillVerifyOtpState,
|
|
32
33
|
handlePlaceOrderAsGuest,
|
|
33
34
|
isCheckout,
|
|
34
|
-
setIsOpen
|
|
35
|
+
setIsOpen,
|
|
36
|
+
handleRemoveAccount,
|
|
37
|
+
isProfile
|
|
35
38
|
} = props;
|
|
36
39
|
|
|
37
40
|
const theme = useTheme();
|
|
@@ -85,8 +88,9 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
85
88
|
cellphone: null,
|
|
86
89
|
},
|
|
87
90
|
});
|
|
88
|
-
const [
|
|
91
|
+
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
89
92
|
|
|
93
|
+
const isAdmin = user?.level === 0
|
|
90
94
|
const showInputPhoneNumber = (validationFields?.fields?.checkout?.cellphone?.enabled ?? false) || configs?.verification_phone_required?.value === '1'
|
|
91
95
|
|
|
92
96
|
const handleSuccessSignup = (user: any) => {
|
|
@@ -202,6 +206,18 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
202
206
|
handleChangeInput(countryCode, true);
|
|
203
207
|
}
|
|
204
208
|
|
|
209
|
+
const onRemoveAccount = () => {
|
|
210
|
+
setConfirm({
|
|
211
|
+
open: true,
|
|
212
|
+
content: [t('QUESTION_REMOVE_ACCOUNT', 'Are you sure that you want to remove your account?')],
|
|
213
|
+
title: t('ACCOUNT_ALERT', 'Account alert'),
|
|
214
|
+
handleOnAccept: () => {
|
|
215
|
+
setConfirm({ ...confirm, open: false })
|
|
216
|
+
handleRemoveAccount && handleRemoveAccount(user?.id)
|
|
217
|
+
}
|
|
218
|
+
})
|
|
219
|
+
}
|
|
220
|
+
|
|
205
221
|
useEffect(() => {
|
|
206
222
|
if (Object.keys(errors).length > 0) {
|
|
207
223
|
const list = Object.values(errors);
|
|
@@ -408,6 +424,12 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
408
424
|
)}
|
|
409
425
|
</UDWrapper>
|
|
410
426
|
)}
|
|
427
|
+
{isProfile && (
|
|
428
|
+
<ListItem disabled={isAdmin} onPress={() => onRemoveAccount()} activeOpacity={0.7}>
|
|
429
|
+
<OIcon src={theme.images.general.user} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
430
|
+
<OText size={14} lineHeight={24} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1 }} color={theme.colors.danger5}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
|
|
431
|
+
</ListItem>
|
|
432
|
+
)}
|
|
411
433
|
{validationFields?.loading && (
|
|
412
434
|
<UDLoader>
|
|
413
435
|
<OText size={12}>{t('LOADING', 'Loading')}</OText>
|
|
@@ -474,7 +496,14 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
474
496
|
/>
|
|
475
497
|
</ScrollView>
|
|
476
498
|
</OModal>
|
|
477
|
-
|
|
499
|
+
<OAlert
|
|
500
|
+
open={confirm.open}
|
|
501
|
+
title={confirm.title}
|
|
502
|
+
content={confirm.content}
|
|
503
|
+
onAccept={confirm.handleOnAccept}
|
|
504
|
+
onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
505
|
+
onClose={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
506
|
+
/>
|
|
478
507
|
</>
|
|
479
508
|
);
|
|
480
509
|
};
|
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
} from './styles';
|
|
36
36
|
import { useWindowDimensions } from 'react-native';
|
|
37
37
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
38
|
-
import styled from 'styled-components';
|
|
39
38
|
import ToggleSwitch from 'toggle-switch-react-native';
|
|
40
39
|
|
|
41
40
|
const ProfileListUI = (props: ProfileParams) => {
|
|
@@ -118,8 +117,6 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
118
117
|
const [, { showToast }] = useToast();
|
|
119
118
|
const { errors } = useForm();
|
|
120
119
|
|
|
121
|
-
const isAdmin = user?.level === 0
|
|
122
|
-
|
|
123
120
|
const { height } = useWindowDimensions();
|
|
124
121
|
const { top, bottom } = useSafeAreaInsets();
|
|
125
122
|
|
|
@@ -153,19 +150,8 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
153
150
|
|
|
154
151
|
const detailProps = {
|
|
155
152
|
goToBack: () => props.navigation?.canGoBack() && props.navigation.goBack(),
|
|
156
|
-
onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const onRemoveAccount = () => {
|
|
160
|
-
setConfirm({
|
|
161
|
-
open: true,
|
|
162
|
-
content: [t('QUESTION_REMOVE_ACCOUNT', 'Are you sure that you want to remove your account?')],
|
|
163
|
-
title: t('ACCOUNT_ALERT', 'Account alert'),
|
|
164
|
-
handleOnAccept: () => {
|
|
165
|
-
setConfirm({ ...confirm, open: false })
|
|
166
|
-
handleRemoveAccount && handleRemoveAccount(user?.id)
|
|
167
|
-
}
|
|
168
|
-
})
|
|
153
|
+
onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params),
|
|
154
|
+
handleRemoveAccount
|
|
169
155
|
}
|
|
170
156
|
|
|
171
157
|
useEffect(() => {
|
|
@@ -282,10 +268,6 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
282
268
|
<View style={{ height: 17 }} />
|
|
283
269
|
<LogoutButton color={theme.colors.textNormal} text={t('LOGOUT', 'Logout')} />
|
|
284
270
|
<View style={{ height: 17 }} />
|
|
285
|
-
<ListItem disabled={isAdmin} onPress={() => onRemoveAccount()} activeOpacity={0.7}>
|
|
286
|
-
<OIcon src={theme.images.general.user} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
287
|
-
<OText size={14} lineHeight={24} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1 }} color={theme.colors.danger5}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
|
|
288
|
-
</ListItem>
|
|
289
271
|
</Actions>
|
|
290
272
|
</ListWrap>
|
|
291
273
|
<OAlert
|
|
@@ -288,12 +288,16 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
288
288
|
showCall={false}
|
|
289
289
|
btnStyle={{ paddingLeft: 0 }}
|
|
290
290
|
/>
|
|
291
|
-
<KeyboardAvoidingView
|
|
291
|
+
<KeyboardAvoidingView
|
|
292
|
+
behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
|
|
293
|
+
enabled={Platform.OS === 'ios' ? true : false}
|
|
294
|
+
style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}
|
|
295
|
+
>
|
|
292
296
|
<CenterView>
|
|
293
297
|
<View style={styles.photo}>
|
|
294
298
|
{user?.photo ? (
|
|
295
299
|
<FastImage
|
|
296
|
-
style={{ height:
|
|
300
|
+
style={{ height: 80, width: 80, borderRadius: 8 }}
|
|
297
301
|
source={{
|
|
298
302
|
uri: user?.photo,
|
|
299
303
|
priority: FastImage.priority.normal,
|
|
@@ -316,6 +320,7 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
316
320
|
<Spinner visible={formState?.loading || verifyPhoneState?.loading} />
|
|
317
321
|
<UserFormDetailsUI
|
|
318
322
|
{...props}
|
|
323
|
+
isProfile
|
|
319
324
|
isEdit
|
|
320
325
|
setWillVerifyOtpState={setWillVerifyOtpState}
|
|
321
326
|
/>
|
|
@@ -63,12 +63,12 @@ export const WalletTransactions = (props: any) => {
|
|
|
63
63
|
(transactionsList?.error ||
|
|
64
64
|
!transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length) &&
|
|
65
65
|
(
|
|
66
|
-
<
|
|
67
|
-
|
|
66
|
+
<OText color={theme.colors.disabled} size={16} style={{ textAlign: 'center' }}>
|
|
67
|
+
{transactionsList?.error
|
|
68
68
|
? t('ERROR_NOT_FOUND_TRANSACTIONS', 'Sorry, an error has occurred')
|
|
69
69
|
: t('NOT_FOUND_TRANSACTIONS', 'No transactions to show at this time.')
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
</OText>
|
|
72
72
|
)}
|
|
73
73
|
</View>
|
|
74
74
|
</Container>
|
|
@@ -156,7 +156,7 @@ const WalletsUI = (props: any) => {
|
|
|
156
156
|
size={20}
|
|
157
157
|
style={{
|
|
158
158
|
marginTop: 30,
|
|
159
|
-
marginLeft: (!props.hideBackBtn || !hideWalletsTheme) && !isChewLayout ?
|
|
159
|
+
marginLeft: (!props.hideBackBtn || !hideWalletsTheme) && !isChewLayout ? 40 : 0,
|
|
160
160
|
color: theme.colors.textNormal,
|
|
161
161
|
}}
|
|
162
162
|
weight={Platform.OS === 'ios' ? '600' : 'bold'}
|
|
@@ -213,9 +213,9 @@ const WalletsUI = (props: any) => {
|
|
|
213
213
|
<LoyaltyContent>
|
|
214
214
|
<LoyaltyWrapp>
|
|
215
215
|
<OText size={20}>
|
|
216
|
-
{`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}
|
|
216
|
+
{`${t('LOYALTY_LEVEL_TITLE', 'Your level is')}`}
|
|
217
217
|
</OText>
|
|
218
|
-
{
|
|
218
|
+
{loyaltyLevel.image ? (
|
|
219
219
|
<FastImage
|
|
220
220
|
style={styles.logoStyle}
|
|
221
221
|
source={{
|
|
@@ -230,7 +230,7 @@ const WalletsUI = (props: any) => {
|
|
|
230
230
|
source={theme.images.dummies.loyaltyLevel}
|
|
231
231
|
resizeMode='contain'
|
|
232
232
|
/>
|
|
233
|
-
)}
|
|
233
|
+
)}
|
|
234
234
|
<OText
|
|
235
235
|
size={22}
|
|
236
236
|
weight='bold'
|
|
@@ -373,8 +373,8 @@ export interface OrdersOptionParams {
|
|
|
373
373
|
preOrders?: boolean,
|
|
374
374
|
reorderState?: any,
|
|
375
375
|
handleReorder?: (orderId: number) => {},
|
|
376
|
-
setOrdersLength?: ({ activeOrdersLength, previousOrdersLength }: { activeOrdersLength: number, previousOrdersLength: number }) => void,
|
|
377
|
-
ordersLength: { activeOrdersLength: number, previousOrdersLength: number },
|
|
376
|
+
setOrdersLength?: ({ activeOrdersLength, previousOrdersLength, preordersLength }: { activeOrdersLength: number, previousOrdersLength: number, preordersLength: number }) => void,
|
|
377
|
+
ordersLength: { activeOrdersLength: number, previousOrdersLength: number, preordersLength: number },
|
|
378
378
|
setSelectedOrderId?: any,
|
|
379
379
|
setOpenMessges?: any,
|
|
380
380
|
loadMoreStatus?: boolean,
|
|
@@ -4,6 +4,7 @@ import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
|
4
4
|
import { CODES } from 'ordering-components/native'
|
|
5
5
|
import { ORDER_TYPES } from '../config/constants';
|
|
6
6
|
import { useTheme } from 'styled-components/native';
|
|
7
|
+
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
7
8
|
|
|
8
9
|
const [languageState, t] = useLanguage();
|
|
9
10
|
const theme = useTheme()
|
|
@@ -612,3 +613,13 @@ export const lightenDarkenColor = (color: any) => {
|
|
|
612
613
|
return false
|
|
613
614
|
}
|
|
614
615
|
}
|
|
616
|
+
|
|
617
|
+
export const vibrateApp = (impact ?: string) => {
|
|
618
|
+
const options = {
|
|
619
|
+
enableVibrateFallback: true,
|
|
620
|
+
ignoreAndroidSystemSettings: false
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
|
|
624
|
+
|
|
625
|
+
}
|