ordering-ui-react-native 0.14.10 → 0.14.11
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
|
@@ -22,7 +22,6 @@ export const AppleLogin = (props: AppleLoginParams) => {
|
|
|
22
22
|
const [ordering] = useApi()
|
|
23
23
|
const [, t] = useLanguage()
|
|
24
24
|
const theme = useTheme()
|
|
25
|
-
const [errors, setError] = useState<any>({type: '', message: ''})
|
|
26
25
|
const buttonText = t('LOGIN_WITH_APPLE', 'Login with Apple');
|
|
27
26
|
|
|
28
27
|
const onAppleButtonPress = async () => {
|
|
@@ -47,14 +46,12 @@ export const AppleLogin = (props: AppleLoginParams) => {
|
|
|
47
46
|
} = appleAuthRequestResponse
|
|
48
47
|
if (identityToken) {
|
|
49
48
|
console.log('auth code: ', authorizationCode)
|
|
50
|
-
handleLoginApple(
|
|
51
|
-
console.warn(`Apple Authentication Completed, ${user}, ${email}`);
|
|
49
|
+
handleLoginApple(authorizationCode)
|
|
52
50
|
} else {
|
|
53
51
|
handleErrors && handleErrors(t('ERROR_LOGIN_APPLE', 'Error login with apple'))
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
} catch (error: any) {
|
|
57
|
-
setError({ type: 'FROM_APPLE', message: error?.message })
|
|
58
55
|
handleErrors && handleErrors(error.message)
|
|
59
56
|
}
|
|
60
57
|
} else {
|
|
@@ -74,7 +71,7 @@ export const AppleLogin = (props: AppleLoginParams) => {
|
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
73
|
}
|
|
77
|
-
const handleLoginApple = async (code: string) => {
|
|
74
|
+
const handleLoginApple = async (code: string | null) => {
|
|
78
75
|
let body: any
|
|
79
76
|
if (Platform.OS === 'ios') {
|
|
80
77
|
body = {
|
|
@@ -106,7 +103,6 @@ export const AppleLogin = (props: AppleLoginParams) => {
|
|
|
106
103
|
handleErrors && handleErrors(result || t('ERROR_LOGIN_AUTH_APPLE', 'Error login auth with apple'))
|
|
107
104
|
}
|
|
108
105
|
} catch (error: any) {
|
|
109
|
-
setError({ type: 'FROM_API', message: error?.message })
|
|
110
106
|
handleLoading && handleLoading(false)
|
|
111
107
|
handleErrors && handleErrors(error?.message)
|
|
112
108
|
}
|
|
@@ -121,11 +117,6 @@ export const AppleLogin = (props: AppleLoginParams) => {
|
|
|
121
117
|
|
|
122
118
|
return (
|
|
123
119
|
<Container>
|
|
124
|
-
{!!errors?.message && !!errors?.type && (
|
|
125
|
-
<OText>
|
|
126
|
-
{errors?.type} {errors?.message}
|
|
127
|
-
</OText>
|
|
128
|
-
)}
|
|
129
120
|
<AppleButton
|
|
130
121
|
onPress={onAppleButtonPress}
|
|
131
122
|
>
|
|
@@ -224,7 +224,7 @@ export const UserFormDetailsUI = (props: any) => {
|
|
|
224
224
|
render={() => (
|
|
225
225
|
<>
|
|
226
226
|
<OText size={14} lineHeight={21} color={theme.colors.textNormal} weight={'500'} style={{ textTransform: 'capitalize', alignSelf: 'flex-start' }}>
|
|
227
|
-
{field?.code}
|
|
227
|
+
{t(field?.code?.toUpperCase(), field?.name)}
|
|
228
228
|
</OText>
|
|
229
229
|
<OInput
|
|
230
230
|
name={field.code}
|
|
@@ -47,6 +47,11 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
47
47
|
pagePadding: {
|
|
48
48
|
paddingLeft: 40,
|
|
49
49
|
paddingRight: 40
|
|
50
|
+
},
|
|
51
|
+
navBarStyle: {
|
|
52
|
+
paddingLeft: 40,
|
|
53
|
+
paddingRight: 40,
|
|
54
|
+
paddingTop: 15
|
|
50
55
|
}
|
|
51
56
|
});
|
|
52
57
|
|
|
@@ -216,7 +221,7 @@ const ProfileUI = (props: ProfileParams) => {
|
|
|
216
221
|
btnStyle={{ paddingStart: 0 }}
|
|
217
222
|
title={t('ACCOUNT', 'Account')}
|
|
218
223
|
isVertical
|
|
219
|
-
style={styles.
|
|
224
|
+
style={styles.navBarStyle}
|
|
220
225
|
/>
|
|
221
226
|
<CenterView style={styles.pagePadding}>
|
|
222
227
|
<View style={styles.photo}>
|