@oxyhq/services 5.13.0 → 5.13.2
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/README.md +71 -0
- package/lib/commonjs/core/HttpClient.js +238 -0
- package/lib/commonjs/core/HttpClient.js.map +1 -0
- package/lib/commonjs/core/OxyServices.js +530 -332
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/core/RequestManager.js +199 -0
- package/lib/commonjs/core/RequestManager.js.map +1 -0
- package/lib/commonjs/core/index.js +38 -1
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/i18n/index.js +37 -1
- package/lib/commonjs/i18n/index.js.map +1 -1
- package/lib/commonjs/i18n/locales/ar-SA.json +128 -0
- package/lib/commonjs/i18n/locales/ca-ES.json +128 -0
- package/lib/commonjs/i18n/locales/de-DE.json +128 -0
- package/lib/commonjs/i18n/locales/en-US.json +85 -12
- package/lib/commonjs/i18n/locales/es-ES.json +58 -6
- package/lib/commonjs/i18n/locales/fr-FR.json +128 -0
- package/lib/commonjs/i18n/locales/it-IT.json +128 -0
- package/lib/commonjs/i18n/locales/ja-JP.json +127 -0
- package/lib/commonjs/i18n/locales/ko-KR.json +128 -0
- package/lib/commonjs/i18n/locales/pt-PT.json +128 -0
- package/lib/commonjs/i18n/locales/zh-CN.json +128 -0
- package/lib/commonjs/index.js +36 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +94 -27
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +1 -0
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FontLoader.js +22 -42
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +5 -8
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +64 -44
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +14 -35
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +2 -2
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.js +13 -8
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +443 -371
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +80 -22
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/index.js +4 -1
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +32 -2
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +101 -59
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +3 -2
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +75 -117
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +43 -50
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +14 -16
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +188 -142
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +10 -10
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +2 -4
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js +45 -25
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js +88 -53
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js +79 -58
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js +61 -52
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js +218 -39
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js +77 -50
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js +424 -71
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js +55 -30
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js +64 -46
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js +84 -146
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js +113 -34
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
- package/lib/commonjs/ui/stores/accountStore.js +237 -0
- package/lib/commonjs/ui/stores/accountStore.js.map +1 -0
- package/lib/commonjs/ui/stores/authStore.js +17 -20
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +16 -8
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/ui/styles/index.js +11 -0
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/commonjs/ui/styles/spacing.js +51 -0
- package/lib/commonjs/ui/styles/spacing.js.map +1 -0
- package/lib/commonjs/utils/asyncUtils.js +9 -22
- package/lib/commonjs/utils/asyncUtils.js.map +1 -1
- package/lib/commonjs/utils/cache.js +259 -0
- package/lib/commonjs/utils/cache.js.map +1 -0
- package/lib/commonjs/utils/index.js +99 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/languageUtils.js +159 -0
- package/lib/commonjs/utils/languageUtils.js.map +1 -0
- package/lib/commonjs/utils/requestUtils.js +217 -0
- package/lib/commonjs/utils/requestUtils.js.map +1 -0
- package/lib/commonjs/utils/sessionUtils.js +191 -0
- package/lib/commonjs/utils/sessionUtils.js.map +1 -0
- package/lib/commonjs/utils/validationUtils.js +1 -1
- package/lib/module/core/HttpClient.js +232 -0
- package/lib/module/core/HttpClient.js.map +1 -0
- package/lib/module/core/OxyServices.js +528 -326
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/core/RequestManager.js +194 -0
- package/lib/module/core/RequestManager.js.map +1 -0
- package/lib/module/core/index.js +2 -0
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/i18n/index.js +37 -1
- package/lib/module/i18n/index.js.map +1 -1
- package/lib/module/i18n/locales/ar-SA.json +128 -0
- package/lib/module/i18n/locales/ca-ES.json +128 -0
- package/lib/module/i18n/locales/de-DE.json +128 -0
- package/lib/module/i18n/locales/en-US.json +85 -12
- package/lib/module/i18n/locales/es-ES.json +58 -6
- package/lib/module/i18n/locales/fr-FR.json +128 -0
- package/lib/module/i18n/locales/it-IT.json +128 -0
- package/lib/module/i18n/locales/ja-JP.json +127 -0
- package/lib/module/i18n/locales/ko-KR.json +128 -0
- package/lib/module/i18n/locales/pt-PT.json +128 -0
- package/lib/module/i18n/locales/zh-CN.json +128 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +94 -27
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +1 -0
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FontLoader.js +23 -43
- package/lib/module/ui/components/FontLoader.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +6 -8
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +65 -45
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +14 -35
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +2 -2
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.js +13 -8
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +442 -370
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +80 -22
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/index.js +4 -2
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +33 -2
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +102 -60
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +3 -2
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +73 -117
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +44 -51
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +14 -16
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +187 -143
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +10 -10
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +2 -4
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverRequestStep.js +45 -25
- package/lib/module/ui/screens/steps/RecoverRequestStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js +89 -54
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js +80 -59
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js +62 -53
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInPasswordStep.js +219 -40
- package/lib/module/ui/screens/steps/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInTotpStep.js +78 -51
- package/lib/module/ui/screens/steps/SignInTotpStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInUsernameStep.js +426 -73
- package/lib/module/ui/screens/steps/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js +55 -30
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js +65 -47
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js +84 -146
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js +114 -35
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
- package/lib/module/ui/stores/accountStore.js +229 -0
- package/lib/module/ui/stores/accountStore.js.map +1 -0
- package/lib/module/ui/stores/authStore.js +17 -20
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +16 -8
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/styles/index.js +1 -0
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/module/ui/styles/spacing.js +48 -0
- package/lib/module/ui/styles/spacing.js.map +1 -0
- package/lib/module/utils/asyncUtils.js +10 -22
- package/lib/module/utils/asyncUtils.js.map +1 -1
- package/lib/module/utils/cache.js +250 -0
- package/lib/module/utils/cache.js.map +1 -0
- package/lib/module/utils/index.js +7 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/languageUtils.js +151 -0
- package/lib/module/utils/languageUtils.js.map +1 -0
- package/lib/module/utils/requestUtils.js +210 -0
- package/lib/module/utils/requestUtils.js.map +1 -0
- package/lib/module/utils/sessionUtils.js +180 -0
- package/lib/module/utils/sessionUtils.js.map +1 -0
- package/lib/module/utils/validationUtils.js +1 -1
- package/lib/typescript/core/HttpClient.d.ts +64 -0
- package/lib/typescript/core/HttpClient.d.ts.map +1 -0
- package/lib/typescript/core/OxyServices.d.ts +86 -73
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/core/RequestManager.d.ts +67 -0
- package/lib/typescript/core/RequestManager.d.ts.map +1 -0
- package/lib/typescript/core/index.d.ts +2 -0
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/i18n/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +15 -0
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/models/session.d.ts +1 -0
- package/lib/typescript/models/session.d.ts.map +1 -1
- package/lib/typescript/ui/components/Avatar.d.ts +6 -7
- package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/FontLoader.d.ts +3 -3
- package/lib/typescript/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +5 -0
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/ui/index.d.ts +2 -2
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts +3 -3
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts +2 -0
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts.map +1 -1
- package/lib/typescript/ui/stores/accountStore.d.ts +34 -0
- package/lib/typescript/ui/stores/accountStore.d.ts.map +1 -0
- package/lib/typescript/ui/stores/authStore.d.ts +7 -3
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/authStyles.d.ts +19 -2
- package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -1
- package/lib/typescript/ui/styles/index.d.ts +1 -0
- package/lib/typescript/ui/styles/index.d.ts.map +1 -1
- package/lib/typescript/ui/styles/spacing.d.ts +43 -0
- package/lib/typescript/ui/styles/spacing.d.ts.map +1 -0
- package/lib/typescript/utils/asyncUtils.d.ts +2 -0
- package/lib/typescript/utils/asyncUtils.d.ts.map +1 -1
- package/lib/typescript/utils/cache.d.ts +128 -0
- package/lib/typescript/utils/cache.d.ts.map +1 -0
- package/lib/typescript/utils/index.d.ts +4 -0
- package/lib/typescript/utils/index.d.ts.map +1 -1
- package/lib/typescript/utils/languageUtils.d.ts +38 -0
- package/lib/typescript/utils/languageUtils.d.ts.map +1 -0
- package/lib/typescript/utils/requestUtils.d.ts +122 -0
- package/lib/typescript/utils/requestUtils.d.ts.map +1 -0
- package/lib/typescript/utils/sessionUtils.d.ts +55 -0
- package/lib/typescript/utils/sessionUtils.d.ts.map +1 -0
- package/lib/typescript/utils/validationUtils.d.ts +1 -1
- package/package.json +1 -1
- package/src/core/HttpClient.ts +277 -0
- package/src/core/OxyServices.ts +461 -352
- package/src/core/RequestManager.ts +240 -0
- package/src/core/index.ts +10 -0
- package/src/i18n/index.ts +36 -0
- package/src/i18n/locales/ar-SA.json +128 -0
- package/src/i18n/locales/ca-ES.json +128 -0
- package/src/i18n/locales/de-DE.json +128 -0
- package/src/i18n/locales/en-US.json +85 -12
- package/src/i18n/locales/es-ES.json +58 -6
- package/src/i18n/locales/fr-FR.json +128 -0
- package/src/i18n/locales/it-IT.json +128 -0
- package/src/i18n/locales/ja-JP.json +127 -0
- package/src/i18n/locales/ko-KR.json +128 -0
- package/src/i18n/locales/pt-PT.json +128 -0
- package/src/i18n/locales/zh-CN.json +128 -0
- package/src/index.ts +10 -0
- package/src/models/interfaces.ts +19 -0
- package/src/models/session.ts +1 -1
- package/src/ui/components/Avatar.tsx +151 -35
- package/src/ui/components/FollowButton.tsx +1 -0
- package/src/ui/components/FontLoader.tsx +17 -37
- package/src/ui/components/OxyProvider.tsx +14 -13
- package/src/ui/components/StepBasedScreen.tsx +66 -43
- package/src/ui/components/internal/GroupedPillButtons.tsx +15 -31
- package/src/ui/components/internal/PinInput.tsx +2 -2
- package/src/ui/components/internal/TextField.tsx +7 -6
- package/src/ui/context/OxyContext.tsx +441 -326
- package/src/ui/hooks/useSessionSocket.ts +72 -18
- package/src/ui/index.ts +4 -1
- package/src/ui/screens/AccountSettingsScreen.tsx +34 -2
- package/src/ui/screens/AccountSwitcherScreen.tsx +102 -68
- package/src/ui/screens/FileManagementScreen.tsx +16 -16
- package/src/ui/screens/LanguageSelectorScreen.tsx +86 -143
- package/src/ui/screens/SignInScreen.tsx +59 -43
- package/src/ui/screens/SignUpScreen.tsx +14 -15
- package/src/ui/screens/WelcomeNewUserScreen.tsx +153 -105
- package/src/ui/screens/internal/SignInPasswordStep.tsx +4 -6
- package/src/ui/screens/internal/SignInUsernameStep.tsx +1 -1
- package/src/ui/screens/steps/RecoverRequestStep.tsx +34 -24
- package/src/ui/screens/steps/RecoverResetPasswordStep.tsx +65 -36
- package/src/ui/screens/steps/RecoverSuccessStep.tsx +71 -47
- package/src/ui/screens/steps/RecoverVerifyStep.tsx +60 -50
- package/src/ui/screens/steps/SignInPasswordStep.tsx +190 -32
- package/src/ui/screens/steps/SignInTotpStep.tsx +68 -34
- package/src/ui/screens/steps/SignInUsernameStep.tsx +446 -63
- package/src/ui/screens/steps/SignUpIdentityStep.tsx +49 -35
- package/src/ui/screens/steps/SignUpSecurityStep.tsx +56 -39
- package/src/ui/screens/steps/SignUpSummaryStep.tsx +99 -89
- package/src/ui/screens/steps/SignUpWelcomeStep.tsx +88 -20
- package/src/ui/stores/accountStore.ts +285 -0
- package/src/ui/stores/authStore.ts +16 -19
- package/src/ui/styles/authStyles.ts +16 -8
- package/src/ui/styles/index.ts +1 -0
- package/src/ui/styles/spacing.ts +46 -0
- package/src/utils/asyncUtils.ts +10 -24
- package/src/utils/cache.ts +264 -0
- package/src/utils/index.ts +19 -0
- package/src/utils/languageUtils.ts +174 -0
- package/src/utils/requestUtils.ts +234 -0
- package/src/utils/sessionUtils.ts +206 -0
- package/src/utils/validationUtils.ts +1 -1
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { RouteName } from '../../navigation/routes';
|
|
3
|
-
import { useRef, useEffect } from 'react';
|
|
4
|
-
import {
|
|
3
|
+
import { useRef, useEffect, useMemo, useState, useCallback } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
View,
|
|
6
|
+
Text,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
ActivityIndicator,
|
|
9
|
+
TouchableOpacity,
|
|
10
|
+
} from 'react-native';
|
|
5
11
|
import { Ionicons } from '@expo/vector-icons';
|
|
6
12
|
import HighFive from '../../../assets/illustrations/HighFive';
|
|
7
13
|
import GroupedPillButtons from '../../components/internal/GroupedPillButtons';
|
|
8
14
|
import TextField from '../../components/internal/TextField';
|
|
9
15
|
import { useI18n } from '../../hooks/useI18n';
|
|
16
|
+
import { stepStyles } from '../../styles/spacing';
|
|
17
|
+
import Avatar from '../../components/Avatar';
|
|
18
|
+
import { useOxy } from '../../context/OxyContext';
|
|
19
|
+
import { toast } from '../../../lib/sonner';
|
|
20
|
+
import { useAccountStore, useAccounts, useAccountLoading, useAccountLoadingSession, type QuickAccount } from '../../stores/accountStore';
|
|
21
|
+
import { fontFamilies } from '../../styles/fonts';
|
|
10
22
|
|
|
11
23
|
interface SignInUsernameStepProps {
|
|
12
24
|
// Common props from StepBasedScreen
|
|
@@ -43,9 +55,15 @@ interface SignInUsernameStepProps {
|
|
|
43
55
|
validateUsername: (username: string) => Promise<boolean>;
|
|
44
56
|
}
|
|
45
57
|
|
|
58
|
+
const MAX_QUICK_ACCOUNTS = 3;
|
|
59
|
+
|
|
60
|
+
const getThemeMode = (theme: string | undefined): 'light' | 'dark' =>
|
|
61
|
+
theme === 'dark' ? 'dark' : 'light';
|
|
62
|
+
|
|
46
63
|
const SignInUsernameStep: React.FC<SignInUsernameStepProps> = ({
|
|
47
64
|
colors,
|
|
48
65
|
styles,
|
|
66
|
+
theme,
|
|
49
67
|
navigate,
|
|
50
68
|
nextStep,
|
|
51
69
|
username,
|
|
@@ -61,83 +79,159 @@ const SignInUsernameStep: React.FC<SignInUsernameStepProps> = ({
|
|
|
61
79
|
}) => {
|
|
62
80
|
const inputRef = useRef<any>(null);
|
|
63
81
|
const { t } = useI18n();
|
|
82
|
+
const { sessions, activeSessionId, switchSession, oxyServices } = useOxy();
|
|
83
|
+
const baseStyles = stepStyles;
|
|
84
|
+
const themeMode = getThemeMode(theme);
|
|
85
|
+
const [switchingSessionId, setSwitchingSessionId] = useState<string | null>(null);
|
|
86
|
+
const [showAccounts, setShowAccounts] = useState(false);
|
|
87
|
+
const previousSessionIdsRef = useRef<string>('');
|
|
88
|
+
|
|
89
|
+
// Zustand store - use stable selectors
|
|
90
|
+
const quickAccounts = useAccounts();
|
|
91
|
+
const loadingAccounts = useAccountLoading();
|
|
92
|
+
const isLoading = useAccountStore(state => state.loading);
|
|
64
93
|
|
|
65
|
-
//
|
|
94
|
+
// Store actions are stable - get them once
|
|
95
|
+
const loadAccountsRef = useRef(useAccountStore.getState().loadAccounts);
|
|
96
|
+
const setAccountsRef = useRef(useAccountStore.getState().setAccounts);
|
|
97
|
+
const moveAccountToTopRef = useRef(useAccountStore.getState().moveAccountToTop);
|
|
98
|
+
|
|
99
|
+
// Update refs if store changes (shouldn't happen, but safe)
|
|
66
100
|
useEffect(() => {
|
|
67
|
-
|
|
68
|
-
|
|
101
|
+
loadAccountsRef.current = useAccountStore.getState().loadAccounts;
|
|
102
|
+
setAccountsRef.current = useAccountStore.getState().setAccounts;
|
|
103
|
+
moveAccountToTopRef.current = useAccountStore.getState().moveAccountToTop;
|
|
104
|
+
}, []);
|
|
105
|
+
|
|
106
|
+
const sessionsToLoad = useMemo(() => {
|
|
107
|
+
const allSessions = sessions || [];
|
|
108
|
+
return allSessions.slice(0, MAX_QUICK_ACCOUNTS);
|
|
109
|
+
}, [sessions]);
|
|
110
|
+
|
|
111
|
+
const sessionsToLoadIds = useMemo(
|
|
112
|
+
() => sessionsToLoad.map(s => s.sessionId).sort().join(','),
|
|
113
|
+
[sessionsToLoad]
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (previousSessionIdsRef.current === sessionsToLoadIds || isLoading) return;
|
|
118
|
+
if (!sessionsToLoad.length || !oxyServices) {
|
|
119
|
+
setAccountsRef.current([]);
|
|
120
|
+
previousSessionIdsRef.current = sessionsToLoadIds;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
previousSessionIdsRef.current = sessionsToLoadIds;
|
|
125
|
+
|
|
126
|
+
const uniqueSessionIds = Array.from(new Set(sessionsToLoad.map(s => s.sessionId)));
|
|
127
|
+
if (uniqueSessionIds.length === 0) {
|
|
128
|
+
setAccountsRef.current([]);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const currentAccounts = useAccountStore.getState().accounts;
|
|
133
|
+
const accountsArray = Object.values(currentAccounts);
|
|
134
|
+
|
|
135
|
+
void loadAccountsRef.current(uniqueSessionIds, oxyServices, accountsArray);
|
|
136
|
+
}, [sessionsToLoadIds, oxyServices, isLoading]);
|
|
137
|
+
|
|
138
|
+
const handleSwitchAccount = useCallback(
|
|
139
|
+
async (sessionId: string) => {
|
|
140
|
+
if (switchingSessionId || sessionId === activeSessionId) return;
|
|
141
|
+
|
|
142
|
+
setSwitchingSessionId(sessionId);
|
|
143
|
+
moveAccountToTopRef.current(sessionId);
|
|
144
|
+
|
|
145
|
+
switchSession(sessionId).catch((error) => {
|
|
146
|
+
if (__DEV__) console.error('Failed to switch account:', error);
|
|
147
|
+
const state = useAccountStore.getState();
|
|
148
|
+
const account = state.accounts[sessionId];
|
|
149
|
+
if (account) {
|
|
150
|
+
const filtered = Object.values(state.accounts).filter(a => a.sessionId !== sessionId);
|
|
151
|
+
setAccountsRef.current([...filtered, account]);
|
|
152
|
+
}
|
|
153
|
+
toast.error(t('signin.actions.switchAccountFailed') || 'Unable to switch accounts. Please try again.');
|
|
154
|
+
}).finally(() => {
|
|
155
|
+
setSwitchingSessionId(null);
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
[switchSession, switchingSessionId, activeSessionId, t]
|
|
159
|
+
);
|
|
69
160
|
|
|
70
|
-
const handleUsernameChange = (text: string) => {
|
|
71
|
-
console.log('📝 Username input changed:', text);
|
|
72
|
-
setUsername(text);
|
|
73
|
-
if (errorMessage) setErrorMessage('');
|
|
74
|
-
};
|
|
75
161
|
|
|
76
|
-
const
|
|
77
|
-
|
|
162
|
+
const accountsForDisplay = useMemo(() => {
|
|
163
|
+
const sessionMap = new Map(sessions?.map(s => [s.sessionId, s]) || []);
|
|
164
|
+
return quickAccounts.map(account => {
|
|
165
|
+
const session = sessionMap.get(account.sessionId);
|
|
166
|
+
const isCurrent = session?.isCurrent === true || account.sessionId === activeSessionId;
|
|
167
|
+
return {
|
|
168
|
+
...account,
|
|
169
|
+
isCurrent,
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
}, [quickAccounts, sessions, activeSessionId]);
|
|
78
173
|
|
|
174
|
+
const handleUsernameChange = useCallback((text: string) => {
|
|
175
|
+
const filteredText = text.replace(/[^a-zA-Z0-9]/g, '');
|
|
176
|
+
setUsername(filteredText);
|
|
177
|
+
if (errorMessage) setErrorMessage('');
|
|
178
|
+
}, [setUsername, setErrorMessage, errorMessage]);
|
|
179
|
+
|
|
180
|
+
const handleContinue = useCallback(async () => {
|
|
79
181
|
const trimmedUsername = username?.trim() || '';
|
|
80
182
|
|
|
81
183
|
if (!trimmedUsername) {
|
|
82
|
-
|
|
83
|
-
setErrorMessage('Please enter your username.');
|
|
184
|
+
setErrorMessage(t('signin.username.required') || 'Please enter your username.');
|
|
84
185
|
setTimeout(() => inputRef.current?.focus(), 0);
|
|
85
186
|
return;
|
|
86
187
|
}
|
|
87
188
|
|
|
88
|
-
if (trimmedUsername.length <
|
|
89
|
-
|
|
90
|
-
setErrorMessage('Username must be at least 3 characters.');
|
|
189
|
+
if (trimmedUsername.length < 3) {
|
|
190
|
+
setErrorMessage(t('signin.username.minLength') || 'Username must be at least 3 characters.');
|
|
91
191
|
return;
|
|
92
192
|
}
|
|
93
193
|
|
|
94
|
-
console.log('🔍 Starting username validation...');
|
|
95
194
|
try {
|
|
96
|
-
// Validate the username before proceeding
|
|
97
195
|
const isValid = await validateUsername(trimmedUsername);
|
|
98
|
-
console.log('📊 Validation result:', isValid);
|
|
99
|
-
|
|
100
196
|
if (isValid) {
|
|
101
|
-
console.log('✅ Validation passed, proceeding to next step');
|
|
102
197
|
nextStep();
|
|
103
|
-
} else {
|
|
104
|
-
console.log('❌ Validation failed, staying on current step');
|
|
105
198
|
}
|
|
106
199
|
} catch (error) {
|
|
107
|
-
console.error('
|
|
200
|
+
if (__DEV__) console.error('Error during username validation:', error);
|
|
108
201
|
setErrorMessage('Unable to validate username. Please try again.');
|
|
109
202
|
}
|
|
110
|
-
};
|
|
203
|
+
}, [username, validateUsername, nextStep, setErrorMessage, t]);
|
|
111
204
|
|
|
112
205
|
return (
|
|
113
206
|
<>
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
{
|
|
207
|
+
<View style={[baseStyles.container, baseStyles.sectionSpacing, { alignItems: 'flex-start', position: 'relative' }]}>
|
|
208
|
+
<HighFive width={100} height={100} />
|
|
209
|
+
<TouchableOpacity
|
|
210
|
+
style={[stylesheet.languageButton, { backgroundColor: colors.inputBackground }]}
|
|
211
|
+
onPress={() => navigate('LanguageSelector')}
|
|
212
|
+
activeOpacity={0.7}
|
|
213
|
+
>
|
|
214
|
+
<Ionicons name="globe-outline" size={20} color={colors.primary} />
|
|
215
|
+
</TouchableOpacity>
|
|
216
|
+
</View>
|
|
217
|
+
<View style={[baseStyles.container, baseStyles.sectionSpacing, baseStyles.header]}>
|
|
218
|
+
<Text style={[styles.modernTitle, baseStyles.title, { color: colors.text, marginBottom: 0, marginTop: 0 }]}>
|
|
219
|
+
{t('signin.title')}
|
|
118
220
|
</Text>
|
|
119
|
-
<Text style={[styles.modernSubtitle, { color: colors.secondaryText }]}>
|
|
120
|
-
{
|
|
221
|
+
<Text style={[styles.modernSubtitle, baseStyles.subtitle, { color: colors.secondaryText, marginBottom: 0, marginTop: 0 }]}>
|
|
222
|
+
{t('signin.subtitle')}
|
|
121
223
|
</Text>
|
|
122
224
|
</View>
|
|
123
225
|
|
|
124
|
-
{
|
|
125
|
-
<View style={[styles.modernInfoCard, { backgroundColor: colors.inputBackground }]}>
|
|
126
|
-
<Ionicons name="information-circle" size={20} color={colors.primary} />
|
|
127
|
-
<Text style={[styles.modernInfoText, { color: colors.text }]}>
|
|
128
|
-
{t('signin.currentlySignedInAs', { username: user.username }) || 'Currently signed in as '}
|
|
129
|
-
<Text style={{ fontWeight: 'bold' }}>{user.username}</Text>
|
|
130
|
-
</Text>
|
|
131
|
-
</View>
|
|
132
|
-
)}
|
|
133
|
-
|
|
134
|
-
<View style={styles.modernInputContainer}>
|
|
226
|
+
<View style={[baseStyles.container, baseStyles.sectionSpacing]}>
|
|
135
227
|
<TextField
|
|
136
228
|
ref={inputRef}
|
|
137
229
|
label={t('common.labels.username')}
|
|
138
230
|
leading={<Ionicons name="person-outline" size={24} color={colors.secondaryText} />}
|
|
139
231
|
value={username}
|
|
140
232
|
onChangeText={handleUsernameChange}
|
|
233
|
+
formatValue={(text) => text.replace(/[^a-zA-Z0-9]/g, '')}
|
|
234
|
+
maxLength={30}
|
|
141
235
|
autoCapitalize="none"
|
|
142
236
|
autoCorrect={false}
|
|
143
237
|
testID="username-input"
|
|
@@ -145,33 +239,322 @@ const SignInUsernameStep: React.FC<SignInUsernameStepProps> = ({
|
|
|
145
239
|
error={validationStatus === 'invalid' ? errorMessage : undefined}
|
|
146
240
|
loading={validationStatus === 'validating'}
|
|
147
241
|
success={validationStatus === 'valid'}
|
|
242
|
+
helperText={t('signin.username.helper') || '3-30 characters, letters and numbers only'}
|
|
148
243
|
onSubmitEditing={() => handleContinue()}
|
|
149
244
|
autoFocus
|
|
245
|
+
accessibilityLabel={t('common.labels.username')}
|
|
246
|
+
accessibilityHint={t('signin.username.helper') || 'Enter your username, 3-30 characters, letters and numbers only'}
|
|
247
|
+
style={{ marginBottom: 0 }}
|
|
150
248
|
/>
|
|
151
249
|
</View>
|
|
152
250
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
251
|
+
{accountsForDisplay.length > 0 && (
|
|
252
|
+
<View style={[baseStyles.container, baseStyles.sectionSpacing, stylesheet.dividerContainer]}>
|
|
253
|
+
<View style={[stylesheet.dividerLine, { backgroundColor: colors.border }]} />
|
|
254
|
+
<Text style={[stylesheet.dividerText, { color: colors.secondaryText }]}>
|
|
255
|
+
{t('signin.or') || 'or'}
|
|
256
|
+
</Text>
|
|
257
|
+
<View style={[stylesheet.dividerLine, { backgroundColor: colors.border }]} />
|
|
258
|
+
</View>
|
|
259
|
+
)}
|
|
260
|
+
|
|
261
|
+
{accountsForDisplay.length > 0 ? (
|
|
262
|
+
<View style={[baseStyles.container, baseStyles.sectionSpacing]}>
|
|
263
|
+
<TouchableOpacity
|
|
264
|
+
style={[
|
|
265
|
+
stylesheet.toggleButton,
|
|
266
|
+
{
|
|
267
|
+
backgroundColor: colors.inputBackground,
|
|
268
|
+
},
|
|
269
|
+
]}
|
|
270
|
+
onPress={() => setShowAccounts(!showAccounts)}
|
|
271
|
+
activeOpacity={0.7}
|
|
272
|
+
>
|
|
273
|
+
<View style={stylesheet.toggleButtonContent}>
|
|
274
|
+
<Ionicons
|
|
275
|
+
name={showAccounts ? 'chevron-down' : 'chevron-forward'}
|
|
276
|
+
size={18}
|
|
277
|
+
color={colors.primary}
|
|
278
|
+
/>
|
|
279
|
+
<Text style={[stylesheet.toggleButtonText, { color: colors.text }]}>
|
|
280
|
+
{t('signin.alreadySignedInWith') || 'Already signed in with'}
|
|
281
|
+
</Text>
|
|
282
|
+
{accountsForDisplay.length > 0 && (
|
|
283
|
+
<View style={stylesheet.avatarsContainer}>
|
|
284
|
+
{accountsForDisplay.slice(0, 5).map((account, index) => (
|
|
285
|
+
<View
|
|
286
|
+
key={`avatar-${account.sessionId}`}
|
|
287
|
+
style={[
|
|
288
|
+
stylesheet.avatarWrapper,
|
|
289
|
+
account.isCurrent && stylesheet.currentAvatarWrapper,
|
|
290
|
+
index > 0 && { marginLeft: -12 },
|
|
291
|
+
{ zIndex: Math.min(accountsForDisplay.length, 5) - index },
|
|
292
|
+
{ borderColor: colors.inputBackground || colors.background || '#FFFFFF' },
|
|
293
|
+
]}
|
|
294
|
+
>
|
|
295
|
+
<Avatar
|
|
296
|
+
name={account.displayName}
|
|
297
|
+
size={28}
|
|
298
|
+
theme={themeMode}
|
|
299
|
+
backgroundColor={colors.primary}
|
|
300
|
+
uri={account.avatarUrl}
|
|
301
|
+
/>
|
|
302
|
+
</View>
|
|
303
|
+
))}
|
|
304
|
+
</View>
|
|
305
|
+
)}
|
|
306
|
+
{!showAccounts && accountsForDisplay.length === 0 && quickAccounts.length > 0 && (
|
|
307
|
+
<View style={[stylesheet.accountCountBadge, { backgroundColor: `${colors.primary}15` }]}>
|
|
308
|
+
<Text style={[stylesheet.accountCountText, { color: colors.primary }]}>
|
|
309
|
+
{quickAccounts.length}
|
|
310
|
+
</Text>
|
|
311
|
+
</View>
|
|
312
|
+
)}
|
|
313
|
+
</View>
|
|
314
|
+
</TouchableOpacity>
|
|
315
|
+
|
|
316
|
+
{showAccounts && (
|
|
317
|
+
<View style={stylesheet.accountsList}>
|
|
318
|
+
{loadingAccounts && accountsForDisplay.length === 0 ? (
|
|
319
|
+
<View style={stylesheet.accountItem}>
|
|
320
|
+
<ActivityIndicator color={colors.primary} size="small" />
|
|
321
|
+
</View>
|
|
322
|
+
) : (
|
|
323
|
+
<>
|
|
324
|
+
{accountsForDisplay.map((account) => (
|
|
325
|
+
<TouchableOpacity
|
|
326
|
+
key={`account-${account.sessionId}`}
|
|
327
|
+
style={[
|
|
328
|
+
stylesheet.accountItem,
|
|
329
|
+
{
|
|
330
|
+
backgroundColor: colors.inputBackground,
|
|
331
|
+
},
|
|
332
|
+
switchingSessionId === account.sessionId && stylesheet.accountItemLoading,
|
|
333
|
+
]}
|
|
334
|
+
onPress={() => handleSwitchAccount(account.sessionId)}
|
|
335
|
+
disabled={switchingSessionId === account.sessionId || account.isCurrent}
|
|
336
|
+
activeOpacity={0.7}
|
|
337
|
+
>
|
|
338
|
+
{switchingSessionId === account.sessionId ? (
|
|
339
|
+
<ActivityIndicator color={colors.primary} size="small" />
|
|
340
|
+
) : (
|
|
341
|
+
<>
|
|
342
|
+
<View style={[stylesheet.accountItemAvatarWrapper, { borderColor: colors.inputBackground || colors.background || '#FFFFFF' }]}>
|
|
343
|
+
<Avatar
|
|
344
|
+
name={account.displayName}
|
|
345
|
+
size={36}
|
|
346
|
+
theme={themeMode}
|
|
347
|
+
backgroundColor={colors.primary}
|
|
348
|
+
uri={account.avatarUrl}
|
|
349
|
+
/>
|
|
350
|
+
</View>
|
|
351
|
+
<View style={stylesheet.accountItemText}>
|
|
352
|
+
<Text
|
|
353
|
+
style={[stylesheet.accountItemName, { color: colors.text }]}
|
|
354
|
+
numberOfLines={1}
|
|
355
|
+
>
|
|
356
|
+
{account.displayName}
|
|
357
|
+
</Text>
|
|
358
|
+
{account.username && (
|
|
359
|
+
<Text
|
|
360
|
+
style={[
|
|
361
|
+
stylesheet.accountItemUsername,
|
|
362
|
+
{ color: colors.secondaryText },
|
|
363
|
+
]}
|
|
364
|
+
numberOfLines={1}
|
|
365
|
+
>
|
|
366
|
+
@{account.username}
|
|
367
|
+
</Text>
|
|
368
|
+
)}
|
|
369
|
+
</View>
|
|
370
|
+
{account.isCurrent ? (
|
|
371
|
+
<View style={[stylesheet.currentAccountBadgeContainer, { backgroundColor: `${colors.primary}20` }]}>
|
|
372
|
+
<Text style={[stylesheet.currentAccountBadge, { color: colors.primary }]}>
|
|
373
|
+
{t('signin.currentAccount') || 'Current'}
|
|
374
|
+
</Text>
|
|
375
|
+
</View>
|
|
376
|
+
) : null}
|
|
377
|
+
</>
|
|
378
|
+
)}
|
|
379
|
+
</TouchableOpacity>
|
|
380
|
+
))}
|
|
381
|
+
{sessions && sessions.length > MAX_QUICK_ACCOUNTS && (
|
|
382
|
+
<TouchableOpacity
|
|
383
|
+
style={[
|
|
384
|
+
stylesheet.accountItem,
|
|
385
|
+
stylesheet.viewAllItem,
|
|
386
|
+
{
|
|
387
|
+
backgroundColor: colors.inputBackground,
|
|
388
|
+
},
|
|
389
|
+
]}
|
|
390
|
+
onPress={() => navigate('AccountSwitcher')}
|
|
391
|
+
activeOpacity={0.7}
|
|
392
|
+
>
|
|
393
|
+
<Ionicons name="chevron-forward" size={18} color={colors.primary} />
|
|
394
|
+
<Text style={[stylesheet.viewAllText, { color: colors.primary }]}>
|
|
395
|
+
{t('signin.viewAllAccounts', {
|
|
396
|
+
count: sessions.length - MAX_QUICK_ACCOUNTS,
|
|
397
|
+
}) || `View ${sessions.length - MAX_QUICK_ACCOUNTS} more`}
|
|
398
|
+
</Text>
|
|
399
|
+
</TouchableOpacity>
|
|
400
|
+
)}
|
|
401
|
+
</>
|
|
402
|
+
)}
|
|
403
|
+
</View>
|
|
404
|
+
)}
|
|
405
|
+
</View>
|
|
406
|
+
) : null}
|
|
407
|
+
|
|
408
|
+
<View style={[baseStyles.container, baseStyles.sectionSpacing, baseStyles.buttonContainer]}>
|
|
409
|
+
<GroupedPillButtons
|
|
410
|
+
buttons={[
|
|
411
|
+
{
|
|
412
|
+
text: t('common.links.signUp'),
|
|
413
|
+
onPress: () => navigate('SignUp'),
|
|
414
|
+
icon: 'person-add',
|
|
415
|
+
variant: 'transparent',
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
text: t('common.actions.continue'),
|
|
419
|
+
onPress: handleContinue,
|
|
420
|
+
icon: 'arrow-forward',
|
|
421
|
+
variant: 'primary',
|
|
422
|
+
loading: isValidating,
|
|
423
|
+
disabled: !username || username.trim().length < 3 || isValidating,
|
|
424
|
+
testID: 'username-next-button',
|
|
425
|
+
},
|
|
426
|
+
]}
|
|
427
|
+
colors={colors}
|
|
428
|
+
/>
|
|
429
|
+
</View>
|
|
173
430
|
</>
|
|
174
431
|
);
|
|
175
432
|
};
|
|
176
433
|
|
|
177
434
|
export default SignInUsernameStep;
|
|
435
|
+
|
|
436
|
+
const stylesheet = StyleSheet.create({
|
|
437
|
+
toggleButton: {
|
|
438
|
+
borderRadius: 24,
|
|
439
|
+
borderWidth: 0,
|
|
440
|
+
},
|
|
441
|
+
toggleButtonContent: {
|
|
442
|
+
flexDirection: 'row',
|
|
443
|
+
alignItems: 'center',
|
|
444
|
+
paddingHorizontal: 12,
|
|
445
|
+
paddingVertical: 10,
|
|
446
|
+
minHeight: 48,
|
|
447
|
+
gap: 10,
|
|
448
|
+
},
|
|
449
|
+
toggleButtonText: {
|
|
450
|
+
fontSize: 14,
|
|
451
|
+
fontWeight: '500',
|
|
452
|
+
},
|
|
453
|
+
accountCountBadge: {
|
|
454
|
+
paddingHorizontal: 8,
|
|
455
|
+
paddingVertical: 3,
|
|
456
|
+
borderRadius: 16,
|
|
457
|
+
minWidth: 22,
|
|
458
|
+
alignItems: 'center',
|
|
459
|
+
},
|
|
460
|
+
accountCountText: {
|
|
461
|
+
fontSize: 11,
|
|
462
|
+
fontWeight: '600',
|
|
463
|
+
},
|
|
464
|
+
accountsList: {
|
|
465
|
+
gap: 6,
|
|
466
|
+
marginTop: 6,
|
|
467
|
+
},
|
|
468
|
+
accountItem: {
|
|
469
|
+
flexDirection: 'row',
|
|
470
|
+
alignItems: 'center',
|
|
471
|
+
paddingHorizontal: 12,
|
|
472
|
+
paddingVertical: 10,
|
|
473
|
+
borderRadius: 24,
|
|
474
|
+
borderWidth: 0,
|
|
475
|
+
gap: 12,
|
|
476
|
+
minHeight: 56,
|
|
477
|
+
justifyContent: 'space-between',
|
|
478
|
+
},
|
|
479
|
+
accountItemLoading: {
|
|
480
|
+
justifyContent: 'center',
|
|
481
|
+
paddingHorizontal: 16,
|
|
482
|
+
},
|
|
483
|
+
accountItemText: {
|
|
484
|
+
flex: 1,
|
|
485
|
+
},
|
|
486
|
+
accountItemName: {
|
|
487
|
+
fontSize: 15,
|
|
488
|
+
fontWeight: '500',
|
|
489
|
+
marginBottom: 2,
|
|
490
|
+
},
|
|
491
|
+
accountItemUsername: {
|
|
492
|
+
fontSize: 12,
|
|
493
|
+
},
|
|
494
|
+
viewAllItem: {
|
|
495
|
+
justifyContent: 'center',
|
|
496
|
+
paddingVertical: 10,
|
|
497
|
+
},
|
|
498
|
+
viewAllText: {
|
|
499
|
+
fontSize: 14,
|
|
500
|
+
fontWeight: '500',
|
|
501
|
+
marginLeft: 4,
|
|
502
|
+
},
|
|
503
|
+
currentAccountBadgeContainer: {
|
|
504
|
+
paddingHorizontal: 12,
|
|
505
|
+
paddingVertical: 5,
|
|
506
|
+
borderRadius: 12,
|
|
507
|
+
marginLeft: 'auto',
|
|
508
|
+
minWidth: 60,
|
|
509
|
+
alignItems: 'center',
|
|
510
|
+
justifyContent: 'center',
|
|
511
|
+
},
|
|
512
|
+
currentAccountBadge: {
|
|
513
|
+
fontSize: 11,
|
|
514
|
+
fontFamily: fontFamilies.phuduExtraBold,
|
|
515
|
+
letterSpacing: 0.5,
|
|
516
|
+
textTransform: 'uppercase',
|
|
517
|
+
},
|
|
518
|
+
dividerContainer: {
|
|
519
|
+
flexDirection: 'row',
|
|
520
|
+
alignItems: 'center',
|
|
521
|
+
marginVertical: 8,
|
|
522
|
+
},
|
|
523
|
+
dividerLine: {
|
|
524
|
+
flex: 1,
|
|
525
|
+
height: 1,
|
|
526
|
+
},
|
|
527
|
+
dividerText: {
|
|
528
|
+
fontSize: 14,
|
|
529
|
+
fontWeight: '500',
|
|
530
|
+
paddingHorizontal: 16,
|
|
531
|
+
textTransform: 'lowercase',
|
|
532
|
+
},
|
|
533
|
+
avatarsContainer: {
|
|
534
|
+
flexDirection: 'row',
|
|
535
|
+
alignItems: 'center',
|
|
536
|
+
marginLeft: 'auto',
|
|
537
|
+
},
|
|
538
|
+
avatarWrapper: {
|
|
539
|
+
position: 'relative',
|
|
540
|
+
borderRadius: 20,
|
|
541
|
+
borderWidth: 3,
|
|
542
|
+
},
|
|
543
|
+
currentAvatarWrapper: {
|
|
544
|
+
borderWidth: 3,
|
|
545
|
+
},
|
|
546
|
+
accountItemAvatarWrapper: {
|
|
547
|
+
borderRadius: 20,
|
|
548
|
+
borderWidth: 3,
|
|
549
|
+
},
|
|
550
|
+
languageButton: {
|
|
551
|
+
position: 'absolute',
|
|
552
|
+
top: 0,
|
|
553
|
+
right: 0,
|
|
554
|
+
width: 40,
|
|
555
|
+
height: 40,
|
|
556
|
+
borderRadius: 20,
|
|
557
|
+
alignItems: 'center',
|
|
558
|
+
justifyContent: 'center',
|
|
559
|
+
},
|
|
560
|
+
});
|