ordering-ui-react-native 0.12.51 → 0.12.55

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.
@@ -187,7 +187,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
187
187
  };
188
188
 
189
189
  const getOrderStatus = (key: number) => {
190
- return orderStatus.find((status: any) => status.key === key)?.text;
190
+ return orderStatus.find((status: any) => status?.key === key)?.text;
191
191
  };
192
192
 
193
193
  const applyFilters = () => {
@@ -454,7 +454,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
454
454
  currentTabSelected !== 'logisticOrders' &&
455
455
  (
456
456
  <PreviousOrders
457
- orders={currentOrdersGroup.orders}
457
+ orders={currentOrdersGroup?.orders}
458
458
  onNavigationRedirect={onNavigationRedirect}
459
459
  getOrderStatus={getOrderStatus}
460
460
  handleClickOrder={handleClickOrder}
@@ -464,7 +464,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
464
464
  logisticOrders?.orders?.length > 0 &&
465
465
  currentTabSelected === 'logisticOrders' && (
466
466
  <PreviousOrders
467
- orders={logisticOrders.orders.filter((order: any) => !order?.expired).map((order: any) => ({ ...order, isLogistic: true }))}
467
+ orders={logisticOrders?.orders?.filter((order: any) => !order?.expired).map((order: any) => ({ ...order, isLogistic: true }))}
468
468
  onNavigationRedirect={onNavigationRedirect}
469
469
  getOrderStatus={getOrderStatus}
470
470
  handleClickLogisticOrder={handleClickLogisticOrder}
@@ -528,13 +528,13 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
528
528
  (currentOrdersGroup?.error?.length ||
529
529
  currentOrdersGroup?.orders?.length === 0)) ||
530
530
  (currentTabSelected === 'logisticOrders' &&
531
- (logisticOrders?.error?.length > 0 || logisticOrders?.orders?.length === 0))
531
+ (logisticOrders?.error?.length > 0 || logisticOrders?.orders?.length === 0 || !logisticOrders?.orders?.some(order => !order?.expired)))
532
532
  ) &&
533
533
  (
534
534
  <NotFoundSource
535
535
  content={
536
536
  ((currentTabSelected !== 'logisticOrders' && !currentOrdersGroup?.error?.length) ||
537
- (currentTabSelected === 'logisticOrders' && !logisticOrders?.error?.length))
537
+ (currentTabSelected === 'logisticOrders' && (!logisticOrders?.error?.length || (logisticOrders?.orders?.length > 0 && !logisticOrders?.orders?.some(order => !order?.expired)))))
538
538
  ? t('NO_RESULTS_FOUND', 'Sorry, no results found')
539
539
  : currentOrdersGroup?.error?.[0]?.message ||
540
540
  currentOrdersGroup?.error?.[0] ||
@@ -85,9 +85,9 @@ export const PreviousOrders = (props: any) => {
85
85
  <>
86
86
  {orders && orders?.length > 0 &&
87
87
  orders
88
- .filter((order: any) => hash[order?.id] ? false : (hash[order?.id] = true))
89
- .map((_order: any) => {
90
- const order = _order?.isLogistic && !_order?.order_group ? _order?.order : _order
88
+ ?.filter((order: any) => hash[order?.id] ? false : (hash[order?.id] = true))
89
+ ?.map((_order: any) => {
90
+ const order = _order?.isLogistic && !_order?.order_group && isLogisticOrder ? _order?.order : _order
91
91
  return (
92
92
  <View
93
93
  style={{
@@ -116,9 +116,9 @@ export const PreviousOrders = (props: any) => {
116
116
  </Logo>
117
117
  )}
118
118
  <Information>
119
- {order?.order_group && order?.order_group_id && (
119
+ {order?.order_group_id && (
120
120
  <OText>
121
- <OText>{order?.order_group?.orders?.length} {t('ORDERS', 'Orders')}</OText>
121
+ <OText>{(t('INVOICE_GROUP_NO', 'Group No.') + order?.order_group_id)}</OText>
122
122
  </OText>
123
123
  )}
124
124
  {order.business?.name && (
@@ -140,7 +140,7 @@ export const PreviousOrders = (props: any) => {
140
140
  numberOfLines={1}
141
141
  adjustsFontSizeToFit
142
142
  size={20}>
143
- {(order?.order_group && order?.order_group_id ? (t('INVOICE_GROUP_NO', 'Group No.') + order?.order_group_id) : (t('INVOICE_ORDER_NO', 'Order No.') + order.id)) + ' · '}
143
+ {(order?.order_group_id && order?.order_group && isLogisticOrder ? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}` : (t('INVOICE_ORDER_NO', 'Order No.') + order.id)) + ' · '}
144
144
  {order?.delivery_datetime_utc
145
145
  ? parseDate(order?.delivery_datetime_utc)
146
146
  : parseDate(order?.delivery_datetime, { utc: false })}
@@ -171,26 +171,41 @@ export const PreviousOrders = (props: any) => {
171
171
  </TouchableOpacity>
172
172
  {isLogisticOrder && (
173
173
  <AcceptOrRejectOrder>
174
- <OButton
175
- text={t('REJECT', 'Reject')}
176
- onClick={() => handleClickLogisticOrder(2, _order?.id)}
177
- bgColor={theme.colors.danger}
178
- borderColor={theme.colors.danger}
179
- imgRightSrc={null}
180
- style={{ borderRadius: 7, height: 40 }}
181
- parentStyle={{ width: '45%' }}
182
- textStyle={{ color: theme.colors.dangerText }}
183
- />
184
- <OButton
185
- text={t('ACCEPT', 'Accept')}
186
- onClick={() => handleClickLogisticOrder(1, _order?.id)}
187
- bgColor={theme.colors.successOrder}
188
- borderColor={theme.colors.successOrder}
189
- imgRightSrc={null}
190
- style={{ borderRadius: 7, height: 40 }}
191
- parentStyle={{ width: '45%' }}
192
- textStyle={{ color: theme.colors.successText }}
193
- />
174
+ {order?.order_group_id && order?.order_group ? (
175
+ <OButton
176
+ text={t('VIEW_ORDER', 'View order')}
177
+ onClick={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
178
+ bgColor={theme.colors.blueLight}
179
+ borderColor={theme.colors.blueLight}
180
+ imgRightSrc={null}
181
+ style={{ borderRadius: 7, height: 40 }}
182
+ parentStyle={{ width: '100%' }}
183
+ textStyle={{ color: theme.colors.primary }}
184
+ />
185
+ ) : (
186
+ <>
187
+ <OButton
188
+ text={t('REJECT', 'Reject')}
189
+ onClick={() => handleClickLogisticOrder(2, _order?.id)}
190
+ bgColor={theme.colors.danger}
191
+ borderColor={theme.colors.danger}
192
+ imgRightSrc={null}
193
+ style={{ borderRadius: 7, height: 40 }}
194
+ parentStyle={{ width: '45%' }}
195
+ textStyle={{ color: theme.colors.dangerText }}
196
+ />
197
+ <OButton
198
+ text={t('ACCEPT', 'Accept')}
199
+ onClick={() => handleClickLogisticOrder(1, _order?.id)}
200
+ bgColor={theme.colors.successOrder}
201
+ borderColor={theme.colors.successOrder}
202
+ imgRightSrc={null}
203
+ style={{ borderRadius: 7, height: 40 }}
204
+ parentStyle={{ width: '45%' }}
205
+ textStyle={{ color: theme.colors.successText }}
206
+ />
207
+ </>
208
+ )}
194
209
  </AcceptOrRejectOrder>
195
210
  )}
196
211
  </View>
@@ -339,7 +339,7 @@ const CartUI = (props: any) => {
339
339
  onClose={() => setOpenTaxModal({ open: false, data: null })}
340
340
  entireModal
341
341
  >
342
- <TaxInformation data={openTaxModal.data} products={cart.products} />
342
+ <TaxInformation data={openTaxModal.data} products={cart?.products} />
343
343
  </OModal>
344
344
  </Container>
345
345
  )
@@ -1,127 +1,118 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
2
  import PhoneInput from "react-native-phone-number-input";
3
- import { StyleSheet, View } from 'react-native';
3
+ import { StyleSheet } from 'react-native';
4
4
  import { useLanguage, useConfig } from 'ordering-components/native';
5
- import { useTheme } from 'styled-components/native';
5
+
6
6
  import { Wrapper } from './styles'
7
7
 
8
8
  import { PhoneInputParams } from '../../types';
9
- import { OIcon, OText } from '../shared';
10
- import { transformCountryCode } from '../../utils'
9
+ import { OText } from '../shared';
10
+ import {transformCountryCode} from '../../utils'
11
+ import {I18nManager} from 'react-native'
12
+ import { useTheme } from 'styled-components/native';
11
13
 
12
14
  export const PhoneInputNumber = (props: PhoneInputParams) => {
13
- const {
14
- data,
15
- handleData,
16
- defaultValue,
17
- defaultCode,
18
- forwardRef,
19
- textInputProps,
20
- boxStyle,
21
- inputStyle,
22
- textStyle,
23
- flagStyle,
24
- noDropIcon
25
- } = props
26
-
27
- const theme = useTheme();
28
-
15
+ const {
16
+ data,
17
+ handleData,
18
+ defaultValue,
19
+ defaultCode,
20
+ forwardRef,
21
+ textInputProps
22
+ } = props
29
23
 
30
- const style = StyleSheet.create({
31
- input: {
32
- backgroundColor: theme.colors.white,
33
- borderRadius: 7.6,
34
- borderWidth: 1,
35
- borderColor: theme.colors.border,
36
- paddingBottom: 0,
37
- paddingTop: 0,
38
- flexGrow: 1,
39
- flex: 1,
40
- height: 50,
41
- },
42
- countryBtn: {
43
- borderWidth: 1,
44
- borderColor: theme.colors.border,
45
- borderRadius: 7.6,
46
- marginEnd: 9,
47
- }
48
- })
24
+ const theme = useTheme();
49
25
 
26
+ const style = StyleSheet.create({
27
+ input: {
28
+ backgroundColor: theme.colors.white,
29
+ borderRadius: 8,
30
+ borderWidth: 1,
31
+ borderColor: theme.colors.border,
32
+ paddingVertical: 0,
33
+ flexGrow: 1,
34
+ flex: 1,
35
+ height: 50,
36
+ },
37
+ countryBtn: {
38
+ borderWidth: 1,
39
+ borderColor: theme.colors.border,
40
+ borderRadius: 8,
41
+ marginEnd: 9,
42
+ }
43
+ })
50
44
 
51
- const [, t] = useLanguage()
52
- const [{ configs }] = useConfig()
53
- const phoneInput = useRef<PhoneInput>(null);
54
- const [userphoneNumber, setUserphoneNumber] = useState('');
45
+ const [, t] = useLanguage()
46
+ const [{ configs }] = useConfig()
47
+ const phoneInput = useRef<PhoneInput>(null);
48
+ const [userphoneNumber, setUserphoneNumber] = useState('');
55
49
 
56
- const handleChangeNumber = (number: any) => {
57
- setUserphoneNumber(number)
58
- }
50
+ const handleChangeNumber = (number: any) => {
51
+ setUserphoneNumber(number)
52
+ }
59
53
 
60
- useEffect(() => {
61
- if ((defaultValue && userphoneNumber) || defaultValue === undefined || defaultValue === '') {
62
- if (userphoneNumber) {
63
- const checkValid = phoneInput.current?.isValidNumber(userphoneNumber);
64
- const callingCode = phoneInput.current?.getCallingCode();
65
- const formattedNumber = phoneInput.current?.getNumberAfterPossiblyEliminatingZero();
66
- const regex = /^[0-9]*$/
67
- const cellphone = userphoneNumber.slice(0, 0) + userphoneNumber.slice(1, userphoneNumber.length)
68
- const validNumber = regex.test(cellphone)
69
- if ((!checkValid && formattedNumber?.number) || !validNumber) {
70
- handleData && handleData({
71
- ...data,
72
- error: t('INVALID_ERROR_PHONE_NUMBER', 'The Phone Number field is invalid')
73
- })
74
- return
75
- }
76
- handleData && handleData({
77
- ...data,
78
- error: '',
79
- phone: {
80
- country_phone_code: callingCode,
81
- cellphone: formattedNumber?.number
82
- }
83
- })
84
- } else {
85
- handleData && handleData({
86
- ...data,
87
- error: '',
88
- phone: {
89
- country_phone_code: null,
90
- cellphone: null
91
- }
92
- })
93
- }
94
- }
95
- }, [userphoneNumber])
54
+ useEffect(() => {
55
+ if((defaultValue && userphoneNumber) || !defaultValue){
56
+ if (userphoneNumber === '') return;
57
+ if (userphoneNumber) {
58
+ const checkValid = phoneInput.current?.isValidNumber(userphoneNumber);
59
+ const callingCode = phoneInput.current?.getCallingCode();
60
+ const formattedNumber = phoneInput.current?.getNumberAfterPossiblyEliminatingZero();
61
+ const regex = /^[0-9]*$/
62
+ const cellphone = userphoneNumber.slice(0, 0) + userphoneNumber.slice(1, userphoneNumber.length)
63
+ const validNumber = regex.test(cellphone)
64
+ if ((!checkValid && formattedNumber?.number) || !validNumber) {
65
+ handleData && handleData({
66
+ ...data,
67
+ error: t('INVALID_ERROR_PHONE_NUMBER', 'The Phone Number field is invalid')
68
+ })
69
+ return
70
+ }
71
+ handleData && handleData({
72
+ ...data,
73
+ error: '',
74
+ phone: {
75
+ country_phone_code: callingCode,
76
+ cellphone: formattedNumber?.number
77
+ }
78
+ })
79
+ } else {
80
+ handleData && handleData({
81
+ ...data,
82
+ error: '',
83
+ phone: {
84
+ country_phone_code: null,
85
+ cellphone: null
86
+ }
87
+ })
88
+ }
89
+ }
90
+ }, [userphoneNumber])
96
91
 
97
- return (
98
- <Wrapper>
99
- <PhoneInput
100
- ref={phoneInput}
101
- defaultValue={userphoneNumber || defaultValue}
102
- defaultCode={defaultCode ? transformCountryCode(defaultCode) : configs?.default_country_code?.value}
103
- onChangeFormattedText={(text: string) => handleChangeNumber(text)}
104
- withDarkTheme
105
- countryPickerProps={{ withAlphaFilter: true }}
106
- textContainerStyle={{ ...style.input, ...inputStyle ? inputStyle : {} }}
107
- textInputStyle={textStyle}
108
- codeTextStyle={textStyle}
109
- flagButtonStyle={flagStyle}
110
- countryPickerButtonStyle={{ ...style.countryBtn, ...boxStyle ? boxStyle : {} }}
111
- placeholder={t('PHONE_NUMBER', 'Phone Number')}
112
- textInputProps={{ autoCompleteType: 'tel', ref: forwardRef, ...textInputProps }}
113
- containerStyle={{ width: '100%' }}
114
- renderDropdownImage={noDropIcon ? <View /> : <OIcon src={theme.images.general.arrow_down} width={13} color={'#B1BCCC'}></OIcon>}
115
- />
116
- {!!data?.error && (
117
- <OText
118
- size={16}
119
- color={theme.colors.error}
120
- style={{ textAlign: 'center', marginTop: 5 }}
121
- >
122
- {data.error}
123
- </OText>
124
- )}
125
- </Wrapper>
126
- )
92
+ return (
93
+ <Wrapper>
94
+ <PhoneInput
95
+ ref={phoneInput}
96
+ defaultValue={userphoneNumber || defaultValue}
97
+ defaultCode={defaultCode ? transformCountryCode(defaultCode) : configs?.default_country_code?.value}
98
+ onChangeFormattedText={(text : string) => handleChangeNumber(text)}
99
+ withDarkTheme
100
+ textInputStyle={{textAlign: I18nManager.isRTL ? 'right' : 'left'}}
101
+ countryPickerProps={{withAlphaFilter:true}}
102
+ textContainerStyle={style.input}
103
+ placeholder={t('PHONE_NUMBER', 'Phone Number')}
104
+ countryPickerButtonStyle={{ ...style.countryBtn }}
105
+ textInputProps={{autoCompleteType: 'tel', ref: forwardRef, ...textInputProps}}
106
+ />
107
+ {!!data?.error && (
108
+ <OText
109
+ size={16}
110
+ color={theme.colors.error}
111
+ style={{ textAlign: 'center', marginTop: 5 }}
112
+ >
113
+ {data.error}
114
+ </OText>
115
+ )}
116
+ </Wrapper>
117
+ )
127
118
  }
@@ -1,134 +1,130 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { TouchableOpacity, View } from 'react-native';
1
+ import React, { useEffect } from 'react';
3
2
  import MaterialIcon from 'react-native-vector-icons/MaterialCommunityIcons';
4
3
 
5
- import { UDContainer, UDHeader, UDForm, UDInfo, EditBtn } from './styles';
4
+ import { UDContainer, UDHeader, UDInfo, } from './styles';
6
5
 
7
6
  import {
8
- UserFormDetails as UserFormController,
9
- useLanguage,
10
- useSession,
7
+ UserFormDetails as UserFormController,
8
+ useLanguage,
9
+ useSession
11
10
  } from 'ordering-components/native';
12
- import { useTheme } from 'styled-components/native';
13
- import { OIcon, OText } from '../shared';
11
+
12
+ import { OText } from '../shared';
14
13
 
15
14
  import { UserFormDetailsUI } from '../UserFormDetails';
16
15
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
16
+ import { useTheme } from 'styled-components/native';
17
17
 
18
18
  const UserDetailsUI = (props: any) => {
19
- const {
20
- isEdit,
21
- formState,
22
- cleanFormState,
23
- cartStatus,
24
- toggleIsEdit,
25
- validationFields,
26
- isUserDetailsEdit,
27
- phoneUpdate,
28
- togglePhoneUpdate
29
- } = props
30
-
31
- const theme = useTheme();
19
+ const {
20
+ isEdit,
21
+ formState,
22
+ cleanFormState,
23
+ cartStatus,
24
+ toggleIsEdit,
25
+ validationFields,
26
+ isUserDetailsEdit,
27
+ phoneUpdate,
28
+ togglePhoneUpdate,
29
+ isCheckout
30
+ } = props
32
31
 
33
- const [, t] = useLanguage()
34
- const [{ user }] = useSession()
35
- const userData = props.userData || (!formState.result.error && formState.result?.result) || user
32
+ const theme = useTheme();
33
+ const [, t] = useLanguage()
34
+ const [{ user }] = useSession()
35
+ const userData = props.userData || (!formState.result.error && formState.result?.result) || user
36
36
 
37
37
 
38
- useEffect(() => {
39
- if (isUserDetailsEdit) {
40
- !isEdit && toggleIsEdit()
41
- }
42
- }, [isUserDetailsEdit])
38
+ useEffect(() => {
39
+ if (isUserDetailsEdit) {
40
+ !isEdit && toggleIsEdit()
41
+ }
42
+ }, [isUserDetailsEdit])
43
43
 
44
- const toggleEditState = () => {
45
- toggleIsEdit()
46
- cleanFormState({ changes: {} })
47
- }
44
+ const toggleEditState = () => {
45
+ toggleIsEdit()
46
+ cleanFormState({ changes: {} })
47
+ }
48
48
 
49
- useEffect(() => {
50
- if (user?.cellphone && !user?.country_phone_code) {
51
- togglePhoneUpdate(true)
52
- } else {
53
- togglePhoneUpdate(false)
54
- }
55
- }, [user?.country_phone_code])
49
+ useEffect(() => {
50
+ if (user?.cellphone && !user?.country_phone_code) {
51
+ togglePhoneUpdate(true)
52
+ } else {
53
+ togglePhoneUpdate(false)
54
+ }
55
+ }, [user?.country_phone_code])
56
56
 
57
- return (
58
- <>
59
- {(validationFields.loading || formState.loading) && (
60
- <Placeholder Animation={Fade}>
61
- <PlaceholderLine height={20} width={70} />
62
- <PlaceholderLine height={15} width={60} />
63
- <PlaceholderLine height={15} width={60} />
64
- <PlaceholderLine height={15} width={80} style={{ marginBottom: 20 }} />
65
- </Placeholder>
66
- )}
57
+ return (
58
+ <>
59
+ {(validationFields.loading || formState.loading) && (
60
+ <Placeholder Animation={Fade}>
61
+ <PlaceholderLine height={20} width={70} />
62
+ <PlaceholderLine height={15} width={60} />
63
+ <PlaceholderLine height={15} width={60} />
64
+ <PlaceholderLine height={15} width={80} style={{ marginBottom: 20 }} />
65
+ </Placeholder>
66
+ )}
67
67
 
68
- {!(validationFields.loading || formState.loading) && (
69
- <UDContainer>
70
- <UDHeader>
71
- <OText size={16} lineHeight={24} weight={'500'}>
72
- {t('CUSTOMER_DETAILS', 'Customer Details')}
73
- </OText>
74
- {cartStatus !== 2 && (
75
- !isEdit ? (
76
- <EditBtn onPress={() => toggleIsEdit()} activeOpacity={0.7}>
77
- <OIcon
78
- src={theme.images.general.pencil}
79
- width={16}
80
- height={16}
81
- color={theme.colors.editColor}
82
- style={{ marginBottom: 10, marginLeft: 5 }}
83
- />
84
- </EditBtn>
85
- ) : (
86
- <EditBtn onPress={() => toggleEditState()} activeOpacity={0.7}>
87
- <OIcon
88
- src={theme.images.general.close}
89
- color={theme.colors.cancelColor}
90
- width={16}
91
- height={16}
92
- style={{ marginBottom: 5, marginLeft: 5 }}
93
- />
94
- </EditBtn>
95
- )
96
- )}
97
- </UDHeader>
68
+ {!(validationFields.loading || formState.loading) && (
69
+ <UDContainer>
70
+ <UDHeader>
71
+ <OText size={16}>
72
+ {t('CUSTOMER_DETAILS', 'Customer Details')}
73
+ </OText>
74
+ {cartStatus !== 2 && (
75
+ !isEdit ? (
76
+ <MaterialIcon
77
+ name='pencil-outline'
78
+ size={22}
79
+ color={theme.colors.editColor}
80
+ style={{ marginBottom: 10, marginLeft: 5 }}
81
+ onPress={() => toggleIsEdit()}
82
+ />
83
+ ) : (
84
+ <MaterialIcon
85
+ name='cancel'
86
+ color={theme.colors.cancelColor}
87
+ size={20}
88
+ style={{ marginBottom: 5, marginLeft: 5 }}
89
+ onPress={() => toggleEditState()}
90
+ />
91
+ )
92
+ )}
93
+ </UDHeader>
98
94
 
99
- {!isEdit ? (
100
- <UDInfo>
101
- <OText size={12} lineHeight={18} weight={'400'}>
102
- {userData?.name} {userData?.middle_name} {userData?.lastname} {userData?.second_lastname}
103
- </OText>
104
- <OText size={12} lineHeight={18} weight={'400'}>
105
- {userData?.email}
106
- </OText>
107
- {!!(userData?.cellphone || user?.cellphone) && (
108
- <>
109
- <OText size={12} lineHeight={18} weight={'400'}>
110
- {(userData?.country_phone_code) && `+${(userData?.country_phone_code)} `}{(userData?.cellphone)}
111
- </OText>
112
- {!!phoneUpdate && (
113
- <OText color={theme.colors.error} style={{ textAlign: 'center' }}>{t('NECESSARY_UPDATE_COUNTRY_PHONE_CODE', 'It is necessary to update your phone number')}</OText>
114
- )}
115
- </>
116
- )}
117
- </UDInfo>
118
- ) : (
119
- <UserFormDetailsUI {...props} phoneUpdate={phoneUpdate} togglePhoneUpdate={togglePhoneUpdate} />
120
- )}
121
- </UDContainer>
122
- )}
123
- </>
124
- )
95
+ {!isEdit ? (
96
+ <UDInfo>
97
+ <OText size={12}>
98
+ {userData?.name} {userData?.middle_name} {userData?.lastname} {userData?.second_lastname}
99
+ </OText>
100
+ <OText size={12} numberOfLines={1}>
101
+ {userData?.email}
102
+ </OText>
103
+ {!!(userData?.cellphone || user?.cellphone) && (
104
+ <>
105
+ <OText size={12}>
106
+ {(userData?.country_phone_code) && `+${(userData?.country_phone_code)} `}{(userData?.cellphone)}
107
+ </OText>
108
+ {!!phoneUpdate && (
109
+ <OText color={theme.colors.error} style={{ textAlign: 'center', width: '100%'}}>{t('NECESSARY_UPDATE_COUNTRY_PHONE_CODE', 'It is necessary to update your phone number')}</OText>
110
+ )}
111
+ </>
112
+ )}
113
+ </UDInfo>
114
+ ) : (
115
+ <UserFormDetailsUI {...props} phoneUpdate={phoneUpdate} togglePhoneUpdate={togglePhoneUpdate} isCheckout={isCheckout} />
116
+ )}
117
+ </UDContainer>
118
+ )}
119
+ </>
120
+ )
125
121
  }
126
122
 
127
123
  export const UserDetails = (props: any) => {
128
- const userDetailsProps = {
129
- ...props,
130
- UIComponent: UserDetailsUI
131
- }
124
+ const userDetailsProps = {
125
+ ...props,
126
+ UIComponent: UserDetailsUI
127
+ }
132
128
 
133
- return <UserFormController {...userDetailsProps} />
129
+ return <UserFormController {...userDetailsProps} />
134
130
  }
@@ -1,15 +1,15 @@
1
- import styled, { css } from 'styled-components/native';
1
+ import styled from 'styled-components/native';
2
2
 
3
3
  export const UDContainer = styled.View``
4
4
 
5
5
  export const UDHeader = styled.View`
6
+ display: flex;
6
7
  flex-direction: row;
7
8
  align-items: center;
8
9
  `
9
10
 
10
11
  export const UDForm = styled.View`
11
12
  width: 100%;
12
- /* margin-top: 25px; */
13
13
  `
14
14
 
15
15
  export const UDInfo = styled.View`
@@ -17,10 +17,5 @@ export const UDInfo = styled.View`
17
17
  flex-direction: column;
18
18
  width: 100%;
19
19
  text-align: left;
20
+ align-items: flex-start;
20
21
  `
21
- export const EditBtn = styled.TouchableOpacity`
22
- align-items: center;
23
- justify-content: center;
24
- padding-top: 9px;
25
- width: 40px;
26
- `;