ordering-ui-react-native 0.17.72 → 0.17.73-release
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 +8 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +5 -0
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +28 -24
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +149 -118
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
- package/themes/business/src/components/LoginForm/index.tsx +15 -22
- package/themes/business/src/components/MapView/index.tsx +10 -10
- package/themes/business/src/components/MessagesOption/index.tsx +20 -93
- package/themes/business/src/components/NewOrderNotification/index.tsx +37 -21
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +103 -39
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -60
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +19 -18
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- package/themes/business/src/components/OrdersOption/index.tsx +17 -15
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +17 -12
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +88 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +186 -114
- package/themes/business/src/components/PreviousOrders/styles.tsx +1 -1
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
- package/themes/business/src/components/StoresList/index.tsx +3 -4
- package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
- package/themes/business/src/components/shared/OLink.tsx +11 -3
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +6 -1
- package/themes/business/src/types/index.tsx +25 -10
- package/themes/business/src/utils/index.tsx +29 -2
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +1 -1
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +61 -39
- package/themes/original/src/components/AddressList/index.tsx +25 -24
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +153 -96
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
- package/themes/original/src/components/BusinessController/index.tsx +80 -66
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +139 -85
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
- package/themes/original/src/components/BusinessListingSearch/index.tsx +349 -339
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
- package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -557
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +69 -38
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +77 -79
- package/themes/original/src/components/CartContent/index.tsx +117 -20
- package/themes/original/src/components/CartContent/styles.tsx +17 -7
- package/themes/original/src/components/Checkout/index.tsx +355 -123
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -34
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +2 -6
- package/themes/original/src/components/FavoriteList/index.tsx +1 -35
- package/themes/original/src/components/FloatingButton/index.tsx +10 -13
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +60 -5
- package/themes/original/src/components/Help/index.tsx +2 -2
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
- package/themes/original/src/components/HelpGuide/index.tsx +6 -6
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +6 -15
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +14 -7
- package/themes/original/src/components/MomentOption/index.tsx +193 -90
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCart/index.tsx +41 -54
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
- package/themes/original/src/components/MultiCheckout/index.tsx +329 -100
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +54 -21
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +40 -29
- package/themes/original/src/components/NavBar/index.tsx +20 -17
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/Notifications/index.tsx +42 -52
- package/themes/original/src/components/Notifications/styles.tsx +6 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
- package/themes/original/src/components/OrderDetails/index.tsx +191 -363
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +30 -56
- package/themes/original/src/components/OrderSummary/index.tsx +88 -59
- package/themes/original/src/components/OrderTypeSelector/index.tsx +2 -1
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +67 -85
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +98 -38
- package/themes/original/src/components/PageBanner/styles.tsx +0 -10
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +78 -35
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- package/themes/original/src/components/ProductForm/index.tsx +104 -29
- package/themes/original/src/components/ProductForm/styles.tsx +5 -5
- package/themes/original/src/components/ProductItemAccordion/index.tsx +12 -9
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +20 -18
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +5 -9
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +2 -2
- package/themes/original/src/components/Promotions/styles.tsx +3 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +63 -20
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +43 -27
- package/themes/original/src/components/SingleOrderCard/index.tsx +102 -63
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +72 -31
- package/themes/original/src/components/SingleProductCard/styles.tsx +20 -4
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +49 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +88 -79
- package/themes/original/src/components/UserProfileForm/index.tsx +17 -21
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +66 -30
- package/themes/original/src/components/Wallets/styles.tsx +3 -4
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OInput.tsx +6 -1
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/types/index.tsx +40 -11
- package/themes/original/src/utils/index.tsx +273 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Platform, StyleSheet, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { Platform, StyleSheet, TouchableOpacity, ScrollView } from 'react-native';
|
|
3
3
|
import { useSession, useLanguage, ToastType, useToast, useConfig } from 'ordering-components/native';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import { useForm, Controller } from 'react-hook-form';
|
|
6
|
+
import { SignupForm } from '../SignupForm'
|
|
6
7
|
|
|
7
8
|
import { UDForm, UDLoader, UDWrapper, WrapperPhone } from './styles';
|
|
8
9
|
|
|
9
|
-
import { OText, OButton, OInput } from '../shared';
|
|
10
|
+
import { OText, OButton, OInput, OModal, OIcon } from '../shared';
|
|
11
|
+
import { OAlert } from '../../../../../src/components/shared'
|
|
10
12
|
|
|
11
13
|
import { PhoneInputNumber } from '../PhoneInputNumber';
|
|
12
14
|
import { sortInputFields } from '../../utils';
|
|
15
|
+
import { ListItem } from '../UserProfile/styles';
|
|
13
16
|
|
|
14
17
|
export const UserFormDetailsUI = (props: any) => {
|
|
15
18
|
const {
|
|
@@ -27,6 +30,11 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
27
30
|
phoneUpdate,
|
|
28
31
|
hideUpdateButton,
|
|
29
32
|
setWillVerifyOtpState,
|
|
33
|
+
handlePlaceOrderAsGuest,
|
|
34
|
+
isCheckout,
|
|
35
|
+
setIsOpen,
|
|
36
|
+
handleRemoveAccount,
|
|
37
|
+
isProfile
|
|
30
38
|
} = props;
|
|
31
39
|
|
|
32
40
|
const theme = useTheme();
|
|
@@ -68,10 +76,11 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
68
76
|
const [, { showToast }] = useToast();
|
|
69
77
|
const { handleSubmit, control, errors, setValue } = useForm();
|
|
70
78
|
|
|
71
|
-
const [{ user }] = useSession();
|
|
79
|
+
const [{ user }, { login }] = useSession();
|
|
72
80
|
const [userPhoneNumber, setUserPhoneNumber] = useState<any>(null);
|
|
73
81
|
const [isValid, setIsValid] = useState(false)
|
|
74
82
|
const [isChanged, setIsChanged] = useState(false)
|
|
83
|
+
const [isModalOpen, setIsModalOpen] = useState(false)
|
|
75
84
|
const [phoneInputData, setPhoneInputData] = useState({
|
|
76
85
|
error: '',
|
|
77
86
|
phone: {
|
|
@@ -79,9 +88,19 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
79
88
|
cellphone: null,
|
|
80
89
|
},
|
|
81
90
|
});
|
|
91
|
+
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
82
92
|
|
|
93
|
+
const isAdmin = user?.level === 0
|
|
83
94
|
const showInputPhoneNumber = (validationFields?.fields?.checkout?.cellphone?.enabled ?? false) || configs?.verification_phone_required?.value === '1'
|
|
84
95
|
|
|
96
|
+
const handleSuccessSignup = (user: any) => {
|
|
97
|
+
login({
|
|
98
|
+
user,
|
|
99
|
+
token: user?.session?.access_token
|
|
100
|
+
})
|
|
101
|
+
handlePlaceOrderAsGuest && handlePlaceOrderAsGuest()
|
|
102
|
+
}
|
|
103
|
+
|
|
85
104
|
const getInputRules = (field: any) => {
|
|
86
105
|
const rules: any = {
|
|
87
106
|
required: isRequiredField(field.code)
|
|
@@ -187,6 +206,18 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
187
206
|
handleChangeInput(countryCode, true);
|
|
188
207
|
}
|
|
189
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
|
+
|
|
190
221
|
useEffect(() => {
|
|
191
222
|
if (Object.keys(errors).length > 0) {
|
|
192
223
|
const list = Object.values(errors);
|
|
@@ -206,6 +237,10 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
206
237
|
if (!formState?.loading && formState?.result?.error) {
|
|
207
238
|
formState.result?.result &&
|
|
208
239
|
showToast(ToastType.Error, formState.result?.result[0]);
|
|
240
|
+
if (isCheckout) {
|
|
241
|
+
setIsOpen && setIsOpen(false)
|
|
242
|
+
cleanFormState && cleanFormState({ changes: {} })
|
|
243
|
+
}
|
|
209
244
|
}
|
|
210
245
|
}, [formState?.loading]);
|
|
211
246
|
|
|
@@ -389,6 +424,12 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
389
424
|
)}
|
|
390
425
|
</UDWrapper>
|
|
391
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
|
+
)}
|
|
392
433
|
{validationFields?.loading && (
|
|
393
434
|
<UDLoader>
|
|
394
435
|
<OText size={12}>{t('LOADING', 'Loading')}</OText>
|
|
@@ -423,18 +464,46 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
423
464
|
text={
|
|
424
465
|
formState.loading
|
|
425
466
|
? t('UPDATING', 'Updating...')
|
|
426
|
-
:
|
|
467
|
+
: ((isCheckout && !!user?.guest_id)
|
|
468
|
+
? t('SIGN_UP_AND_PLACE_ORDER', 'Sign up and place order')
|
|
469
|
+
: t('CONTINUE', 'Continue'))
|
|
427
470
|
}
|
|
428
471
|
bgColor={theme.colors.white}
|
|
429
472
|
textStyle={{ color: theme.colors.primary, fontSize: 14 }}
|
|
430
473
|
borderColor={theme.colors.primary}
|
|
431
|
-
isDisabled={formState.loading || !isValid}
|
|
474
|
+
isDisabled={!user?.guest_id && (formState.loading || !isValid)}
|
|
432
475
|
imgRightSrc={null}
|
|
433
476
|
style={{ borderRadius: 7.6, shadowOpacity: 0, width: '100%', borderWidth: 1, marginTop: 20, marginBottom: 20 }}
|
|
434
|
-
onClick={handleSubmit(onSubmit)}
|
|
477
|
+
onClick={!user?.guest_id ? handleSubmit(onSubmit) : () => setIsModalOpen(true)}
|
|
435
478
|
/>
|
|
436
479
|
)}
|
|
480
|
+
{isCheckout && !!user?.guest_id && (
|
|
481
|
+
<TouchableOpacity style={{ marginTop: 10 }} onPress={() => handlePlaceOrderAsGuest()}>
|
|
482
|
+
<OText color={theme.colors.primary} style={{ textAlign: 'center' }}>{t('PLACE_ORDER_AS_GUEST', 'Place order as guest')}</OText>
|
|
483
|
+
</TouchableOpacity>
|
|
484
|
+
)}
|
|
485
|
+
<OModal
|
|
486
|
+
open={isModalOpen}
|
|
487
|
+
onClose={() => setIsModalOpen(false)}
|
|
488
|
+
>
|
|
489
|
+
<ScrollView style={{ paddingHorizontal: 20, width: '100%' }}>
|
|
490
|
+
<SignupForm
|
|
491
|
+
handleSuccessSignup={handleSuccessSignup}
|
|
492
|
+
isGuest
|
|
493
|
+
signupButtonText={t('SIGNUP', 'Signup')}
|
|
494
|
+
useSignupByEmail
|
|
495
|
+
useChekoutFileds
|
|
496
|
+
/>
|
|
497
|
+
</ScrollView>
|
|
498
|
+
</OModal>
|
|
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
|
+
/>
|
|
437
507
|
</>
|
|
438
508
|
);
|
|
439
509
|
};
|
|
440
|
-
|
|
@@ -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) => {
|
|
@@ -49,6 +48,19 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
49
48
|
|
|
50
49
|
const theme = useTheme();
|
|
51
50
|
|
|
51
|
+
const isChewLayout = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
52
|
+
const hideProfileImage = theme?.profile?.components?.picture?.hidden
|
|
53
|
+
const hideOrders = theme?.profile?.components?.orders?.hidden
|
|
54
|
+
const hideProfile = theme?.profile?.components?.profile?.hidden
|
|
55
|
+
const hideWallet = theme?.profile?.components?.wallet?.hidden
|
|
56
|
+
const hideMessages = theme?.bar_menu?.components?.messages?.hidden
|
|
57
|
+
const hideHelp = theme?.bar_menu?.components?.help?.hidden
|
|
58
|
+
const hideFavorites = theme?.bar_menu?.components?.favortes?.hidden
|
|
59
|
+
const hideSession = theme?.bar_menu?.components?.sessions?.hidden
|
|
60
|
+
const hidePromotions = theme?.bar_menu?.components?.promotions?.hidden
|
|
61
|
+
const hideAddressList = theme?.profile?.components?.address_list?.hidden
|
|
62
|
+
const showLanguages = theme?.profile?.components?.languages?.hidden
|
|
63
|
+
const showNotifications = !theme?.profile?.components?.notification_settings?.hidden
|
|
52
64
|
const langPickerStyle = StyleSheet.create({
|
|
53
65
|
inputAndroid: {
|
|
54
66
|
color: theme.colors.textNormal,
|
|
@@ -89,8 +101,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
89
101
|
marginEnd: 14
|
|
90
102
|
},
|
|
91
103
|
pagePadding: {
|
|
92
|
-
|
|
93
|
-
paddingRight: 40
|
|
104
|
+
paddingHorizontal: isChewLayout ? 20 : 40
|
|
94
105
|
},
|
|
95
106
|
messageIconStyle: {
|
|
96
107
|
fontSize: 18,
|
|
@@ -106,8 +117,6 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
106
117
|
const [, { showToast }] = useToast();
|
|
107
118
|
const { errors } = useForm();
|
|
108
119
|
|
|
109
|
-
const isAdmin = user?.level === 0
|
|
110
|
-
|
|
111
120
|
const { height } = useWindowDimensions();
|
|
112
121
|
const { top, bottom } = useSafeAreaInsets();
|
|
113
122
|
|
|
@@ -141,19 +150,8 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
141
150
|
|
|
142
151
|
const detailProps = {
|
|
143
152
|
goToBack: () => props.navigation?.canGoBack() && props.navigation.goBack(),
|
|
144
|
-
onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params)
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const onRemoveAccount = () => {
|
|
148
|
-
setConfirm({
|
|
149
|
-
open: true,
|
|
150
|
-
content: [t('QUESTION_REMOVE_ACCOUNT', 'Are you sure that you want to remove your account?')],
|
|
151
|
-
title: t('ACCOUNT_ALERT', 'Account alert'),
|
|
152
|
-
handleOnAccept: () => {
|
|
153
|
-
setConfirm({ ...confirm, open: false })
|
|
154
|
-
handleRemoveAccount && handleRemoveAccount(user?.id)
|
|
155
|
-
}
|
|
156
|
-
})
|
|
153
|
+
onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params),
|
|
154
|
+
handleRemoveAccount
|
|
157
155
|
}
|
|
158
156
|
|
|
159
157
|
useEffect(() => {
|
|
@@ -163,12 +161,9 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
163
161
|
}, [removeAccountState])
|
|
164
162
|
|
|
165
163
|
return (
|
|
166
|
-
<View style={{ flex: 1, height:
|
|
167
|
-
{/* <OText size={24} style={{ marginTop: 15, paddingHorizontal: 40 }}>
|
|
168
|
-
{t('PROFILE', 'Profile')}
|
|
169
|
-
</OText> */}
|
|
164
|
+
<View style={{ flex: 1, height: '100%', paddingTop: 20 }}>
|
|
170
165
|
<CenterView style={styles.pagePadding}>
|
|
171
|
-
{user?.photo && (
|
|
166
|
+
{user?.photo && !hideProfileImage && (
|
|
172
167
|
<View style={styles.photo}>
|
|
173
168
|
<FastImage
|
|
174
169
|
style={{ height: 60, width: 60, borderRadius: 8 }}
|
|
@@ -182,83 +177,97 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
182
177
|
)}
|
|
183
178
|
<View style={{ flexBasis: '70%' }}>
|
|
184
179
|
<OText size={20} lineHeight={30} weight={Platform.OS === 'ios' ? '500' : 'bold'} color={theme.colors.textNormal}>{user?.name} {user?.lastname}</OText>
|
|
185
|
-
|
|
186
|
-
<
|
|
187
|
-
|
|
180
|
+
{!hideProfile && (
|
|
181
|
+
<TouchableOpacity onPress={() => navigation.navigate('ProfileForm', { ...detailProps })}>
|
|
182
|
+
<OText size={12} lineHeight={18} color={theme.colors.primary} style={{ textDecorationLine: 'underline' }}>{t('VIEW_ACCOUNT', 'View account')}</OText>
|
|
183
|
+
</TouchableOpacity>
|
|
184
|
+
)}
|
|
188
185
|
</View>
|
|
189
186
|
</CenterView>
|
|
190
187
|
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32 }} />
|
|
191
188
|
<Spinner visible={notificationsGroup?.loading} />
|
|
192
189
|
<ListWrap style={{ ...styles.pagePadding }}>
|
|
193
190
|
<Actions>
|
|
194
|
-
|
|
195
|
-
<
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
{
|
|
191
|
+
{!hideAddressList && (
|
|
192
|
+
<ListItem onPress={() => onRedirect('AddressList', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
193
|
+
<OIcon src={theme.images.general.pin} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
194
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SAVED_PLACES', 'My saved places')}</OText>
|
|
195
|
+
</ListItem>
|
|
196
|
+
)}
|
|
197
|
+
{!hideMessages && (
|
|
198
|
+
<ListItem onPress={() => onRedirect('Messages', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
199
|
+
<MessageCircle name='message1' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
200
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MESSAGES', 'Messages')}</OText>
|
|
201
|
+
</ListItem>
|
|
202
|
+
)}
|
|
203
|
+
{!hideOrders && (
|
|
204
|
+
<ListItem onPress={() => onRedirect('MyOrders', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
205
|
+
<FontAwesome name='list-alt' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
206
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MY_ORDERS', 'My Orders')}</OText>
|
|
207
|
+
</ListItem>
|
|
208
|
+
)}
|
|
209
|
+
{isWalletEnabled && !hideWallet && (
|
|
207
210
|
<ListItem onPress={() => onRedirect('Wallets', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
208
211
|
<Ionicons name='wallet-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
209
212
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('WALLETS', 'Wallets')}</OText>
|
|
210
213
|
</ListItem>
|
|
211
214
|
)}
|
|
212
|
-
{IsPromotionsEnabled && (
|
|
215
|
+
{IsPromotionsEnabled && !hidePromotions && (
|
|
213
216
|
<ListItem onPress={() => onRedirect('Promotions', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
214
217
|
<MaterialIcons name='local-offer' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
215
218
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('PROMOTIONS', 'Promotions')}</OText>
|
|
216
219
|
</ListItem>
|
|
217
220
|
)}
|
|
218
|
-
|
|
219
|
-
<
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
<
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
<
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
<
|
|
249
|
-
|
|
250
|
-
|
|
221
|
+
{!hideHelp && (
|
|
222
|
+
<ListItem onPress={() => navigation.navigate('Help', {})} activeOpacity={0.7}>
|
|
223
|
+
<OIcon src={theme.images.general.ic_help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
224
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
|
|
225
|
+
</ListItem>
|
|
226
|
+
)}
|
|
227
|
+
{showNotifications && (
|
|
228
|
+
<ListItem onPress={() => navigation.navigate('Notifications', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
229
|
+
<NotificationBadge style={{ borderRadius: 100 / 2 }} />
|
|
230
|
+
<Ionicons name='notifications-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
231
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MARKETING_NOTIFICATIONS', 'Marketing notifications')}
|
|
232
|
+
</OText>
|
|
233
|
+
<NotificationsWrapper>
|
|
234
|
+
<ToggleSwitch
|
|
235
|
+
isOn={user && (!!user?.settings?.notification?.newsletter ||
|
|
236
|
+
!!user?.settings?.sms?.newsletter ||
|
|
237
|
+
!!user?.settings?.email?.newsletter)}
|
|
238
|
+
onColor={theme.colors.primary}
|
|
239
|
+
size="small"
|
|
240
|
+
disabled={notificationsGroup?.loading}
|
|
241
|
+
offColor={theme.colors.disabled}
|
|
242
|
+
animationSpeed={400}
|
|
243
|
+
onToggle={() => handleChangePromotions(!(user && (!!user?.settings?.notification?.newsletter ||
|
|
244
|
+
!!user?.settings?.sms?.newsletter ||
|
|
245
|
+
!!user?.settings?.email?.newsletter)))}
|
|
246
|
+
/>
|
|
247
|
+
</NotificationsWrapper>
|
|
248
|
+
</ListItem>
|
|
249
|
+
)}
|
|
250
|
+
{!hideSession && (
|
|
251
|
+
<ListItem onPress={() => navigation.navigate('Sessions')} activeOpacity={0.7}>
|
|
252
|
+
<Ionicons name='md-list-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
253
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SESSIONS', 'Sessions')}</OText>
|
|
254
|
+
</ListItem>
|
|
255
|
+
)}
|
|
256
|
+
{!hideFavorites && (
|
|
257
|
+
<ListItem onPress={() => navigation.navigate('Favorite')} activeOpacity={0.7}>
|
|
258
|
+
<Ionicons name='heart-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
259
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('FAVORITES', 'Favorites')}</OText>
|
|
260
|
+
</ListItem>
|
|
261
|
+
)}
|
|
251
262
|
</Actions>
|
|
252
263
|
|
|
253
|
-
<Actions>
|
|
254
|
-
|
|
264
|
+
<Actions style={{ paddingTop: height * .02 }}>
|
|
265
|
+
{!showLanguages && (
|
|
266
|
+
<LanguageSelector iconColor={theme.colors.textNormal} pickerStyle={langPickerStyle} />
|
|
267
|
+
)}
|
|
255
268
|
<View style={{ height: 17 }} />
|
|
256
269
|
<LogoutButton color={theme.colors.textNormal} text={t('LOGOUT', 'Logout')} />
|
|
257
270
|
<View style={{ height: 17 }} />
|
|
258
|
-
<ListItem disabled={isAdmin} onPress={() => onRemoveAccount()} activeOpacity={0.7}>
|
|
259
|
-
<OIcon src={theme.images.general.user} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
260
|
-
<OText size={14} lineHeight={24} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1 }} color={theme.colors.danger5}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
|
|
261
|
-
</ListItem>
|
|
262
271
|
</Actions>
|
|
263
272
|
</ListWrap>
|
|
264
273
|
<OAlert
|
|
@@ -16,9 +16,8 @@ import { ProfileParams } from '../../types';
|
|
|
16
16
|
import { UserFormDetailsUI } from '../UserFormDetails';
|
|
17
17
|
|
|
18
18
|
import { OIcon, OIconButton, OModal } from '../shared';
|
|
19
|
-
import { CenterView } from './styles';
|
|
19
|
+
import { CenterView, Container } from './styles';
|
|
20
20
|
import NavBar from '../NavBar';
|
|
21
|
-
import { Container } from '../../layouts/Container';
|
|
22
21
|
import { VerifyPhone } from '../VerifyPhone'
|
|
23
22
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
24
23
|
import FastImage from 'react-native-fast-image'
|
|
@@ -51,11 +50,6 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
51
50
|
shadowOpacity: 0.2,
|
|
52
51
|
backgroundColor: theme.colors.white,
|
|
53
52
|
},
|
|
54
|
-
pagePadding: {
|
|
55
|
-
paddingLeft: 40,
|
|
56
|
-
paddingRight: 40,
|
|
57
|
-
justifyContent: 'center',
|
|
58
|
-
},
|
|
59
53
|
navBarStyle: {
|
|
60
54
|
paddingLeft: 40,
|
|
61
55
|
paddingRight: 40,
|
|
@@ -285,22 +279,25 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
285
279
|
return (
|
|
286
280
|
<>
|
|
287
281
|
<Container
|
|
288
|
-
|
|
289
|
-
noPadding
|
|
282
|
+
pdng={Platform.OS === 'ios' ? '20px' : '10px'}
|
|
290
283
|
>
|
|
291
284
|
<NavBar
|
|
292
285
|
title={t('ACCOUNT', 'Account')}
|
|
293
286
|
titleAlign={'center'}
|
|
294
287
|
onActionLeft={() => navigation.goBack()}
|
|
295
288
|
showCall={false}
|
|
296
|
-
|
|
289
|
+
btnStyle={{ paddingLeft: 0 }}
|
|
297
290
|
/>
|
|
298
|
-
<KeyboardAvoidingView
|
|
299
|
-
|
|
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
|
+
>
|
|
296
|
+
<CenterView>
|
|
300
297
|
<View style={styles.photo}>
|
|
301
298
|
{user?.photo ? (
|
|
302
299
|
<FastImage
|
|
303
|
-
style={{ height:
|
|
300
|
+
style={{ height: 80, width: 80, borderRadius: 8 }}
|
|
304
301
|
source={{
|
|
305
302
|
uri: user?.photo,
|
|
306
303
|
priority: FastImage.priority.normal,
|
|
@@ -319,15 +316,14 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
319
316
|
onClick={() => handleImagePicker()}
|
|
320
317
|
/>
|
|
321
318
|
</CenterView>
|
|
322
|
-
<View style={{ height: 8,
|
|
319
|
+
<View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100, marginVertical: 32, zIndex: 10 }} />
|
|
323
320
|
<Spinner visible={formState?.loading || verifyPhoneState?.loading} />
|
|
324
|
-
<
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
</View>
|
|
321
|
+
<UserFormDetailsUI
|
|
322
|
+
{...props}
|
|
323
|
+
isProfile
|
|
324
|
+
isEdit
|
|
325
|
+
setWillVerifyOtpState={setWillVerifyOtpState}
|
|
326
|
+
/>
|
|
331
327
|
</KeyboardAvoidingView>
|
|
332
328
|
</Container>
|
|
333
329
|
<OModal
|
|
@@ -9,6 +9,13 @@ export const UserData = styled.View`
|
|
|
9
9
|
text-align: center;
|
|
10
10
|
`
|
|
11
11
|
|
|
12
|
+
export const Container = styled.ScrollView`
|
|
13
|
+
position: relative;
|
|
14
|
+
flex: 1;
|
|
15
|
+
padding-top: ${(props: any) => props.pdng};
|
|
16
|
+
margin-bottom: 40px;
|
|
17
|
+
`
|
|
18
|
+
|
|
12
19
|
export const Names = styled.View`
|
|
13
20
|
flex-direction: row;
|
|
14
21
|
`
|
|
@@ -195,38 +195,39 @@ const UserVerificationUI = (props: any) => {
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
useEffect(() => {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
198
|
+
if (verificationState.phone) {
|
|
199
|
+
let _timer = TIME_COUNTDOWN - 1;
|
|
200
|
+
let minutes = 0;
|
|
201
|
+
let seconds = 0;
|
|
202
|
+
const interval = setInterval(() => {
|
|
203
|
+
minutes = _timer / 60;
|
|
204
|
+
seconds = _timer % 60;
|
|
205
|
+
|
|
206
|
+
minutes = minutes < 10 ? 0 + minutes : minutes;
|
|
207
|
+
seconds = seconds < 10 ? 0 + seconds : seconds;
|
|
208
|
+
|
|
209
|
+
const formatMinutes = parseInt(minutes.toString()) < 10
|
|
210
|
+
? `0${parseInt(minutes.toString())}`
|
|
211
|
+
: parseInt(minutes.toString());
|
|
212
|
+
|
|
213
|
+
const formatseconds = parseInt(seconds.toString()) < 10
|
|
214
|
+
? `0${parseInt(seconds.toString())}`
|
|
215
|
+
: parseInt(seconds.toString());
|
|
216
|
+
|
|
217
|
+
setTimer(`${formatMinutes}:${formatseconds}`);
|
|
218
|
+
|
|
219
|
+
if (--_timer < 0) {
|
|
220
|
+
clearInterval(interval);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (timer === `${TIME_COUNTDOWN / 60}:00` && isSendCodeAgain) {
|
|
224
|
+
setIsSendCodeAgain(false)
|
|
225
|
+
clearInterval(interval);
|
|
226
|
+
}
|
|
227
|
+
}, 1000);
|
|
228
|
+
return () => clearInterval(interval)
|
|
229
|
+
}
|
|
230
|
+
}, [isSendCodeAgain, verificationState.phone])
|
|
230
231
|
|
|
231
232
|
useEffect(() => {
|
|
232
233
|
if (otpState?.length === CODE_LENGTH) {
|
|
@@ -292,7 +293,7 @@ const UserVerificationUI = (props: any) => {
|
|
|
292
293
|
|
|
293
294
|
useEffect(() => {
|
|
294
295
|
setupUserPhoneNumber()
|
|
295
|
-
}, [user])
|
|
296
|
+
}, [user?.cellphone, user?.country_phone_code])
|
|
296
297
|
|
|
297
298
|
return (
|
|
298
299
|
<SafeAreaView style={{ flex: 1 }}>
|
|
@@ -401,6 +402,7 @@ const UserVerificationUI = (props: any) => {
|
|
|
401
402
|
textStyle={{ color: theme.colors.textNormal, fontSize: 12, padding: 0 }}
|
|
402
403
|
noDropIcon
|
|
403
404
|
isDisabled
|
|
405
|
+
updateStateWithSubmit
|
|
404
406
|
/>
|
|
405
407
|
</InputWrapper>
|
|
406
408
|
</>
|
|
@@ -460,28 +462,31 @@ const UserVerificationUI = (props: any) => {
|
|
|
460
462
|
)}
|
|
461
463
|
|
|
462
464
|
</Container>
|
|
463
|
-
|
|
464
|
-
<
|
|
465
|
-
<
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
465
|
+
{!!phoneState?.cellphone && (
|
|
466
|
+
<ButtonsActions>
|
|
467
|
+
<View style={{ width: '100%' }}>
|
|
468
|
+
<OButton
|
|
469
|
+
onClick={(verificationState.email || verificationState.phone)
|
|
470
|
+
? () => setVerificationState({ email: false, phone: false })
|
|
471
|
+
: () => handleSendOtp(isPhoneVerifyRequired && !isEmailVerifyRequired ? 'phone' : '')
|
|
472
|
+
}
|
|
473
|
+
text={(verificationState.email || verificationState.phone) ? t('CANCEL', 'Cancel') : t('SEND_CODE', 'Send code')}
|
|
474
|
+
bgColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
|
|
475
|
+
borderColor={(verificationState.email || verificationState.phone) ? theme.colors.secundary : theme.colors.primary}
|
|
476
|
+
textStyle={{ color: (verificationState.email || verificationState.phone) ? 'black' : 'white' }}
|
|
477
|
+
imgRightSrc={null}
|
|
478
|
+
isLoading={verifyEmailState?.loadingSendCode || verifyEmailState?.loadingCheckCode || verifyPhoneState?.loadingSendCode || verifyPhoneState?.loadingCheckCode}
|
|
479
|
+
style={(verificationState.email || verificationState.phone) ? style.btnStyle : { borderRadius: 7.6 }}
|
|
480
|
+
/>
|
|
481
|
+
</View>
|
|
482
|
+
</ButtonsActions>
|
|
483
|
+
)}
|
|
480
484
|
<View style={{ paddingHorizontal: 20, paddingBottom: 80 }}>
|
|
481
485
|
<UserDetails
|
|
482
486
|
user={user}
|
|
483
487
|
isEdit
|
|
484
488
|
isVerifiedPhone
|
|
489
|
+
dontToggleEditMode
|
|
485
490
|
/>
|
|
486
491
|
</View>
|
|
487
492
|
</ScrollView>
|