ordering-ui-react-native 0.12.52 → 0.12.56
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/src/components/Cart/index.tsx +50 -16
- package/src/components/OrderDetails/index.tsx +8 -0
- package/src/components/OrderSummary/index.tsx +38 -3
- package/src/layouts/Container.tsx +1 -1
- package/themes/business/src/components/GoogleMap/index.tsx +78 -4
- package/themes/business/src/components/OrderDetails/Business.tsx +11 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +11 -9
- package/themes/business/src/layouts/Container.tsx +3 -1
- package/themes/doordash/src/components/Cart/index.tsx +36 -2
- package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
- package/themes/doordash/src/components/OrderSummary/index.tsx +36 -3
- package/themes/doordash/src/layouts/Container.tsx +1 -1
- package/themes/franchises/src/components/Cart/index.tsx +257 -223
- package/themes/franchises/src/components/OrderDetails/index.tsx +723 -715
- package/themes/franchises/src/components/OrderSummary/index.tsx +188 -154
- package/themes/franchises/src/layouts/Container.tsx +1 -1
- package/themes/instacart/src/components/Cart/index.tsx +37 -3
- package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
- package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
- package/themes/instacart/src/layouts/Container.tsx +1 -1
- package/themes/kiosk/src/layouts/Container.tsx +2 -1
- package/themes/original/src/components/Cart/index.tsx +268 -234
- package/themes/original/src/components/OrderDetails/index.tsx +723 -715
- package/themes/original/src/components/OrderSummary/index.tsx +37 -3
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/single-business/src/components/Cart/index.tsx +1 -1
- package/themes/single-business/src/components/PhoneInputNumber/index.tsx +103 -112
- package/themes/single-business/src/components/UserDetails/index.tsx +107 -111
- package/themes/single-business/src/components/UserDetails/styles.tsx +3 -8
- package/themes/single-business/src/components/UserFormDetails/index.tsx +279 -326
- package/themes/single-business/src/components/UserFormDetails/styles.tsx +7 -5
- package/themes/single-business/src/layouts/Container.tsx +1 -1
- package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
- package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
- package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
- package/themes/uber-eats/src/layouts/Container.tsx +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { View } from 'react-native'
|
|
2
|
+
import { ActivityIndicator, View } from 'react-native'
|
|
3
3
|
import {
|
|
4
4
|
Cart,
|
|
5
5
|
useOrder,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
|
|
20
20
|
import { ProductItemAccordion } from '../ProductItemAccordion';
|
|
21
21
|
import { CouponControl } from '../CouponControl';
|
|
22
|
-
import { OModal, OText } from '../shared';
|
|
22
|
+
import { OInput, OModal, OText } from '../shared';
|
|
23
23
|
import { ProductForm } from '../ProductForm';
|
|
24
24
|
import { verifyDecimals } from '../../utils';
|
|
25
25
|
import AntIcon from 'react-native-vector-icons/AntDesign'
|
|
@@ -34,7 +34,9 @@ const OrderSummaryUI = (props: any) => {
|
|
|
34
34
|
offsetDisabled,
|
|
35
35
|
removeProduct,
|
|
36
36
|
isCartPending,
|
|
37
|
-
isFromCheckout
|
|
37
|
+
isFromCheckout,
|
|
38
|
+
commentState,
|
|
39
|
+
handleChangeComment
|
|
38
40
|
} = props;
|
|
39
41
|
|
|
40
42
|
const theme = useTheme()
|
|
@@ -188,6 +190,38 @@ const OrderSummaryUI = (props: any) => {
|
|
|
188
190
|
</OSTable>
|
|
189
191
|
</View>
|
|
190
192
|
)}
|
|
193
|
+
{cart?.status !== 2 && (
|
|
194
|
+
<OSTable>
|
|
195
|
+
<View style={{ width: '100%', marginTop: 20 }}>
|
|
196
|
+
<OText size={12}>{t('COMMENTS', 'Comments')}</OText>
|
|
197
|
+
<View style={{ flex: 1, width: '100%' }}>
|
|
198
|
+
<OInput
|
|
199
|
+
value={cart?.comment}
|
|
200
|
+
placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
|
|
201
|
+
onChange={(value: string) => handleChangeComment(value)}
|
|
202
|
+
style={{
|
|
203
|
+
alignItems: 'flex-start',
|
|
204
|
+
width: '100%',
|
|
205
|
+
height: 100,
|
|
206
|
+
borderColor: theme.colors.textSecondary,
|
|
207
|
+
paddingRight: 50,
|
|
208
|
+
marginTop: 10
|
|
209
|
+
}}
|
|
210
|
+
multiline
|
|
211
|
+
/>
|
|
212
|
+
{commentState?.loading && (
|
|
213
|
+
<View style={{ position: 'absolute', right: 20 }}>
|
|
214
|
+
<ActivityIndicator
|
|
215
|
+
size='large'
|
|
216
|
+
style={{ height: 100 }}
|
|
217
|
+
color={theme.colors.primary}
|
|
218
|
+
/>
|
|
219
|
+
</View>
|
|
220
|
+
)}
|
|
221
|
+
</View>
|
|
222
|
+
</View>
|
|
223
|
+
</OSTable>
|
|
224
|
+
)}
|
|
191
225
|
</OSBill>
|
|
192
226
|
)}
|
|
193
227
|
<OModal
|
|
@@ -18,7 +18,7 @@ const SafeAreaStyled = styled.SafeAreaView`
|
|
|
18
18
|
export const Container = (props: any) => {
|
|
19
19
|
return (
|
|
20
20
|
<SafeAreaStyled>
|
|
21
|
-
<ContainerStyled keyboardShouldPersistTaps='handled'
|
|
21
|
+
<ContainerStyled {...props} ref={props?.forwardRef} keyboardShouldPersistTaps='handled' style={{...props.style}}>
|
|
22
22
|
{props.children}
|
|
23
23
|
</ContainerStyled>
|
|
24
24
|
</SafeAreaStyled>
|
|
@@ -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
|
|
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
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
4
|
import { useLanguage, useConfig } from 'ordering-components/native';
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
import { Wrapper } from './styles'
|
|
7
7
|
|
|
8
8
|
import { PhoneInputParams } from '../../types';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
const [, t] = useLanguage()
|
|
46
|
+
const [{ configs }] = useConfig()
|
|
47
|
+
const phoneInput = useRef<PhoneInput>(null);
|
|
48
|
+
const [userphoneNumber, setUserphoneNumber] = useState('');
|
|
55
49
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
const handleChangeNumber = (number: any) => {
|
|
51
|
+
setUserphoneNumber(number)
|
|
52
|
+
}
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
|
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,
|
|
4
|
+
import { UDContainer, UDHeader, UDInfo, } from './styles';
|
|
6
5
|
|
|
7
6
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
UserFormDetails as UserFormController,
|
|
8
|
+
useLanguage,
|
|
9
|
+
useSession
|
|
11
10
|
} from 'ordering-components/native';
|
|
12
|
-
|
|
13
|
-
import {
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (isUserDetailsEdit) {
|
|
40
|
+
!isEdit && toggleIsEdit()
|
|
41
|
+
}
|
|
42
|
+
}, [isUserDetailsEdit])
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const toggleEditState = () => {
|
|
45
|
+
toggleIsEdit()
|
|
46
|
+
cleanFormState({ changes: {} })
|
|
47
|
+
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
const userDetailsProps = {
|
|
125
|
+
...props,
|
|
126
|
+
UIComponent: UserDetailsUI
|
|
127
|
+
}
|
|
132
128
|
|
|
133
|
-
|
|
129
|
+
return <UserFormController {...userDetailsProps} />
|
|
134
130
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import styled
|
|
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
|
-
`;
|