ordering-ui-react-native 0.15.33 → 0.15.34-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 +4 -2
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessController/index.tsx +8 -2
- package/src/components/BusinessTypeFilter/index.tsx +4 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +23 -3
- package/src/components/DriverTips/index.tsx +11 -6
- package/src/components/LanguageSelector/index.tsx +7 -2
- package/src/components/LoginForm/index.tsx +3 -1
- package/src/components/OrderDetails/index.tsx +2 -2
- package/src/components/PaymentOptions/index.tsx +9 -16
- package/src/components/PaymentOptionsWebView/index.tsx +123 -124
- package/src/components/SignupForm/index.tsx +3 -1
- package/src/components/SingleProductCard/index.tsx +16 -4
- package/src/components/StripeElementsForm/index.tsx +27 -48
- package/src/components/UpsellingProducts/index.tsx +1 -1
- package/src/components/UserProfileForm/index.tsx +63 -6
- package/src/components/UserProfileForm/styles.tsx +8 -0
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OModal.tsx +1 -1
- package/src/config.json +0 -2
- package/src/hooks/useCountdownTimer.tsx +26 -0
- package/src/navigators/HomeNavigator.tsx +6 -0
- package/src/pages/BusinessProductsList.tsx +1 -0
- package/src/pages/BusinessesListing.tsx +1 -1
- package/src/pages/Checkout.tsx +1 -1
- package/src/pages/Sessions.tsx +22 -0
- package/src/types/index.tsx +5 -11
- package/src/utils/index.tsx +68 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +103 -15
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -0
- package/themes/business/src/components/Chat/index.tsx +38 -86
- package/themes/business/src/components/DriverMap/index.tsx +6 -5
- package/themes/business/src/components/Home/index.tsx +128 -55
- package/themes/business/src/components/Home/styles.tsx +8 -1
- package/themes/business/src/components/LoginForm/index.tsx +89 -2
- package/themes/business/src/components/LoginForm/styles.tsx +6 -0
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +79 -105
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +32 -15
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +157 -89
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
- package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
- package/themes/business/src/components/OrdersListManager/index.tsx +52 -49
- package/themes/business/src/components/OrdersOption/index.tsx +57 -50
- package/themes/business/src/components/PreviousOrders/index.tsx +50 -14
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/shared/OModal.tsx +1 -1
- package/themes/business/src/types/index.tsx +5 -1
- 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/Cart/index.tsx +99 -25
- package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
- package/themes/kiosk/src/components/Checkout/index.tsx +34 -22
- package/themes/kiosk/src/components/CustomerName/index.tsx +0 -6
- package/themes/kiosk/src/components/Intro/index.tsx +12 -12
- 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/OrderDetails/index.tsx +165 -65
- package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +10 -12
- package/themes/kiosk/src/components/PaymentOptions/index.tsx +1 -1
- package/themes/kiosk/src/components/ProductForm/index.tsx +2 -2
- package/themes/kiosk/src/components/UpsellingProducts/index.tsx +48 -34
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +184 -1
- package/themes/original/src/components/ActiveOrders/index.tsx +15 -132
- package/themes/original/src/components/ActiveOrders/styles.tsx +0 -54
- package/themes/original/src/components/AddressForm/index.tsx +15 -10
- package/themes/original/src/components/AddressList/index.tsx +56 -18
- package/themes/original/src/components/AppleLogin/index.tsx +117 -78
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +96 -45
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +28 -1
- package/themes/original/src/components/BusinessController/index.tsx +56 -16
- package/themes/original/src/components/BusinessController/styles.tsx +27 -0
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +125 -7
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +14 -1
- package/themes/original/src/components/BusinessMenuList/index.tsx +11 -4
- package/themes/original/src/components/BusinessPreorder/index.tsx +142 -122
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +9 -7
- package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +139 -36
- package/themes/original/src/components/BusinessProductsList/styles.tsx +29 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +111 -14
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +22 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +4 -25
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/themes/original/src/components/BusinessesListing/index.tsx +85 -45
- package/themes/original/src/components/Cart/index.tsx +21 -17
- package/themes/original/src/components/CartContent/index.tsx +2 -2
- package/themes/original/src/components/Checkout/index.tsx +59 -48
- package/themes/original/src/components/DriverTips/index.tsx +17 -12
- package/themes/original/src/components/Favorite/index.tsx +91 -0
- package/themes/original/src/components/Favorite/styles.tsx +22 -0
- package/themes/original/src/components/FavoriteList/index.tsx +287 -0
- package/themes/original/src/components/FavoriteList/styles.tsx +5 -0
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +84 -4
- package/themes/original/src/components/GPSButton/index.tsx +15 -8
- package/themes/original/src/components/GoogleMap/index.tsx +1 -0
- package/themes/original/src/components/Help/index.tsx +21 -4
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +18 -1
- package/themes/original/src/components/Home/index.tsx +1 -1
- package/themes/original/src/components/LastOrders/index.tsx +12 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +90 -0
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/original/src/components/LoginForm/index.tsx +394 -155
- package/themes/original/src/components/LoginForm/styles.tsx +7 -4
- package/themes/original/src/components/LogoutButton/index.tsx +7 -1
- package/themes/original/src/components/MessageListing/index.tsx +10 -1
- package/themes/original/src/components/Messages/index.tsx +6 -1
- package/themes/original/src/components/Messages/styles.tsx +1 -3
- package/themes/original/src/components/MomentOption/index.tsx +10 -1
- package/themes/original/src/components/MomentOption/styles.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +56 -33
- package/themes/original/src/components/OrderDetails/styles.tsx +1 -2
- package/themes/original/src/components/OrderProgress/index.tsx +3 -3
- package/themes/original/src/components/OrderProgress/styles.tsx +1 -0
- package/themes/original/src/components/OrderSummary/index.tsx +3 -3
- package/themes/original/src/components/OrderTypeSelector/index.tsx +4 -2
- package/themes/original/src/components/OrdersOption/index.tsx +57 -56
- package/themes/original/src/components/OrdersOption/styles.tsx +0 -6
- package/themes/original/src/components/PaymentOptionCash/index.tsx +2 -2
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +22 -24
- package/themes/original/src/components/PaymentOptionWallet/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +9 -21
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PreviousOrders/index.tsx +18 -145
- package/themes/original/src/components/ProductForm/index.tsx +76 -61
- package/themes/original/src/components/ProductForm/styles.tsx +0 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -12
- package/themes/original/src/components/Promotions/index.tsx +250 -0
- package/themes/original/src/components/Promotions/styles.tsx +60 -0
- package/themes/original/src/components/SearchBar/index.tsx +4 -1
- package/themes/original/src/components/Sessions/index.tsx +160 -0
- package/themes/original/src/components/Sessions/styles.tsx +15 -0
- package/themes/original/src/components/SignupForm/index.tsx +9 -4
- package/themes/original/src/components/SingleOrderCard/index.tsx +282 -0
- package/themes/original/src/components/SingleOrderCard/styles.tsx +54 -0
- package/themes/original/src/components/SingleProductCard/index.tsx +82 -30
- package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +55 -74
- package/themes/original/src/components/TaxInformation/index.tsx +10 -4
- package/themes/original/src/components/UpsellingProducts/index.tsx +86 -74
- package/themes/original/src/components/UserDetails/index.tsx +4 -95
- package/themes/original/src/components/UserFormDetails/index.tsx +34 -24
- package/themes/original/src/components/UserProfile/index.tsx +62 -8
- package/themes/original/src/components/UserProfileForm/index.tsx +20 -18
- package/themes/original/src/components/UserVerification/index.tsx +178 -192
- package/themes/original/src/components/VerifyPhone/index.tsx +10 -7
- package/themes/original/src/components/VerifyPhone/styles.tsx +2 -1
- package/themes/original/src/components/Wallets/index.tsx +76 -9
- package/themes/original/src/components/Wallets/styles.tsx +21 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +21 -0
- package/themes/original/src/components/shared/OModal.tsx +4 -2
- package/themes/original/src/components/shared/index.tsx +2 -0
- package/themes/original/src/config/constants.tsx +6 -6
- package/themes/original/src/types/index.tsx +107 -9
- package/themes/original/src/utils/index.tsx +28 -2
- package/themes/single-business/src/components/AddressList/index.tsx +1 -1
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +6 -6
- package/themes/single-business/src/components/UserProfile/index.tsx +1 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/StripeMethodForm/index.tsx +0 -174
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Platform, StyleSheet,
|
|
2
|
+
import { Platform, StyleSheet, TouchableOpacity } 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';
|
|
@@ -27,7 +27,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
27
27
|
hideUpdateButton,
|
|
28
28
|
setWillVerifyOtpState,
|
|
29
29
|
isVerifiedPhone,
|
|
30
|
-
handleChangePromotions
|
|
30
|
+
handleChangePromotions,
|
|
31
31
|
} = props;
|
|
32
32
|
|
|
33
33
|
const theme = useTheme();
|
|
@@ -141,8 +141,8 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
141
141
|
if (
|
|
142
142
|
formState.changes?.cellphone === null &&
|
|
143
143
|
((validationFields?.fields?.checkout?.cellphone?.enabled &&
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
validationFields?.fields?.checkout?.cellphone?.required) ||
|
|
145
|
+
configs?.verification_phone_required?.value === '1')
|
|
146
146
|
) {
|
|
147
147
|
showToast(
|
|
148
148
|
ToastType.Error,
|
|
@@ -153,9 +153,6 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
153
153
|
);
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
if (formState?.changes?.cellphone && !isVerifiedPhone) {
|
|
157
|
-
showToast(ToastType.Error, t('VERIFY_ERROR_PHONE_NUMBER', 'The Phone Number field is not verified'))
|
|
158
|
-
}
|
|
159
156
|
let changes = null;
|
|
160
157
|
if (user?.cellphone && !userPhoneNumber) {
|
|
161
158
|
changes = {
|
|
@@ -182,6 +179,16 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
182
179
|
handleChangeInput(phoneNumber, true);
|
|
183
180
|
};
|
|
184
181
|
|
|
182
|
+
const changeCountry = (country: any) => {
|
|
183
|
+
let countryCode = {
|
|
184
|
+
country_code: {
|
|
185
|
+
name: 'country_code',
|
|
186
|
+
value: country.cca2
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
handleChangeInput(countryCode, true);
|
|
190
|
+
}
|
|
191
|
+
|
|
185
192
|
useEffect(() => {
|
|
186
193
|
if (Object.keys(errors).length > 0) {
|
|
187
194
|
const list = Object.values(errors);
|
|
@@ -219,7 +226,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
219
226
|
|
|
220
227
|
useEffect(() => {
|
|
221
228
|
if (!phoneInputData.error && phoneInputData?.phone?.country_phone_code && phoneInputData?.phone?.cellphone) {
|
|
222
|
-
setWillVerifyOtpState(true)
|
|
229
|
+
setWillVerifyOtpState?.(true)
|
|
223
230
|
}
|
|
224
231
|
}, [phoneInputData])
|
|
225
232
|
|
|
@@ -315,6 +322,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
315
322
|
<PhoneInputNumber
|
|
316
323
|
data={phoneInputData}
|
|
317
324
|
handleData={(val: any) => handleChangePhoneNumber(val)}
|
|
325
|
+
changeCountry={(val: any) => changeCountry(val)}
|
|
318
326
|
defaultValue={phoneUpdate ? '' : user?.cellphone}
|
|
319
327
|
defaultCode={user?.country_phone_code || null}
|
|
320
328
|
boxStyle={styles.phoneSelect}
|
|
@@ -368,16 +376,18 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
368
376
|
rules={getInputRules({ name: 'password', code: 'password' })}
|
|
369
377
|
defaultValue=''
|
|
370
378
|
/>
|
|
371
|
-
<
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
379
|
+
<Controller
|
|
380
|
+
control={control}
|
|
381
|
+
render={({ onChange, value }: any) => (
|
|
382
|
+
<TouchableOpacity
|
|
383
|
+
style={{ flexDirection: 'row', alignItems: 'center', marginBottom: 20, width: '100%' }}
|
|
384
|
+
onPress={() => {
|
|
385
|
+
onChange(!value)
|
|
386
|
+
handleChangePromotions(!value)
|
|
387
|
+
}}
|
|
388
|
+
>
|
|
375
389
|
<CheckBox
|
|
376
390
|
value={value}
|
|
377
|
-
onValueChange={newValue => {
|
|
378
|
-
onChange(newValue)
|
|
379
|
-
handleChangePromotions(newValue)
|
|
380
|
-
}}
|
|
381
391
|
boxType={'square'}
|
|
382
392
|
tintColors={{
|
|
383
393
|
true: theme.colors.primary,
|
|
@@ -388,14 +398,14 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
388
398
|
onTintColor={theme.colors.primary}
|
|
389
399
|
style={Platform.OS === 'ios' && styles.checkBoxStyle}
|
|
390
400
|
/>
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
401
|
+
<OText style={{ fontSize: 14, paddingHorizontal: 5, paddingLeft: 10 }}>{t('RECEIVE_NEWS_EXCLUSIVE_PROMOTIONS', 'Receive newsletters and exclusive promotions')}</OText>
|
|
402
|
+
</TouchableOpacity>
|
|
403
|
+
)}
|
|
404
|
+
name='promotions'
|
|
405
|
+
defaultValue={formState?.result?.result
|
|
406
|
+
? !!formState?.result?.result?.settings?.notification?.newsletter
|
|
407
|
+
: !!(formState?.changes?.settings?.notification?.newsletter ?? (user && user?.settings?.notification?.newsletter))}
|
|
408
|
+
/>
|
|
399
409
|
</UDWrapper>
|
|
400
410
|
)}
|
|
401
411
|
{validationFields?.loading && (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
UserFormDetails as UserProfileController,
|
|
4
4
|
useSession,
|
|
@@ -16,7 +16,10 @@ import { LogoutButton } from '../LogoutButton'
|
|
|
16
16
|
import { LanguageSelector } from '../LanguageSelector'
|
|
17
17
|
import MessageCircle from 'react-native-vector-icons/AntDesign'
|
|
18
18
|
import Ionicons from 'react-native-vector-icons/Ionicons'
|
|
19
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
|
|
20
|
+
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
19
21
|
import FastImage from 'react-native-fast-image'
|
|
22
|
+
import { OAlert } from '../../../../../src/components/shared'
|
|
20
23
|
|
|
21
24
|
import {
|
|
22
25
|
OIcon,
|
|
@@ -34,7 +37,9 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
34
37
|
const ProfileListUI = (props: ProfileParams) => {
|
|
35
38
|
const {
|
|
36
39
|
navigation,
|
|
37
|
-
formState
|
|
40
|
+
formState,
|
|
41
|
+
handleRemoveAccount,
|
|
42
|
+
removeAccountState
|
|
38
43
|
} = props;
|
|
39
44
|
|
|
40
45
|
const theme = useTheme();
|
|
@@ -91,17 +96,21 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
91
96
|
});
|
|
92
97
|
|
|
93
98
|
|
|
94
|
-
const [{ user }] = useSession();
|
|
99
|
+
const [{ user }, { logout }] = useSession();
|
|
95
100
|
const [, t] = useLanguage();
|
|
96
101
|
const [{ configs }] = useConfig();
|
|
97
102
|
const [, { showToast }] = useToast();
|
|
98
103
|
const { errors } = useForm();
|
|
99
104
|
|
|
105
|
+
const isAdmin = user?.level === 0
|
|
106
|
+
|
|
100
107
|
const { height } = useWindowDimensions();
|
|
101
108
|
const { top, bottom } = useSafeAreaInsets();
|
|
102
109
|
|
|
103
|
-
const
|
|
110
|
+
const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
|
|
104
111
|
|
|
112
|
+
const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
|
|
113
|
+
const IsPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
|
|
105
114
|
const onRedirect = (route: string, params?: any) => {
|
|
106
115
|
navigation.navigate(route, params)
|
|
107
116
|
}
|
|
@@ -135,11 +144,29 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
135
144
|
onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params)
|
|
136
145
|
}
|
|
137
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
|
+
})
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
if (removeAccountState?.result === 'OK') {
|
|
161
|
+
logout()
|
|
162
|
+
}
|
|
163
|
+
}, [removeAccountState])
|
|
164
|
+
|
|
138
165
|
return (
|
|
139
|
-
<View style={{ flex: 1, height: height - top - bottom - 62 }}>
|
|
140
|
-
<OText size={24} style={{ marginTop: 15, paddingHorizontal: 40 }}>
|
|
166
|
+
<View style={{ flex: 1, height: height - top - bottom - 62, paddingTop: 20 }}>
|
|
167
|
+
{/* <OText size={24} style={{ marginTop: 15, paddingHorizontal: 40 }}>
|
|
141
168
|
{t('PROFILE', 'Profile')}
|
|
142
|
-
</OText>
|
|
169
|
+
</OText> */}
|
|
143
170
|
<CenterView style={styles.pagePadding}>
|
|
144
171
|
{user?.photo && (
|
|
145
172
|
<View style={styles.photo}>
|
|
@@ -166,7 +193,7 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
166
193
|
<Actions>
|
|
167
194
|
<ListItem onPress={() => onRedirect('AddressList', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
168
195
|
<OIcon src={theme.images.general.pin} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
169
|
-
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('
|
|
196
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SAVED_PLACES', 'My saved places')}</OText>
|
|
170
197
|
</ListItem>
|
|
171
198
|
<ListItem onPress={() => onRedirect('Messages', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
172
199
|
<MessageCircle name='message1' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
@@ -178,18 +205,45 @@ const ProfileListUI = (props: ProfileParams) => {
|
|
|
178
205
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('WALLETS', 'Wallets')}</OText>
|
|
179
206
|
</ListItem>
|
|
180
207
|
)}
|
|
208
|
+
{IsPromotionsEnabled && (
|
|
209
|
+
<ListItem onPress={() => onRedirect('Promotions', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
|
|
210
|
+
<MaterialIcons name='local-offer' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
211
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('PROMOTIONS', 'Promotions')}</OText>
|
|
212
|
+
</ListItem>
|
|
213
|
+
)}
|
|
181
214
|
<ListItem onPress={() => navigation.navigate('Help', {})} activeOpacity={0.7}>
|
|
182
215
|
<OIcon src={theme.images.general.ic_help} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
183
216
|
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('HELP', 'Help')}</OText>
|
|
184
217
|
</ListItem>
|
|
218
|
+
<ListItem onPress={() => navigation.navigate('Sessions')} activeOpacity={0.7}>
|
|
219
|
+
<Ionicons name='md-list-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
220
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('SESSIONS', 'Sessions')}</OText>
|
|
221
|
+
</ListItem>
|
|
222
|
+
<ListItem onPress={() => navigation.navigate('Favorite')} activeOpacity={0.7}>
|
|
223
|
+
<Ionicons name='heart-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />
|
|
224
|
+
<OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('FAVORITES', 'Favorites')}</OText>
|
|
225
|
+
</ListItem>
|
|
185
226
|
</Actions>
|
|
186
227
|
|
|
187
228
|
<Actions>
|
|
188
229
|
<LanguageSelector iconColor={theme.colors.textNormal} pickerStyle={langPickerStyle} />
|
|
189
230
|
<View style={{ height: 17 }} />
|
|
190
231
|
<LogoutButton color={theme.colors.textNormal} text={t('LOGOUT', 'Logout')} />
|
|
232
|
+
<View style={{ height: 17 }} />
|
|
233
|
+
<ListItem disabled={isAdmin} onPress={() => onRemoveAccount()} activeOpacity={0.7}>
|
|
234
|
+
<OIcon src={theme.images.general.user} width={16} color={theme.colors.textNormal} style={{ marginEnd: 14 }} />
|
|
235
|
+
<OText size={14} lineHeight={24} weight={'400'} style={{ opacity: isAdmin ? 0.5 : 1 }} color={theme.colors.danger5}>{t('REMOVE_ACCOUNT', 'Remove account')}</OText>
|
|
236
|
+
</ListItem>
|
|
191
237
|
</Actions>
|
|
192
238
|
</ListWrap>
|
|
239
|
+
<OAlert
|
|
240
|
+
open={confirm.open}
|
|
241
|
+
title={confirm.title}
|
|
242
|
+
content={confirm.content}
|
|
243
|
+
onAccept={confirm.handleOnAccept}
|
|
244
|
+
onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
245
|
+
onClose={() => setConfirm({ ...confirm, open: false, title: null })}
|
|
246
|
+
/>
|
|
193
247
|
</View>
|
|
194
248
|
);
|
|
195
249
|
};
|
|
@@ -56,7 +56,8 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
56
56
|
},
|
|
57
57
|
pagePadding: {
|
|
58
58
|
paddingLeft: 40,
|
|
59
|
-
paddingRight: 40
|
|
59
|
+
paddingRight: 40,
|
|
60
|
+
justifyContent: 'center',
|
|
60
61
|
},
|
|
61
62
|
navBarStyle: {
|
|
62
63
|
paddingLeft: 40,
|
|
@@ -205,8 +206,8 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
205
206
|
},
|
|
206
207
|
});
|
|
207
208
|
handleSendVerifyCode({
|
|
208
|
-
|
|
209
|
-
|
|
209
|
+
cellphone: cellphone,
|
|
210
|
+
country_phone_code: countryPhoneCode
|
|
210
211
|
})
|
|
211
212
|
}
|
|
212
213
|
}
|
|
@@ -277,15 +278,16 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
277
278
|
|
|
278
279
|
return (
|
|
279
280
|
<>
|
|
281
|
+
<NavBar
|
|
282
|
+
title={t('ACCOUNT', 'Account')}
|
|
283
|
+
titleAlign={'center'}
|
|
284
|
+
onActionLeft={() => navigation.goBack()}
|
|
285
|
+
showCall={false}
|
|
286
|
+
style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 30 , marginTop: Platform.OS === 'ios' ? 50 : 40 }}
|
|
287
|
+
/>
|
|
280
288
|
<KeyboardAvoidingView behavior={Platform.OS == 'ios' ? 'padding' : 'height'} enabled style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}>
|
|
281
289
|
<Container noPadding>
|
|
282
|
-
|
|
283
|
-
onActionLeft={() => navigation.goBack()}
|
|
284
|
-
btnStyle={{ paddingStart: 0 }}
|
|
285
|
-
title={t('ACCOUNT', 'Account')}
|
|
286
|
-
isVertical
|
|
287
|
-
style={styles.navBarStyle}
|
|
288
|
-
/>
|
|
290
|
+
|
|
289
291
|
<CenterView style={styles.pagePadding}>
|
|
290
292
|
<View style={styles.photo}>
|
|
291
293
|
{user?.photo ? (
|
|
@@ -305,7 +307,7 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
305
307
|
icon={theme.images.general.camera}
|
|
306
308
|
borderColor={theme.colors.clear}
|
|
307
309
|
iconStyle={{ width: 20, height: 20 }}
|
|
308
|
-
style={{ maxWidth: 40, position: 'absolute',
|
|
310
|
+
style={{ maxWidth: 40, position: 'absolute', alignSelf: 'center', backgroundColor: '#000', opacity: 0.5 }}
|
|
309
311
|
onClick={() => handleImagePicker()}
|
|
310
312
|
/>
|
|
311
313
|
</CenterView>
|
|
@@ -326,13 +328,13 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
326
328
|
entireModal
|
|
327
329
|
>
|
|
328
330
|
<VerifyPhone
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
331
|
+
phone={phoneInputData.phone}
|
|
332
|
+
verifyPhoneState={verifyPhoneState}
|
|
333
|
+
checkPhoneCodeState={checkPhoneCodeState}
|
|
334
|
+
handleCheckPhoneCode={handleCheckPhoneCode}
|
|
335
|
+
setCheckPhoneCodeState={setCheckPhoneCodeState}
|
|
336
|
+
handleVerifyCodeClick={handleVerifyCodeClick}
|
|
337
|
+
onClose={() => setIsModalVisible(false)}
|
|
336
338
|
/>
|
|
337
339
|
</OModal>
|
|
338
340
|
</>
|