@oxyhq/services 5.21.7 → 5.22.0
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 +201 -2
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/core/HttpService.js +87 -2
- package/lib/commonjs/core/HttpService.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.assets.js +3 -1
- package/lib/commonjs/core/mixins/OxyServices.assets.js.map +1 -1
- package/lib/commonjs/i18n/locales/en-US.json +3 -3
- package/lib/commonjs/i18n/locales/es-ES.json +240 -19
- package/lib/commonjs/ui/components/Avatar.js +1 -1
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +1 -1
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FontLoader.js +34 -34
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +4 -4
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +2 -1
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +2 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js +2 -1
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/styles.js +17 -17
- package/lib/commonjs/ui/components/fileManagement/styles.js.map +1 -1
- package/lib/commonjs/ui/components/payment/paymentStyles.js +7 -7
- package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +2 -0
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +4 -2
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +13 -5
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +273 -1820
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +3 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +2 -2
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +640 -0
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FileManagementScreen.js +39 -21
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +9 -3
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +4 -2
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +3 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +11 -12
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +12 -4
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +3 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +15 -5
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +3 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +2 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +2 -4
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +3 -3
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +3 -3
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +5 -4
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/ui/styles/fonts.js +27 -27
- package/lib/commonjs/ui/styles/fonts.js.map +1 -1
- package/lib/commonjs/ui/styles/theme.js +3 -3
- package/lib/commonjs/ui/styles/theme.js.map +1 -1
- package/lib/commonjs/web.js +682 -0
- package/lib/commonjs/web.js.map +1 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/core/HttpService.js +87 -2
- package/lib/module/core/HttpService.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.assets.js +3 -1
- package/lib/module/core/mixins/OxyServices.assets.js.map +1 -1
- package/lib/module/i18n/locales/en-US.json +3 -3
- package/lib/module/i18n/locales/es-ES.json +240 -19
- package/lib/module/ui/components/Avatar.js +1 -1
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +1 -1
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FontLoader.js +34 -34
- package/lib/module/ui/components/FontLoader.js.map +1 -1
- package/lib/module/ui/components/Header.js +4 -4
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +1 -1
- package/lib/module/ui/components/OxyPayButton.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +2 -1
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +1 -1
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js +1 -1
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +2 -1
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/feedback/feedbackStyles.js +2 -1
- package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -1
- package/lib/module/ui/components/fileManagement/styles.js +17 -17
- package/lib/module/ui/components/fileManagement/styles.js.map +1 -1
- package/lib/module/ui/components/payment/paymentStyles.js +7 -7
- package/lib/module/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +2 -0
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +4 -2
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +13 -5
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +277 -1824
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +3 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +2 -2
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +635 -0
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -0
- package/lib/module/ui/screens/FileManagementScreen.js +39 -21
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +9 -3
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +4 -2
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +3 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +11 -12
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +12 -4
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +3 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +15 -5
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +3 -1
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +2 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +2 -4
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +3 -3
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +3 -3
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +5 -4
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/styles/fonts.js +27 -27
- package/lib/module/ui/styles/fonts.js.map +1 -1
- package/lib/module/ui/styles/theme.js +3 -3
- package/lib/module/ui/styles/theme.js.map +1 -1
- package/lib/module/web.js +75 -0
- package/lib/module/web.js.map +1 -0
- package/lib/typescript/commonjs/core/HttpService.d.ts +5 -0
- package/lib/typescript/commonjs/core/HttpService.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/feedback/feedbackStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts +13 -0
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/styles/fonts.d.ts +7 -7
- package/lib/typescript/commonjs/ui/styles/theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/web.d.ts +54 -0
- package/lib/typescript/commonjs/web.d.ts.map +1 -0
- package/lib/typescript/module/core/HttpService.d.ts +5 -0
- package/lib/typescript/module/core/HttpService.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/feedback/feedbackStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts +13 -0
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/styles/fonts.d.ts +7 -7
- package/lib/typescript/module/ui/styles/theme.d.ts.map +1 -1
- package/lib/typescript/module/web.d.ts +54 -0
- package/lib/typescript/module/web.d.ts.map +1 -0
- package/package.json +27 -41
- package/src/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/src/core/HttpService.ts +91 -0
- package/src/core/mixins/OxyServices.assets.ts +1 -1
- package/src/i18n/locales/en-US.json +3 -3
- package/src/i18n/locales/es-ES.json +240 -19
- package/src/ui/components/Avatar.tsx +1 -1
- package/src/ui/components/FollowButton.tsx +1 -1
- package/src/ui/components/FontLoader.tsx +34 -34
- package/src/ui/components/Header.tsx +4 -4
- package/src/ui/components/OxyPayButton.tsx +1 -1
- package/src/ui/components/OxySignInButton.tsx +2 -1
- package/src/ui/components/ProfileCard.tsx +1 -1
- package/src/ui/components/SectionTitle.tsx +1 -1
- package/src/ui/components/StepBasedScreen.tsx +2 -1
- package/src/ui/components/feedback/feedbackStyles.ts +2 -1
- package/src/ui/components/fileManagement/styles.ts +17 -17
- package/src/ui/components/payment/paymentStyles.ts +7 -7
- package/src/ui/navigation/routes.ts +3 -0
- package/src/ui/screens/AccountCenterScreen.tsx +4 -2
- package/src/ui/screens/AccountOverviewScreen.tsx +13 -5
- package/src/ui/screens/AccountSettingsScreen.tsx +35 -1511
- package/src/ui/screens/AccountSwitcherScreen.tsx +1 -1
- package/src/ui/screens/AccountVerificationScreen.tsx +3 -1
- package/src/ui/screens/AppInfoScreen.tsx +2 -2
- package/src/ui/screens/EditProfileFieldScreen.tsx +685 -0
- package/src/ui/screens/FileManagementScreen.tsx +33 -15
- package/src/ui/screens/HistoryViewScreen.tsx +9 -3
- package/src/ui/screens/LanguageSelectorScreen.tsx +4 -2
- package/src/ui/screens/LegalDocumentsScreen.tsx +3 -1
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +11 -13
- package/src/ui/screens/PrivacySettingsScreen.tsx +12 -4
- package/src/ui/screens/SearchSettingsScreen.tsx +3 -1
- package/src/ui/screens/SessionManagementScreen.tsx +15 -5
- package/src/ui/screens/UserLinksScreen.tsx +3 -1
- package/src/ui/screens/WelcomeNewUserScreen.tsx +2 -1
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +6 -8
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +3 -3
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +3 -3
- package/src/ui/styles/authStyles.ts +4 -4
- package/src/ui/styles/fonts.ts +26 -26
- package/src/ui/styles/theme.ts +3 -5
- package/src/web.ts +230 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/commonjs/ui/components/profile/EditBioModal.js +0 -49
- package/lib/commonjs/ui/components/profile/EditBioModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js +0 -54
- package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditEmailModal.js +0 -57
- package/lib/commonjs/ui/components/profile/EditEmailModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditFieldModal.js +0 -412
- package/lib/commonjs/ui/components/profile/EditFieldModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditLinksModal.js +0 -315
- package/lib/commonjs/ui/components/profile/EditLinksModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditLocationModal.js +0 -91
- package/lib/commonjs/ui/components/profile/EditLocationModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditUsernameModal.js +0 -55
- package/lib/commonjs/ui/components/profile/EditUsernameModal.js.map +0 -1
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/module/ui/components/profile/EditBioModal.js +0 -43
- package/lib/module/ui/components/profile/EditBioModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditDisplayNameModal.js +0 -48
- package/lib/module/ui/components/profile/EditDisplayNameModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditEmailModal.js +0 -51
- package/lib/module/ui/components/profile/EditEmailModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditFieldModal.js +0 -406
- package/lib/module/ui/components/profile/EditFieldModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditLinksModal.js +0 -309
- package/lib/module/ui/components/profile/EditLinksModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditLocationModal.js +0 -85
- package/lib/module/ui/components/profile/EditLocationModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditUsernameModal.js +0 -49
- package/lib/module/ui/components/profile/EditUsernameModal.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditBioModal.d.ts +0 -11
- package/lib/typescript/commonjs/ui/components/profile/EditBioModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditDisplayNameModal.d.ts +0 -12
- package/lib/typescript/commonjs/ui/components/profile/EditDisplayNameModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditEmailModal.d.ts +0 -11
- package/lib/typescript/commonjs/ui/components/profile/EditEmailModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditFieldModal.d.ts +0 -110
- package/lib/typescript/commonjs/ui/components/profile/EditFieldModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditLinksModal.d.ts +0 -18
- package/lib/typescript/commonjs/ui/components/profile/EditLinksModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditLocationModal.d.ts +0 -21
- package/lib/typescript/commonjs/ui/components/profile/EditLocationModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditUsernameModal.d.ts +0 -11
- package/lib/typescript/commonjs/ui/components/profile/EditUsernameModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditBioModal.d.ts +0 -11
- package/lib/typescript/module/ui/components/profile/EditBioModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditDisplayNameModal.d.ts +0 -12
- package/lib/typescript/module/ui/components/profile/EditDisplayNameModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditEmailModal.d.ts +0 -11
- package/lib/typescript/module/ui/components/profile/EditEmailModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditFieldModal.d.ts +0 -110
- package/lib/typescript/module/ui/components/profile/EditFieldModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditLinksModal.d.ts +0 -18
- package/lib/typescript/module/ui/components/profile/EditLinksModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditLocationModal.d.ts +0 -21
- package/lib/typescript/module/ui/components/profile/EditLocationModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditUsernameModal.d.ts +0 -11
- package/lib/typescript/module/ui/components/profile/EditUsernameModal.d.ts.map +0 -1
- package/src/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/src/ui/components/profile/EditBioModal.tsx +0 -46
- package/src/ui/components/profile/EditDisplayNameModal.tsx +0 -56
- package/src/ui/components/profile/EditEmailModal.tsx +0 -57
- package/src/ui/components/profile/EditFieldModal.tsx +0 -465
- package/src/ui/components/profile/EditLinksModal.tsx +0 -316
- package/src/ui/components/profile/EditLocationModal.tsx +0 -91
- package/src/ui/components/profile/EditUsernameModal.tsx +0 -55
|
@@ -0,0 +1,640 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _vectorIcons = require("@expo/vector-icons");
|
|
10
|
+
var _useThemeStyles = require("../hooks/useThemeStyles.js");
|
|
11
|
+
var _useColorScheme = require("../hooks/use-color-scheme.js");
|
|
12
|
+
var _themeUtils = require("../utils/themeUtils.js");
|
|
13
|
+
var _index = require("../components/index.js");
|
|
14
|
+
var _useI18n = require("../hooks/useI18n.js");
|
|
15
|
+
var _OxyContext = require("../context/OxyContext.js");
|
|
16
|
+
var _useProfileEditing = require("../hooks/useProfileEditing.js");
|
|
17
|
+
var _fonts = require("../styles/fonts.js");
|
|
18
|
+
var _sonner = require("../../lib/sonner.js");
|
|
19
|
+
var _validationUtils = require("../../utils/validationUtils.js");
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
22
|
+
/**
|
|
23
|
+
* Field types supported by EditProfileFieldScreen
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Field configuration for each field type
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* EditProfileFieldScreen - A dedicated screen for editing profile fields
|
|
32
|
+
*
|
|
33
|
+
* Navigate to this screen with a fieldType prop to edit that specific field.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* navigate('EditProfileField', { fieldType: 'username' })
|
|
37
|
+
*/
|
|
38
|
+
const EditProfileFieldScreen = ({
|
|
39
|
+
goBack,
|
|
40
|
+
onClose,
|
|
41
|
+
theme,
|
|
42
|
+
fieldType = 'displayName'
|
|
43
|
+
}) => {
|
|
44
|
+
const {
|
|
45
|
+
user
|
|
46
|
+
} = (0, _OxyContext.useOxy)();
|
|
47
|
+
const {
|
|
48
|
+
t
|
|
49
|
+
} = (0, _useI18n.useI18n)();
|
|
50
|
+
const {
|
|
51
|
+
saveProfile,
|
|
52
|
+
updateField,
|
|
53
|
+
isSaving
|
|
54
|
+
} = (0, _useProfileEditing.useProfileEditing)();
|
|
55
|
+
const colorScheme = (0, _useColorScheme.useColorScheme)();
|
|
56
|
+
const normalizedTheme = (0, _themeUtils.normalizeTheme)(theme);
|
|
57
|
+
const themeStyles = (0, _useThemeStyles.useThemeStyles)(normalizedTheme, colorScheme);
|
|
58
|
+
const colors = themeStyles.colors;
|
|
59
|
+
|
|
60
|
+
// State for field values
|
|
61
|
+
const [fieldValues, setFieldValues] = (0, _react.useState)({});
|
|
62
|
+
const [fieldErrors, setFieldErrors] = (0, _react.useState)({});
|
|
63
|
+
|
|
64
|
+
// State for list fields (locations, links)
|
|
65
|
+
const [listItems, setListItems] = (0, _react.useState)([]);
|
|
66
|
+
const [newItemValue, setNewItemValue] = (0, _react.useState)('');
|
|
67
|
+
|
|
68
|
+
// Get field configuration based on fieldType
|
|
69
|
+
const fieldConfig = (0, _react.useMemo)(() => {
|
|
70
|
+
switch (fieldType) {
|
|
71
|
+
case 'displayName':
|
|
72
|
+
return {
|
|
73
|
+
title: t('editProfile.items.displayName.title') || 'Display Name',
|
|
74
|
+
subtitle: t('editProfile.items.displayName.subtitle') || 'This is how your name will appear to others',
|
|
75
|
+
fields: [{
|
|
76
|
+
key: 'displayName',
|
|
77
|
+
label: t('editProfile.items.displayName.firstName') || 'First Name',
|
|
78
|
+
placeholder: t('editProfile.items.displayName.firstNamePlaceholder') || 'Enter first name'
|
|
79
|
+
}, {
|
|
80
|
+
key: 'lastName',
|
|
81
|
+
label: t('editProfile.items.displayName.lastName') || 'Last Name',
|
|
82
|
+
placeholder: t('editProfile.items.displayName.lastNamePlaceholder') || 'Enter last name (optional)'
|
|
83
|
+
}]
|
|
84
|
+
};
|
|
85
|
+
case 'username':
|
|
86
|
+
return {
|
|
87
|
+
title: t('editProfile.items.username.title') || 'Username',
|
|
88
|
+
subtitle: t('editProfile.items.username.subtitle') || 'Your unique identifier on the platform',
|
|
89
|
+
fields: [{
|
|
90
|
+
key: 'username',
|
|
91
|
+
label: t('editProfile.items.username.label') || 'Username',
|
|
92
|
+
placeholder: t('editProfile.items.username.placeholder') || 'Choose a username',
|
|
93
|
+
validation: value => {
|
|
94
|
+
if (!value.trim()) {
|
|
95
|
+
return t('editProfile.items.username.required') || 'Username is required';
|
|
96
|
+
}
|
|
97
|
+
if (value.length < 3) {
|
|
98
|
+
return t('editProfile.items.username.tooShort') || 'Username must be at least 3 characters';
|
|
99
|
+
}
|
|
100
|
+
return undefined;
|
|
101
|
+
},
|
|
102
|
+
inputProps: {
|
|
103
|
+
autoCapitalize: 'none',
|
|
104
|
+
autoCorrect: false
|
|
105
|
+
}
|
|
106
|
+
}]
|
|
107
|
+
};
|
|
108
|
+
case 'email':
|
|
109
|
+
return {
|
|
110
|
+
title: t('editProfile.items.email.title') || 'Email',
|
|
111
|
+
subtitle: t('editProfile.items.email.subtitle') || 'Your primary email address',
|
|
112
|
+
fields: [{
|
|
113
|
+
key: 'email',
|
|
114
|
+
label: t('editProfile.items.email.label') || 'Email Address',
|
|
115
|
+
placeholder: t('editProfile.items.email.placeholder') || 'Enter your email address',
|
|
116
|
+
type: 'email',
|
|
117
|
+
validation: value => {
|
|
118
|
+
if (!_validationUtils.EMAIL_REGEX.test(value)) {
|
|
119
|
+
return t('editProfile.items.email.invalid') || 'Please enter a valid email address';
|
|
120
|
+
}
|
|
121
|
+
return undefined;
|
|
122
|
+
},
|
|
123
|
+
inputProps: {
|
|
124
|
+
keyboardType: 'email-address',
|
|
125
|
+
autoCapitalize: 'none',
|
|
126
|
+
autoCorrect: false
|
|
127
|
+
}
|
|
128
|
+
}]
|
|
129
|
+
};
|
|
130
|
+
case 'bio':
|
|
131
|
+
return {
|
|
132
|
+
title: t('editProfile.items.bio.title') || 'Bio',
|
|
133
|
+
subtitle: t('editProfile.items.bio.subtitle') || 'Tell people a bit about yourself',
|
|
134
|
+
fields: [{
|
|
135
|
+
key: 'bio',
|
|
136
|
+
label: t('editProfile.items.bio.label') || 'Bio',
|
|
137
|
+
placeholder: t('editProfile.items.bio.placeholder') || 'Tell people about yourself...',
|
|
138
|
+
type: 'textarea',
|
|
139
|
+
inputProps: {
|
|
140
|
+
multiline: true,
|
|
141
|
+
numberOfLines: 6,
|
|
142
|
+
textAlignVertical: 'top'
|
|
143
|
+
}
|
|
144
|
+
}]
|
|
145
|
+
};
|
|
146
|
+
case 'phone':
|
|
147
|
+
return {
|
|
148
|
+
title: t('editProfile.items.phone.title') || 'Phone Number',
|
|
149
|
+
subtitle: t('editProfile.items.phone.subtitle') || 'Your contact phone number',
|
|
150
|
+
fields: [{
|
|
151
|
+
key: 'phone',
|
|
152
|
+
label: t('editProfile.items.phone.label') || 'Phone Number',
|
|
153
|
+
placeholder: t('editProfile.items.phone.placeholder') || 'Enter your phone number',
|
|
154
|
+
inputProps: {
|
|
155
|
+
keyboardType: 'phone-pad',
|
|
156
|
+
autoCapitalize: 'none',
|
|
157
|
+
autoCorrect: false
|
|
158
|
+
}
|
|
159
|
+
}]
|
|
160
|
+
};
|
|
161
|
+
case 'address':
|
|
162
|
+
return {
|
|
163
|
+
title: t('editProfile.items.address.title') || 'Address',
|
|
164
|
+
subtitle: t('editProfile.items.address.subtitle') || 'Your physical address',
|
|
165
|
+
fields: [{
|
|
166
|
+
key: 'address',
|
|
167
|
+
label: t('editProfile.items.address.label') || 'Address',
|
|
168
|
+
placeholder: t('editProfile.items.address.placeholder') || 'Enter your address',
|
|
169
|
+
type: 'textarea',
|
|
170
|
+
inputProps: {
|
|
171
|
+
multiline: true,
|
|
172
|
+
numberOfLines: 3,
|
|
173
|
+
textAlignVertical: 'top'
|
|
174
|
+
}
|
|
175
|
+
}]
|
|
176
|
+
};
|
|
177
|
+
case 'birthday':
|
|
178
|
+
return {
|
|
179
|
+
title: t('editProfile.items.birthday.title') || 'Birthday',
|
|
180
|
+
subtitle: t('editProfile.items.birthday.subtitle') || 'Your date of birth',
|
|
181
|
+
fields: [{
|
|
182
|
+
key: 'birthday',
|
|
183
|
+
label: t('editProfile.items.birthday.label') || 'Birthday',
|
|
184
|
+
placeholder: t('editProfile.items.birthday.placeholder') || 'YYYY-MM-DD',
|
|
185
|
+
inputProps: {
|
|
186
|
+
autoCapitalize: 'none',
|
|
187
|
+
autoCorrect: false
|
|
188
|
+
}
|
|
189
|
+
}]
|
|
190
|
+
};
|
|
191
|
+
case 'locations':
|
|
192
|
+
return {
|
|
193
|
+
title: t('editProfile.items.locations.title') || 'Locations',
|
|
194
|
+
subtitle: t('editProfile.items.locations.subtitle') || 'Places you\'ve been or live',
|
|
195
|
+
fields: [],
|
|
196
|
+
isList: true
|
|
197
|
+
};
|
|
198
|
+
case 'links':
|
|
199
|
+
return {
|
|
200
|
+
title: t('editProfile.items.links.title') || 'Links',
|
|
201
|
+
subtitle: t('editProfile.items.links.subtitle') || 'Share your website, social profiles, etc.',
|
|
202
|
+
fields: [],
|
|
203
|
+
isList: true
|
|
204
|
+
};
|
|
205
|
+
default:
|
|
206
|
+
return {
|
|
207
|
+
title: 'Edit Field',
|
|
208
|
+
fields: []
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}, [fieldType, t]);
|
|
212
|
+
|
|
213
|
+
// Initialize field values from user data
|
|
214
|
+
(0, _react.useEffect)(() => {
|
|
215
|
+
if (!user) return;
|
|
216
|
+
|
|
217
|
+
// Cast user to any to access dynamic properties
|
|
218
|
+
const userData = user;
|
|
219
|
+
if (fieldConfig.isList) {
|
|
220
|
+
if (fieldType === 'locations') {
|
|
221
|
+
const locations = Array.isArray(userData.locations) ? userData.locations : [];
|
|
222
|
+
setListItems(locations.map((loc, i) => ({
|
|
223
|
+
id: loc.id || `location-${i}`,
|
|
224
|
+
name: loc.name || '',
|
|
225
|
+
...loc
|
|
226
|
+
})));
|
|
227
|
+
} else if (fieldType === 'links') {
|
|
228
|
+
const linksMetadata = Array.isArray(userData.linksMetadata) ? userData.linksMetadata : [];
|
|
229
|
+
const links = Array.isArray(userData.links) ? userData.links : [];
|
|
230
|
+
// Use linksMetadata if available, otherwise convert links array
|
|
231
|
+
if (linksMetadata.length > 0) {
|
|
232
|
+
setListItems(linksMetadata.map((link, i) => ({
|
|
233
|
+
id: link.id || `link-${i}`,
|
|
234
|
+
url: link.url || link.link || '',
|
|
235
|
+
title: link.title || '',
|
|
236
|
+
...link
|
|
237
|
+
})));
|
|
238
|
+
} else {
|
|
239
|
+
setListItems(links.map((item, i) => {
|
|
240
|
+
const url = typeof item === 'string' ? item : item.link || item.url || '';
|
|
241
|
+
return {
|
|
242
|
+
id: `link-${i}`,
|
|
243
|
+
url,
|
|
244
|
+
title: url.replace(/^https?:\/\//, '').replace(/\/$/, '')
|
|
245
|
+
};
|
|
246
|
+
}));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
const initialValues = {};
|
|
251
|
+
fieldConfig.fields.forEach(field => {
|
|
252
|
+
if (field.key === 'displayName') {
|
|
253
|
+
initialValues[field.key] = String(userData.displayName || userData.name?.first || '');
|
|
254
|
+
} else if (field.key === 'lastName') {
|
|
255
|
+
initialValues[field.key] = String(userData.lastName || userData.name?.last || '');
|
|
256
|
+
} else if (field.key === 'birthday') {
|
|
257
|
+
initialValues[field.key] = String(userData.birthday || userData.dateOfBirth || '');
|
|
258
|
+
} else if (field.key === 'address') {
|
|
259
|
+
initialValues[field.key] = String(userData.address || userData.location || '');
|
|
260
|
+
} else {
|
|
261
|
+
initialValues[field.key] = String(userData[field.key] || '');
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
setFieldValues(initialValues);
|
|
265
|
+
}
|
|
266
|
+
}, [user, fieldConfig, fieldType]);
|
|
267
|
+
|
|
268
|
+
// Field change handler
|
|
269
|
+
const handleFieldChange = (0, _react.useCallback)((key, value) => {
|
|
270
|
+
setFieldValues(prev => ({
|
|
271
|
+
...prev,
|
|
272
|
+
[key]: value
|
|
273
|
+
}));
|
|
274
|
+
if (fieldErrors[key]) {
|
|
275
|
+
setFieldErrors(prev => ({
|
|
276
|
+
...prev,
|
|
277
|
+
[key]: undefined
|
|
278
|
+
}));
|
|
279
|
+
}
|
|
280
|
+
}, [fieldErrors]);
|
|
281
|
+
|
|
282
|
+
// Validate all fields
|
|
283
|
+
const validateFields = (0, _react.useCallback)(() => {
|
|
284
|
+
const errors = {};
|
|
285
|
+
let isValid = true;
|
|
286
|
+
fieldConfig.fields.forEach(field => {
|
|
287
|
+
if (field.validation) {
|
|
288
|
+
const error = field.validation(fieldValues[field.key] || '');
|
|
289
|
+
if (error) {
|
|
290
|
+
errors[field.key] = error;
|
|
291
|
+
isValid = false;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
setFieldErrors(errors);
|
|
296
|
+
return isValid;
|
|
297
|
+
}, [fieldConfig.fields, fieldValues]);
|
|
298
|
+
|
|
299
|
+
// Add item to list
|
|
300
|
+
const handleAddItem = (0, _react.useCallback)(() => {
|
|
301
|
+
if (!newItemValue.trim()) return;
|
|
302
|
+
if (fieldType === 'locations') {
|
|
303
|
+
const newItem = {
|
|
304
|
+
id: `location-${Date.now()}`,
|
|
305
|
+
name: newItemValue.trim()
|
|
306
|
+
};
|
|
307
|
+
setListItems(prev => [...prev, newItem]);
|
|
308
|
+
} else if (fieldType === 'links') {
|
|
309
|
+
const newItem = {
|
|
310
|
+
id: `link-${Date.now()}`,
|
|
311
|
+
url: newItemValue.trim(),
|
|
312
|
+
title: newItemValue.replace(/^https?:\/\//, '').replace(/\/$/, '')
|
|
313
|
+
};
|
|
314
|
+
setListItems(prev => [...prev, newItem]);
|
|
315
|
+
}
|
|
316
|
+
setNewItemValue('');
|
|
317
|
+
}, [newItemValue, fieldType]);
|
|
318
|
+
|
|
319
|
+
// Remove item from list
|
|
320
|
+
const handleRemoveItem = (0, _react.useCallback)(id => {
|
|
321
|
+
setListItems(prev => prev.filter(item => item.id !== id));
|
|
322
|
+
}, []);
|
|
323
|
+
|
|
324
|
+
// Save handler
|
|
325
|
+
const handleSave = async () => {
|
|
326
|
+
if (fieldConfig.isList) {
|
|
327
|
+
let success = false;
|
|
328
|
+
if (fieldType === 'locations') {
|
|
329
|
+
success = await saveProfile({
|
|
330
|
+
locations: listItems
|
|
331
|
+
});
|
|
332
|
+
} else if (fieldType === 'links') {
|
|
333
|
+
success = await saveProfile({
|
|
334
|
+
linksMetadata: listItems,
|
|
335
|
+
links: listItems.map(item => item.url)
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
if (success) {
|
|
339
|
+
_sonner.toast.success(t('common.saved') || 'Saved successfully');
|
|
340
|
+
(onClose || goBack)?.();
|
|
341
|
+
}
|
|
342
|
+
} else {
|
|
343
|
+
if (!validateFields()) return;
|
|
344
|
+
let success = false;
|
|
345
|
+
if (fieldType === 'displayName') {
|
|
346
|
+
success = await saveProfile({
|
|
347
|
+
displayName: fieldValues.displayName,
|
|
348
|
+
lastName: fieldValues.lastName
|
|
349
|
+
});
|
|
350
|
+
} else {
|
|
351
|
+
const key = fieldConfig.fields[0]?.key;
|
|
352
|
+
if (key) {
|
|
353
|
+
success = await updateField(key, fieldValues[key]);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
if (success) {
|
|
357
|
+
_sonner.toast.success(t('common.saved') || 'Saved successfully');
|
|
358
|
+
(onClose || goBack)?.();
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
// Render a single field input
|
|
364
|
+
const renderField = (field, index) => {
|
|
365
|
+
const isTextarea = field.type === 'textarea';
|
|
366
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
367
|
+
style: styles.inputGroup,
|
|
368
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
369
|
+
style: [styles.label, {
|
|
370
|
+
color: colors.text
|
|
371
|
+
}],
|
|
372
|
+
children: field.label
|
|
373
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
374
|
+
style: [isTextarea ? styles.textArea : styles.input, {
|
|
375
|
+
backgroundColor: colors.card,
|
|
376
|
+
color: colors.text,
|
|
377
|
+
borderColor: fieldErrors[field.key] ? '#FF3B30' : colors.border
|
|
378
|
+
}],
|
|
379
|
+
value: fieldValues[field.key] || '',
|
|
380
|
+
onChangeText: value => handleFieldChange(field.key, value),
|
|
381
|
+
placeholder: field.placeholder,
|
|
382
|
+
placeholderTextColor: colors.secondaryText,
|
|
383
|
+
autoFocus: index === 0,
|
|
384
|
+
selectionColor: colors.tint,
|
|
385
|
+
...field.inputProps
|
|
386
|
+
}), fieldErrors[field.key] && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
387
|
+
style: styles.errorText,
|
|
388
|
+
children: fieldErrors[field.key]
|
|
389
|
+
})]
|
|
390
|
+
}, field.key);
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
// Render list content (locations or links)
|
|
394
|
+
const renderListContent = () => {
|
|
395
|
+
const addLabel = fieldType === 'locations' ? t('editProfile.items.locations.add') || 'Add Location' : t('editProfile.items.links.add') || 'Add Link';
|
|
396
|
+
const placeholder = fieldType === 'locations' ? t('editProfile.items.locations.placeholder') || 'Enter location name' : t('editProfile.items.links.placeholder') || 'Enter URL';
|
|
397
|
+
const listTitle = fieldType === 'locations' ? t('editProfile.items.locations.yourLocations') || 'Your Locations' : t('editProfile.items.links.yourLinks') || 'Your Links';
|
|
398
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
399
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
400
|
+
style: styles.inputGroup,
|
|
401
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
402
|
+
style: [styles.label, {
|
|
403
|
+
color: colors.text
|
|
404
|
+
}],
|
|
405
|
+
children: addLabel
|
|
406
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
407
|
+
style: styles.addItemRow,
|
|
408
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
409
|
+
style: [styles.input, {
|
|
410
|
+
backgroundColor: colors.card,
|
|
411
|
+
color: colors.text,
|
|
412
|
+
borderColor: colors.border,
|
|
413
|
+
flex: 1
|
|
414
|
+
}],
|
|
415
|
+
value: newItemValue,
|
|
416
|
+
onChangeText: setNewItemValue,
|
|
417
|
+
placeholder: placeholder,
|
|
418
|
+
placeholderTextColor: colors.secondaryText,
|
|
419
|
+
selectionColor: colors.tint,
|
|
420
|
+
autoCapitalize: "none",
|
|
421
|
+
autoCorrect: false,
|
|
422
|
+
onSubmitEditing: handleAddItem,
|
|
423
|
+
returnKeyType: "done",
|
|
424
|
+
keyboardType: fieldType === 'links' ? 'url' : 'default'
|
|
425
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
426
|
+
style: [styles.addButton, {
|
|
427
|
+
backgroundColor: newItemValue.trim() ? colors.tint : colors.border
|
|
428
|
+
}],
|
|
429
|
+
onPress: handleAddItem,
|
|
430
|
+
disabled: !newItemValue.trim(),
|
|
431
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
432
|
+
name: "add",
|
|
433
|
+
size: 20,
|
|
434
|
+
color: "#fff"
|
|
435
|
+
})
|
|
436
|
+
})]
|
|
437
|
+
})]
|
|
438
|
+
}), listItems.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
439
|
+
style: styles.listSection,
|
|
440
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
441
|
+
style: [styles.listTitle, {
|
|
442
|
+
color: colors.text
|
|
443
|
+
}],
|
|
444
|
+
children: [listTitle, " (", listItems.length, ")"]
|
|
445
|
+
}), listItems.map(item => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
446
|
+
style: [styles.listItem, {
|
|
447
|
+
backgroundColor: colors.card,
|
|
448
|
+
borderColor: colors.border
|
|
449
|
+
}],
|
|
450
|
+
children: [fieldType === 'links' && item.image && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
451
|
+
source: {
|
|
452
|
+
uri: item.image
|
|
453
|
+
},
|
|
454
|
+
style: styles.linkImage
|
|
455
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
456
|
+
style: styles.listItemContent,
|
|
457
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
458
|
+
style: [styles.listItemTitle, {
|
|
459
|
+
color: colors.text
|
|
460
|
+
}],
|
|
461
|
+
numberOfLines: 1,
|
|
462
|
+
children: fieldType === 'locations' ? item.name : item.title || item.url
|
|
463
|
+
}), fieldType === 'links' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
464
|
+
style: [styles.listItemSubtitle, {
|
|
465
|
+
color: colors.secondaryText
|
|
466
|
+
}],
|
|
467
|
+
numberOfLines: 1,
|
|
468
|
+
children: item.url
|
|
469
|
+
})]
|
|
470
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
471
|
+
onPress: () => handleRemoveItem(item.id),
|
|
472
|
+
style: styles.removeButton,
|
|
473
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
474
|
+
name: "trash-outline",
|
|
475
|
+
size: 18,
|
|
476
|
+
color: "#FF3B30"
|
|
477
|
+
})
|
|
478
|
+
})]
|
|
479
|
+
}, item.id))]
|
|
480
|
+
})]
|
|
481
|
+
});
|
|
482
|
+
};
|
|
483
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.KeyboardAvoidingView, {
|
|
484
|
+
style: [styles.container, {
|
|
485
|
+
backgroundColor: normalizedTheme === 'dark' ? '#000000' : '#F5F5F5'
|
|
486
|
+
}],
|
|
487
|
+
behavior: _reactNative.Platform.OS === 'ios' ? 'padding' : undefined,
|
|
488
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Header, {
|
|
489
|
+
title: "",
|
|
490
|
+
subtitle: "",
|
|
491
|
+
theme: normalizedTheme,
|
|
492
|
+
onBack: onClose || goBack,
|
|
493
|
+
variant: "minimal",
|
|
494
|
+
elevation: "none",
|
|
495
|
+
rightAction: {
|
|
496
|
+
text: isSaving ? t('common.saving') || 'Saving...' : t('common.save') || 'Save',
|
|
497
|
+
onPress: handleSave,
|
|
498
|
+
disabled: isSaving,
|
|
499
|
+
loading: isSaving
|
|
500
|
+
}
|
|
501
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
|
|
502
|
+
style: styles.content,
|
|
503
|
+
contentContainerStyle: styles.contentContainer,
|
|
504
|
+
showsVerticalScrollIndicator: false,
|
|
505
|
+
keyboardShouldPersistTaps: "handled",
|
|
506
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
507
|
+
style: styles.titleContainer,
|
|
508
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
509
|
+
style: [styles.bigTitle, {
|
|
510
|
+
color: colors.text
|
|
511
|
+
}],
|
|
512
|
+
children: fieldConfig.title
|
|
513
|
+
}), fieldConfig.subtitle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
514
|
+
style: [styles.bigSubtitle, {
|
|
515
|
+
color: colors.secondaryText
|
|
516
|
+
}],
|
|
517
|
+
children: fieldConfig.subtitle
|
|
518
|
+
})]
|
|
519
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
520
|
+
style: [styles.formCard, {
|
|
521
|
+
backgroundColor: colors.card
|
|
522
|
+
}],
|
|
523
|
+
children: fieldConfig.isList ? renderListContent() : fieldConfig.fields.map(renderField)
|
|
524
|
+
})]
|
|
525
|
+
})]
|
|
526
|
+
});
|
|
527
|
+
};
|
|
528
|
+
const styles = _reactNative.StyleSheet.create({
|
|
529
|
+
container: {
|
|
530
|
+
flex: 1
|
|
531
|
+
},
|
|
532
|
+
content: {
|
|
533
|
+
flex: 1
|
|
534
|
+
},
|
|
535
|
+
contentContainer: {
|
|
536
|
+
padding: 16,
|
|
537
|
+
paddingTop: 24,
|
|
538
|
+
paddingBottom: 40
|
|
539
|
+
},
|
|
540
|
+
titleContainer: {
|
|
541
|
+
marginBottom: 24
|
|
542
|
+
},
|
|
543
|
+
bigTitle: {
|
|
544
|
+
fontSize: 34,
|
|
545
|
+
fontWeight: _reactNative.Platform.OS === 'web' ? 'bold' : undefined,
|
|
546
|
+
fontFamily: _fonts.fontFamilies.interBold,
|
|
547
|
+
lineHeight: 40,
|
|
548
|
+
marginBottom: 8,
|
|
549
|
+
letterSpacing: -0.5
|
|
550
|
+
},
|
|
551
|
+
bigSubtitle: {
|
|
552
|
+
fontSize: 16,
|
|
553
|
+
lineHeight: 22,
|
|
554
|
+
opacity: 0.7,
|
|
555
|
+
marginTop: 4
|
|
556
|
+
},
|
|
557
|
+
formCard: {
|
|
558
|
+
borderRadius: 16,
|
|
559
|
+
padding: 16,
|
|
560
|
+
gap: 16
|
|
561
|
+
},
|
|
562
|
+
inputGroup: {
|
|
563
|
+
gap: 8
|
|
564
|
+
},
|
|
565
|
+
label: {
|
|
566
|
+
fontSize: 14,
|
|
567
|
+
fontWeight: '600',
|
|
568
|
+
fontFamily: _fonts.fontFamilies.interSemiBold
|
|
569
|
+
},
|
|
570
|
+
input: {
|
|
571
|
+
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
572
|
+
borderRadius: 12,
|
|
573
|
+
padding: 16,
|
|
574
|
+
fontSize: 16,
|
|
575
|
+
minHeight: 52
|
|
576
|
+
},
|
|
577
|
+
textArea: {
|
|
578
|
+
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
579
|
+
borderRadius: 12,
|
|
580
|
+
padding: 16,
|
|
581
|
+
fontSize: 16,
|
|
582
|
+
minHeight: 140
|
|
583
|
+
},
|
|
584
|
+
errorText: {
|
|
585
|
+
fontSize: 12,
|
|
586
|
+
color: '#FF3B30',
|
|
587
|
+
marginTop: 4
|
|
588
|
+
},
|
|
589
|
+
addItemRow: {
|
|
590
|
+
flexDirection: 'row',
|
|
591
|
+
gap: 8,
|
|
592
|
+
alignItems: 'center'
|
|
593
|
+
},
|
|
594
|
+
addButton: {
|
|
595
|
+
width: 52,
|
|
596
|
+
height: 52,
|
|
597
|
+
borderRadius: 12,
|
|
598
|
+
alignItems: 'center',
|
|
599
|
+
justifyContent: 'center'
|
|
600
|
+
},
|
|
601
|
+
listSection: {
|
|
602
|
+
marginTop: 8
|
|
603
|
+
},
|
|
604
|
+
listTitle: {
|
|
605
|
+
fontSize: 16,
|
|
606
|
+
fontWeight: '600',
|
|
607
|
+
fontFamily: _fonts.fontFamilies.interSemiBold,
|
|
608
|
+
marginBottom: 12
|
|
609
|
+
},
|
|
610
|
+
listItem: {
|
|
611
|
+
flexDirection: 'row',
|
|
612
|
+
alignItems: 'center',
|
|
613
|
+
padding: 16,
|
|
614
|
+
borderRadius: 12,
|
|
615
|
+
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
616
|
+
gap: 12,
|
|
617
|
+
marginBottom: 8
|
|
618
|
+
},
|
|
619
|
+
listItemContent: {
|
|
620
|
+
flex: 1,
|
|
621
|
+
gap: 4
|
|
622
|
+
},
|
|
623
|
+
listItemTitle: {
|
|
624
|
+
fontSize: 16,
|
|
625
|
+
fontWeight: '500'
|
|
626
|
+
},
|
|
627
|
+
listItemSubtitle: {
|
|
628
|
+
fontSize: 13
|
|
629
|
+
},
|
|
630
|
+
linkImage: {
|
|
631
|
+
width: 40,
|
|
632
|
+
height: 40,
|
|
633
|
+
borderRadius: 8
|
|
634
|
+
},
|
|
635
|
+
removeButton: {
|
|
636
|
+
padding: 8
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(EditProfileFieldScreen);
|
|
640
|
+
//# sourceMappingURL=EditProfileFieldScreen.js.map
|