ordering-ui-react-native 0.21.18 → 0.21.19
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
CHANGED
|
@@ -24,7 +24,8 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
|
|
|
24
24
|
noDropIcon,
|
|
25
25
|
isDisabled,
|
|
26
26
|
isStartValidation,
|
|
27
|
-
changeCountry
|
|
27
|
+
changeCountry,
|
|
28
|
+
updateStateWithSubmit
|
|
28
29
|
} = props
|
|
29
30
|
|
|
30
31
|
const theme = useTheme();
|
|
@@ -95,6 +96,19 @@ export const PhoneInputNumber = (props: PhoneInputParams) => {
|
|
|
95
96
|
}
|
|
96
97
|
}, [userphoneNumber])
|
|
97
98
|
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (defaultValue && updateStateWithSubmit) {
|
|
101
|
+
phoneInput.current?.setState({
|
|
102
|
+
number: defaultValue,
|
|
103
|
+
countryCode: defaultCode ?
|
|
104
|
+
!isNaN(defaultCode)
|
|
105
|
+
? transformCountryCode(defaultCode)
|
|
106
|
+
: findExitingCode(defaultCode)
|
|
107
|
+
: findExitingCode(configs?.default_country_code?.value?.toUpperCase())
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
}, [defaultValue])
|
|
111
|
+
|
|
98
112
|
return (
|
|
99
113
|
<Wrapper onPress={() => forwardRef?.current?.focus?.()}>
|
|
100
114
|
{(isStartValidation && userphoneNumber === '') && (
|
|
@@ -293,7 +293,7 @@ const UserVerificationUI = (props: any) => {
|
|
|
293
293
|
|
|
294
294
|
useEffect(() => {
|
|
295
295
|
setupUserPhoneNumber()
|
|
296
|
-
}, [user])
|
|
296
|
+
}, [user?.cellphone, user?.country_phone_code])
|
|
297
297
|
|
|
298
298
|
return (
|
|
299
299
|
<SafeAreaView style={{ flex: 1 }}>
|
|
@@ -402,6 +402,7 @@ const UserVerificationUI = (props: any) => {
|
|
|
402
402
|
textStyle={{ color: theme.colors.textNormal, fontSize: 12, padding: 0 }}
|
|
403
403
|
noDropIcon
|
|
404
404
|
isDisabled
|
|
405
|
+
updateStateWithSubmit
|
|
405
406
|
/>
|
|
406
407
|
</InputWrapper>
|
|
407
408
|
</>
|
|
@@ -485,6 +486,7 @@ const UserVerificationUI = (props: any) => {
|
|
|
485
486
|
user={user}
|
|
486
487
|
isEdit
|
|
487
488
|
isVerifiedPhone
|
|
489
|
+
dontToggleEditMode
|
|
488
490
|
/>
|
|
489
491
|
</View>
|
|
490
492
|
</ScrollView>
|