@oxyhq/services 5.12.11 → 5.13.1

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.
Files changed (208) hide show
  1. package/lib/commonjs/core/OxyServices.js +86 -8
  2. package/lib/commonjs/core/OxyServices.js.map +1 -1
  3. package/lib/commonjs/i18n/index.js +37 -1
  4. package/lib/commonjs/i18n/index.js.map +1 -1
  5. package/lib/commonjs/i18n/locales/ar-SA.json +128 -0
  6. package/lib/commonjs/i18n/locales/ca-ES.json +128 -0
  7. package/lib/commonjs/i18n/locales/de-DE.json +128 -0
  8. package/lib/commonjs/i18n/locales/en-US.json +85 -12
  9. package/lib/commonjs/i18n/locales/es-ES.json +58 -6
  10. package/lib/commonjs/i18n/locales/fr-FR.json +128 -0
  11. package/lib/commonjs/i18n/locales/it-IT.json +128 -0
  12. package/lib/commonjs/i18n/locales/ja-JP.json +127 -0
  13. package/lib/commonjs/i18n/locales/ko-KR.json +128 -0
  14. package/lib/commonjs/i18n/locales/pt-PT.json +128 -0
  15. package/lib/commonjs/i18n/locales/zh-CN.json +128 -0
  16. package/lib/commonjs/ui/components/FontLoader.js +22 -42
  17. package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
  18. package/lib/commonjs/ui/components/OxyProvider.js +5 -8
  19. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  20. package/lib/commonjs/ui/components/StepBasedScreen.js +64 -44
  21. package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
  22. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +14 -35
  23. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  24. package/lib/commonjs/ui/components/internal/PinInput.js +2 -2
  25. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
  26. package/lib/commonjs/ui/context/OxyContext.js +434 -321
  27. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  28. package/lib/commonjs/ui/screens/FileManagementScreen.js +56 -5
  29. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  30. package/lib/commonjs/ui/screens/SignInScreen.js +43 -39
  31. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  32. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +139 -125
  33. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  34. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +2 -4
  35. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  36. package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js +45 -25
  37. package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js.map +1 -1
  38. package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js +88 -53
  39. package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -1
  40. package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js +79 -58
  41. package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
  42. package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js +61 -52
  43. package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
  44. package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js +220 -31
  45. package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js.map +1 -1
  46. package/lib/commonjs/ui/screens/steps/SignInTotpStep.js +77 -50
  47. package/lib/commonjs/ui/screens/steps/SignInTotpStep.js.map +1 -1
  48. package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js +527 -66
  49. package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js.map +1 -1
  50. package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js +55 -30
  51. package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
  52. package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js +64 -46
  53. package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
  54. package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js +84 -146
  55. package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
  56. package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js +113 -34
  57. package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
  58. package/lib/commonjs/ui/stores/authStore.js +16 -20
  59. package/lib/commonjs/ui/stores/authStore.js.map +1 -1
  60. package/lib/commonjs/ui/styles/authStyles.js +2 -1
  61. package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
  62. package/lib/commonjs/ui/styles/index.js +11 -0
  63. package/lib/commonjs/ui/styles/index.js.map +1 -1
  64. package/lib/commonjs/ui/styles/spacing.js +51 -0
  65. package/lib/commonjs/ui/styles/spacing.js.map +1 -0
  66. package/lib/commonjs/utils/validationUtils.js +1 -1
  67. package/lib/module/core/OxyServices.js +86 -8
  68. package/lib/module/core/OxyServices.js.map +1 -1
  69. package/lib/module/i18n/index.js +37 -1
  70. package/lib/module/i18n/index.js.map +1 -1
  71. package/lib/module/i18n/locales/ar-SA.json +128 -0
  72. package/lib/module/i18n/locales/ca-ES.json +128 -0
  73. package/lib/module/i18n/locales/de-DE.json +128 -0
  74. package/lib/module/i18n/locales/en-US.json +85 -12
  75. package/lib/module/i18n/locales/es-ES.json +58 -6
  76. package/lib/module/i18n/locales/fr-FR.json +128 -0
  77. package/lib/module/i18n/locales/it-IT.json +128 -0
  78. package/lib/module/i18n/locales/ja-JP.json +127 -0
  79. package/lib/module/i18n/locales/ko-KR.json +128 -0
  80. package/lib/module/i18n/locales/pt-PT.json +128 -0
  81. package/lib/module/i18n/locales/zh-CN.json +128 -0
  82. package/lib/module/ui/components/FontLoader.js +23 -43
  83. package/lib/module/ui/components/FontLoader.js.map +1 -1
  84. package/lib/module/ui/components/OxyProvider.js +6 -8
  85. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  86. package/lib/module/ui/components/StepBasedScreen.js +65 -45
  87. package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
  88. package/lib/module/ui/components/internal/GroupedPillButtons.js +14 -35
  89. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  90. package/lib/module/ui/components/internal/PinInput.js +2 -2
  91. package/lib/module/ui/components/internal/PinInput.js.map +1 -1
  92. package/lib/module/ui/context/OxyContext.js +434 -321
  93. package/lib/module/ui/context/OxyContext.js.map +1 -1
  94. package/lib/module/ui/screens/FileManagementScreen.js +56 -5
  95. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  96. package/lib/module/ui/screens/SignInScreen.js +44 -40
  97. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  98. package/lib/module/ui/screens/WelcomeNewUserScreen.js +138 -126
  99. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  100. package/lib/module/ui/screens/internal/SignInUsernameStep.js +2 -4
  101. package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  102. package/lib/module/ui/screens/steps/RecoverRequestStep.js +45 -25
  103. package/lib/module/ui/screens/steps/RecoverRequestStep.js.map +1 -1
  104. package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js +89 -54
  105. package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -1
  106. package/lib/module/ui/screens/steps/RecoverSuccessStep.js +80 -59
  107. package/lib/module/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
  108. package/lib/module/ui/screens/steps/RecoverVerifyStep.js +62 -53
  109. package/lib/module/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
  110. package/lib/module/ui/screens/steps/SignInPasswordStep.js +221 -32
  111. package/lib/module/ui/screens/steps/SignInPasswordStep.js.map +1 -1
  112. package/lib/module/ui/screens/steps/SignInTotpStep.js +78 -51
  113. package/lib/module/ui/screens/steps/SignInTotpStep.js.map +1 -1
  114. package/lib/module/ui/screens/steps/SignInUsernameStep.js +530 -68
  115. package/lib/module/ui/screens/steps/SignInUsernameStep.js.map +1 -1
  116. package/lib/module/ui/screens/steps/SignUpIdentityStep.js +55 -30
  117. package/lib/module/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
  118. package/lib/module/ui/screens/steps/SignUpSecurityStep.js +65 -47
  119. package/lib/module/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
  120. package/lib/module/ui/screens/steps/SignUpSummaryStep.js +84 -146
  121. package/lib/module/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
  122. package/lib/module/ui/screens/steps/SignUpWelcomeStep.js +114 -35
  123. package/lib/module/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
  124. package/lib/module/ui/stores/authStore.js +16 -20
  125. package/lib/module/ui/stores/authStore.js.map +1 -1
  126. package/lib/module/ui/styles/authStyles.js +2 -1
  127. package/lib/module/ui/styles/authStyles.js.map +1 -1
  128. package/lib/module/ui/styles/index.js +1 -0
  129. package/lib/module/ui/styles/index.js.map +1 -1
  130. package/lib/module/ui/styles/spacing.js +48 -0
  131. package/lib/module/ui/styles/spacing.js.map +1 -0
  132. package/lib/module/utils/validationUtils.js +1 -1
  133. package/lib/typescript/core/OxyServices.d.ts +38 -2
  134. package/lib/typescript/core/OxyServices.d.ts.map +1 -1
  135. package/lib/typescript/i18n/index.d.ts.map +1 -1
  136. package/lib/typescript/ui/components/FontLoader.d.ts +3 -3
  137. package/lib/typescript/ui/components/FontLoader.d.ts.map +1 -1
  138. package/lib/typescript/ui/components/OxyProvider.d.ts +2 -2
  139. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  140. package/lib/typescript/ui/components/StepBasedScreen.d.ts.map +1 -1
  141. package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  142. package/lib/typescript/ui/context/OxyContext.d.ts +1 -0
  143. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  144. package/lib/typescript/ui/screens/FileManagementScreen.d.ts +10 -0
  145. package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
  146. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  147. package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  148. package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts.map +1 -1
  149. package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts.map +1 -1
  150. package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts.map +1 -1
  151. package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts.map +1 -1
  152. package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts +2 -0
  153. package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts.map +1 -1
  154. package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts.map +1 -1
  155. package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts.map +1 -1
  156. package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts.map +1 -1
  157. package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts.map +1 -1
  158. package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts.map +1 -1
  159. package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts.map +1 -1
  160. package/lib/typescript/ui/stores/authStore.d.ts +7 -3
  161. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
  162. package/lib/typescript/ui/styles/authStyles.d.ts +1 -0
  163. package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -1
  164. package/lib/typescript/ui/styles/index.d.ts +1 -0
  165. package/lib/typescript/ui/styles/index.d.ts.map +1 -1
  166. package/lib/typescript/ui/styles/spacing.d.ts +43 -0
  167. package/lib/typescript/ui/styles/spacing.d.ts.map +1 -0
  168. package/lib/typescript/utils/validationUtils.d.ts +1 -1
  169. package/package.json +1 -1
  170. package/src/core/OxyServices.ts +96 -10
  171. package/src/i18n/index.ts +36 -0
  172. package/src/i18n/locales/ar-SA.json +128 -0
  173. package/src/i18n/locales/ca-ES.json +128 -0
  174. package/src/i18n/locales/de-DE.json +128 -0
  175. package/src/i18n/locales/en-US.json +85 -12
  176. package/src/i18n/locales/es-ES.json +58 -6
  177. package/src/i18n/locales/fr-FR.json +128 -0
  178. package/src/i18n/locales/it-IT.json +128 -0
  179. package/src/i18n/locales/ja-JP.json +127 -0
  180. package/src/i18n/locales/ko-KR.json +128 -0
  181. package/src/i18n/locales/pt-PT.json +128 -0
  182. package/src/i18n/locales/zh-CN.json +128 -0
  183. package/src/ui/components/FontLoader.tsx +17 -37
  184. package/src/ui/components/OxyProvider.tsx +14 -13
  185. package/src/ui/components/StepBasedScreen.tsx +66 -43
  186. package/src/ui/components/internal/GroupedPillButtons.tsx +15 -31
  187. package/src/ui/components/internal/PinInput.tsx +2 -2
  188. package/src/ui/context/OxyContext.tsx +404 -285
  189. package/src/ui/screens/FileManagementScreen.tsx +81 -4
  190. package/src/ui/screens/SignInScreen.tsx +59 -36
  191. package/src/ui/screens/WelcomeNewUserScreen.tsx +102 -91
  192. package/src/ui/screens/internal/SignInUsernameStep.tsx +1 -1
  193. package/src/ui/screens/steps/RecoverRequestStep.tsx +34 -24
  194. package/src/ui/screens/steps/RecoverResetPasswordStep.tsx +65 -36
  195. package/src/ui/screens/steps/RecoverSuccessStep.tsx +71 -47
  196. package/src/ui/screens/steps/RecoverVerifyStep.tsx +60 -50
  197. package/src/ui/screens/steps/SignInPasswordStep.tsx +191 -29
  198. package/src/ui/screens/steps/SignInTotpStep.tsx +68 -34
  199. package/src/ui/screens/steps/SignInUsernameStep.tsx +586 -57
  200. package/src/ui/screens/steps/SignUpIdentityStep.tsx +49 -35
  201. package/src/ui/screens/steps/SignUpSecurityStep.tsx +56 -39
  202. package/src/ui/screens/steps/SignUpSummaryStep.tsx +99 -89
  203. package/src/ui/screens/steps/SignUpWelcomeStep.tsx +88 -20
  204. package/src/ui/stores/authStore.ts +15 -19
  205. package/src/ui/styles/authStyles.ts +2 -1
  206. package/src/ui/styles/index.ts +1 -0
  207. package/src/ui/styles/spacing.ts +46 -0
  208. package/src/utils/validationUtils.ts +1 -1
@@ -1,9 +1,10 @@
1
1
  import type React from 'react';
2
2
  import type { RouteName } from '../../navigation/routes';
3
- import { View, Text, TouchableOpacity } from 'react-native';
3
+ import { View, Text, TouchableOpacity, Platform, StyleSheet, type ViewStyle, type TextStyle } from 'react-native';
4
4
  import { Ionicons } from '@expo/vector-icons';
5
5
  import HighFive from '../../../assets/illustrations/HighFive';
6
6
  import { useI18n } from '../../hooks/useI18n';
7
+ import { STEP_GAP, STEP_INNER_GAP, stepStyles } from '../../styles/spacing';
7
8
 
8
9
  interface SignUpWelcomeStepProps {
9
10
  // Common props from StepBasedScreen
@@ -25,35 +26,102 @@ const SignUpWelcomeStep: React.FC<SignUpWelcomeStepProps> = ({
25
26
  nextStep,
26
27
  }) => {
27
28
  const { t } = useI18n();
29
+ const localStyles = stylesheet;
30
+ const baseStyles = stepStyles;
31
+ const webShadowReset = Platform.OS === 'web' ? ({ boxShadow: 'none' } as any) : null;
32
+
28
33
  return (
29
34
  <>
30
- <HighFive width={120} height={120} />
31
- <View style={styles.modernHeader}>
32
- <Text style={[styles.modernTitle, { color: colors.text }]}>{t('signup.welcome.title')}</Text>
33
- <Text style={[styles.modernSubtitle, { color: colors.secondaryText }]}>{t('signup.welcome.subtitle')}</Text>
34
- </View>
35
-
36
- <View style={styles.modernInputContainer}>
35
+ <View style={[baseStyles.container, baseStyles.sectionSpacing, { alignItems: 'flex-start', position: 'relative' }]}>
36
+ <HighFive width={100} height={100} />
37
37
  <TouchableOpacity
38
- style={[styles.button, { backgroundColor: colors.primary }]}
39
- onPress={nextStep}
40
- testID="get-started-button"
38
+ style={[localStyles.languageButton, { backgroundColor: colors.inputBackground }]}
39
+ onPress={() => navigate('LanguageSelector')}
40
+ activeOpacity={0.7}
41
41
  >
42
- <Ionicons name="rocket-outline" size={20} color={colors.background} />
43
- <Text style={[styles.buttonText, { color: colors.background }]}>{t('common.actions.getStarted')}</Text>
42
+ <Ionicons name="globe-outline" size={20} color={colors.primary} />
44
43
  </TouchableOpacity>
44
+ </View>
45
+ <View style={[baseStyles.container, baseStyles.sectionSpacing, baseStyles.header]}>
46
+ <Text style={[styles.modernTitle, baseStyles.title, { color: colors.text, marginBottom: 0, marginTop: 0 }]}>{t('signup.welcome.title')}</Text>
47
+ <Text style={[styles.modernSubtitle, baseStyles.subtitle, { color: colors.secondaryText, marginBottom: 0, marginTop: 0 }]}>{t('signup.welcome.subtitle')}</Text>
48
+ </View>
45
49
 
46
- <TouchableOpacity
47
- style={[styles.footerTextContainer]}
48
- onPress={() => navigate('SignIn')}
50
+ <View style={[baseStyles.container, baseStyles.sectionSpacing]}>
51
+ <View
52
+ style={[
53
+ localStyles.actionCard,
54
+ { backgroundColor: colors.inputBackground || colors.card || 'rgba(0,0,0,0.04)' },
55
+ webShadowReset,
56
+ ]}
49
57
  >
50
- <Text style={[styles.footerText, { color: colors.secondaryText }]}>
51
- {t('signin.title')}
52
- </Text>
53
- </TouchableOpacity>
58
+ <TouchableOpacity
59
+ style={[
60
+ styles.button,
61
+ localStyles.primaryButton,
62
+ { backgroundColor: colors.primary },
63
+ webShadowReset,
64
+ ]}
65
+ onPress={nextStep}
66
+ testID="get-started-button"
67
+ >
68
+ <Text style={[styles.buttonText, localStyles.buttonText, { color: colors.background }]}>{t('common.actions.getStarted')}</Text>
69
+ </TouchableOpacity>
70
+
71
+ <TouchableOpacity
72
+ style={[styles.footerTextContainer, localStyles.footerLink, { marginTop: 0 }]}
73
+ onPress={() => navigate('SignIn')}
74
+ >
75
+ <Text style={[styles.footerText, { color: colors.secondaryText }]}>
76
+ {t('signup.welcome.haveAccount')}
77
+ <Text style={{ color: colors.primary, fontWeight: '600' }}> {t('signup.welcome.signInCta')}</Text>
78
+ </Text>
79
+ </TouchableOpacity>
80
+ </View>
54
81
  </View>
55
82
  </>
56
83
  );
57
84
  };
58
85
 
59
86
  export default SignUpWelcomeStep;
87
+
88
+ const stylesheet = StyleSheet.create({
89
+ actionCard: {
90
+ width: '100%',
91
+ maxWidth: 420,
92
+ borderRadius: 28,
93
+ paddingHorizontal: 20,
94
+ paddingVertical: 18,
95
+ gap: STEP_INNER_GAP,
96
+ alignItems: 'stretch',
97
+ shadowColor: 'transparent',
98
+ },
99
+ primaryButton: {
100
+ borderRadius: 28,
101
+ width: '100%',
102
+ paddingVertical: 16,
103
+ justifyContent: 'center',
104
+ shadowOpacity: 0,
105
+ shadowRadius: 0,
106
+ shadowOffset: { width: 0, height: 0 },
107
+ elevation: 0,
108
+ },
109
+ buttonText: {
110
+ fontSize: 16,
111
+ fontWeight: '600',
112
+ textAlign: 'center',
113
+ },
114
+ footerLink: {
115
+ alignSelf: 'center',
116
+ },
117
+ languageButton: {
118
+ position: 'absolute',
119
+ top: 0,
120
+ right: 0,
121
+ width: 40,
122
+ height: 40,
123
+ borderRadius: 20,
124
+ alignItems: 'center',
125
+ justifyContent: 'center',
126
+ },
127
+ });
@@ -7,12 +7,11 @@ interface AuthState {
7
7
  isLoading: boolean;
8
8
  error: string | null;
9
9
  lastUserFetch: number | null; // Timestamp of last user fetch for caching
10
- loginStart: () => void;
11
10
  loginSuccess: (user: User) => void;
12
11
  loginFailure: (error: string) => void;
13
12
  logout: () => void;
14
- fetchUser: (oxyServices: any, forceRefresh?: boolean) => Promise<void>;
15
- updateUser: (updates: Partial<User>, oxyServices: any) => Promise<void>;
13
+ fetchUser: (oxyServices: { getCurrentUser: () => Promise<User> }, forceRefresh?: boolean) => Promise<void>;
14
+ updateUser: (updates: Partial<User>, oxyServices: { updateProfile: (updates: Partial<User>) => Promise<User>; getCurrentUser: () => Promise<User> }) => Promise<void>;
16
15
  setUser: (user: User) => void; // Direct user setter for caching
17
16
  }
18
17
 
@@ -22,7 +21,6 @@ export const useAuthStore = create<AuthState>((set: (state: Partial<AuthState>)
22
21
  isLoading: false,
23
22
  error: null,
24
23
  lastUserFetch: null,
25
- loginStart: () => set({ isLoading: true, error: null }),
26
24
  loginSuccess: (user: User) => set({ isLoading: false, isAuthenticated: true, user, lastUserFetch: Date.now() }),
27
25
  loginFailure: (error: string) => set({ isLoading: false, error }),
28
26
  logout: () => set({ user: null, isAuthenticated: false, lastUserFetch: null }),
@@ -35,38 +33,36 @@ export const useAuthStore = create<AuthState>((set: (state: Partial<AuthState>)
35
33
 
36
34
  // Use cached data if available and not forcing refresh
37
35
  if (!forceRefresh && state.user && cacheValid) {
36
+ if (__DEV__) {
38
37
  console.log('AuthStore: Using cached user data (age:', cacheAge, 'ms)');
38
+ }
39
39
  return;
40
40
  }
41
41
 
42
42
  set({ isLoading: true, error: null });
43
43
  try {
44
- console.log('AuthStore: Fetching user data...');
45
44
  const user = await oxyServices.getCurrentUser();
46
- console.log('AuthStore: Received user data:', {
47
- hasUser: !!user,
48
- userLinksMetadata: user?.linksMetadata,
49
- userLinks: user?.links,
50
- userWebsite: user?.website
51
- });
52
45
  set({ user, isLoading: false, isAuthenticated: true, lastUserFetch: now });
53
- } catch (error: any) {
46
+ } catch (error) {
47
+ const errorMessage = error instanceof Error ? error.message : 'Failed to fetch user';
48
+ if (__DEV__) {
54
49
  console.error('AuthStore: Error fetching user:', error);
55
- set({ error: error.message || 'Failed to fetch user', isLoading: false });
50
+ }
51
+ set({ error: errorMessage, isLoading: false });
56
52
  }
57
53
  },
58
54
  updateUser: async (updates, oxyServices) => {
59
55
  set({ isLoading: true, error: null });
60
56
  try {
61
- console.log('AuthStore: Updating user with:', updates);
62
57
  await oxyServices.updateProfile(updates);
63
- console.log('AuthStore: Profile updated successfully');
64
58
  // Immediately fetch the latest user data after update
65
- await useAuthStore.getState().fetchUser(oxyServices, true); // Force refresh
66
- console.log('AuthStore: User data refreshed');
67
- } catch (error: any) {
59
+ await useAuthStore.getState().fetchUser({ getCurrentUser: oxyServices.getCurrentUser }, true);
60
+ } catch (error) {
61
+ const errorMessage = error instanceof Error ? error.message : 'Failed to update user';
62
+ if (__DEV__) {
68
63
  console.error('AuthStore: Error updating user:', error);
69
- set({ error: error.message || 'Failed to update user', isLoading: false });
64
+ }
65
+ set({ error: errorMessage, isLoading: false });
70
66
  }
71
67
  },
72
68
  }));
@@ -22,7 +22,8 @@ export const createAuthStyles = (colors: AuthThemeColors, theme: string) => Styl
22
22
  scrollContent: {
23
23
  flexGrow: 1,
24
24
  paddingHorizontal: 24,
25
- paddingTop: 4,
25
+ paddingTop: 0,
26
+ paddingBottom: 32,
26
27
  },
27
28
  stepContainer: {
28
29
  flex: 1,
@@ -1,3 +1,4 @@
1
1
  export * from './fonts';
2
2
  export * from './theme';
3
3
  export * from './authStyles';
4
+ export * from './spacing';
@@ -0,0 +1,46 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ /**
4
+ * Shared spacing constants for authentication screens
5
+ * These values ensure consistent vertical spacing across all step components
6
+ * All gaps between elements (illustration, title, description, textfield, buttons, etc.) use this value
7
+ */
8
+ export const STEP_GAP = 12; // Vertical gap between ALL elements (illustration, title, description, textfield, buttons, etc.) - must be consistent everywhere
9
+ export const STEP_INNER_GAP = 12; // Gap within sections (headers, cards, etc.) - must match STEP_GAP for uniformity
10
+
11
+ /**
12
+ * Reusable stylesheet for step components
13
+ * All step components should use these base styles for consistency
14
+ */
15
+ export const stepStyles = StyleSheet.create({
16
+ container: {
17
+ width: '100%',
18
+ maxWidth: 420,
19
+ alignSelf: 'center',
20
+ },
21
+ sectionSpacing: {
22
+ marginBottom: STEP_GAP,
23
+ },
24
+ header: {
25
+ alignItems: 'flex-start',
26
+ width: '100%',
27
+ gap: STEP_INNER_GAP,
28
+ },
29
+ title: {
30
+ textAlign: 'left',
31
+ marginBottom: 0,
32
+ marginTop: 0,
33
+ },
34
+ subtitle: {
35
+ textAlign: 'left',
36
+ maxWidth: 320,
37
+ alignSelf: 'flex-start',
38
+ marginBottom: 0,
39
+ marginTop: 0,
40
+ },
41
+ buttonContainer: {
42
+ marginTop: 0,
43
+ marginBottom: 0,
44
+ },
45
+ });
46
+
@@ -8,7 +8,7 @@
8
8
  export const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
9
9
 
10
10
  /**
11
- * Username validation regex (alphanumeric, underscore, dash, 3-30 chars)
11
+ * Username validation regex (alphanumeric, underscores, and hyphens, 3-30 chars)
12
12
  */
13
13
  export const USERNAME_REGEX = /^[a-zA-Z0-9_-]{3,30}$/;
14
14