@oxyhq/services 10.5.0 → 11.1.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/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/AccountMenu.js +9 -5
- package/lib/commonjs/ui/components/AccountMenu.js.map +1 -1
- package/lib/commonjs/ui/components/AnotherDeviceQR.js +51 -56
- package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +1 -1
- package/lib/commonjs/ui/components/BottomSheetRouter.js +1 -0
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +18 -5
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +23 -7
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/SignInModal.js +20 -1
- package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +19 -9
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +4 -2
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +153 -19
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +6 -17
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +5 -5
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +38 -38
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +2 -2
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +3 -3
- package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js +16 -12
- package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +10 -6
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queryClient.js +6 -5
- package/lib/commonjs/ui/hooks/queryClient.js.map +1 -1
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js +40 -2
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +1 -1
- package/lib/commonjs/ui/hooks/useProfileEditing.js +21 -0
- package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +3 -3
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +100 -108
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +227 -273
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +10 -4
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +20 -37
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js +89 -201
- package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +80 -208
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +56 -208
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +303 -352
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +20 -20
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +77 -89
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +43 -58
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +67 -90
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +77 -177
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +113 -107
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +55 -114
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/NotificationsScreen.js +67 -85
- package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +71 -135
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +15 -9
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PreferencesScreen.js +65 -83
- package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +378 -1023
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +294 -242
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +192 -305
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +57 -97
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +41 -41
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +17 -24
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +83 -214
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +115 -77
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js +70 -57
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +136 -332
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js +47 -137
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +182 -115
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +138 -214
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +54 -92
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/activeAuthuser.js +15 -9
- package/lib/commonjs/ui/utils/activeAuthuser.js.map +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/AccountMenu.js +10 -6
- package/lib/module/ui/components/AccountMenu.js.map +1 -1
- package/lib/module/ui/components/AnotherDeviceQR.js +50 -56
- package/lib/module/ui/components/AnotherDeviceQR.js.map +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js +2 -1
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +18 -5
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +23 -7
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/SignInModal.js +20 -1
- package/lib/module/ui/components/SignInModal.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +19 -9
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js +4 -2
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +154 -20
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +6 -17
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +5 -5
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +38 -38
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js +2 -2
- package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/queryKeys.js +3 -3
- package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/usePaymentQueries.js +16 -12
- package/lib/module/ui/hooks/queries/usePaymentQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useServicesQueries.js +9 -6
- package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/module/ui/hooks/queryClient.js +6 -5
- package/lib/module/ui/hooks/queryClient.js.map +1 -1
- package/lib/module/ui/hooks/useOxyAuthSession.js +40 -2
- package/lib/module/ui/hooks/useOxyAuthSession.js.map +1 -1
- package/lib/module/ui/hooks/useProfileEditing.js +21 -0
- package/lib/module/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +4 -3
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +101 -109
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +228 -275
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +10 -4
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +19 -39
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateManagedAccountScreen.js +90 -202
- package/lib/module/ui/screens/CreateManagedAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +77 -205
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +55 -207
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +301 -350
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +20 -20
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +78 -90
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +44 -59
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +68 -91
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +75 -177
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +116 -108
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +52 -112
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/NotificationsScreen.js +68 -86
- package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +69 -134
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +16 -10
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PreferencesScreen.js +66 -84
- package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +366 -1012
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +295 -243
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +189 -302
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +58 -98
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +42 -42
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +18 -25
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +81 -212
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +114 -76
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustAboutScreen.js +69 -57
- package/lib/module/ui/screens/trust/TrustAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +135 -332
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustFAQScreen.js +48 -138
- package/lib/module/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +184 -117
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +132 -208
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRulesScreen.js +58 -94
- package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/module/ui/utils/activeAuthuser.js +15 -9
- package/lib/module/ui/utils/activeAuthuser.js.map +1 -1
- package/lib/module/ui/utils/avatarUtils.js +1 -1
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +2 -0
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +12 -2
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +3 -2
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TouchableRipple/TouchableRipple.native.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TouchableRipple/TouchableRipple.native.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +34 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +3 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +3 -3
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queryClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +22 -0
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts +3 -0
- package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts +2 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateManagedAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HelpSupportScreen.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/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PreferencesScreen.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/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AccountMenu.d.ts +2 -0
- package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +12 -2
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts +3 -2
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.native.d.ts +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.native.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts +34 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +3 -0
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +3 -3
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queryClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +22 -0
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts +3 -0
- package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts +2 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateManagedAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.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/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.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/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +1 -1
- package/lib/typescript/types/expo-haptics.d.ts +42 -0
- package/package.json +24 -31
- package/src/index.ts +1 -0
- package/src/types/expo-haptics.d.ts +42 -0
- package/src/ui/components/AccountMenu.tsx +11 -5
- package/src/ui/components/AnotherDeviceQR.tsx +53 -45
- package/src/ui/components/BottomSheetRouter.tsx +2 -1
- package/src/ui/components/FollowButton.tsx +24 -5
- package/src/ui/components/OxyProvider.tsx +22 -8
- package/src/ui/components/SignInModal.tsx +21 -2
- package/src/ui/components/TouchableRipple/TouchableRipple.native.tsx +1 -1
- package/src/ui/components/fileManagement/FileViewer.tsx +9 -9
- package/src/ui/components/fileManagement/UploadPreview.tsx +2 -2
- package/src/ui/context/OxyContext.tsx +178 -21
- package/src/ui/context/hooks/useAuthOperations.ts +6 -17
- package/src/ui/hooks/mutations/mutationFactory.ts +5 -5
- package/src/ui/hooks/mutations/useAccountMutations.ts +38 -38
- package/src/ui/hooks/mutations/useServicesMutations.ts +2 -2
- package/src/ui/hooks/queries/queryKeys.ts +6 -3
- package/src/ui/hooks/queries/useAccountQueries.ts +1 -1
- package/src/ui/hooks/queries/usePaymentQueries.ts +12 -12
- package/src/ui/hooks/queries/useServicesQueries.ts +9 -6
- package/src/ui/hooks/queryClient.ts +5 -5
- package/src/ui/hooks/useOxyAuthSession.ts +76 -2
- package/src/ui/hooks/useProfileEditing.ts +24 -0
- package/src/ui/hooks/useSessionManagement.ts +9 -6
- package/src/ui/screens/AccountVerificationScreen.tsx +101 -113
- package/src/ui/screens/AppInfoScreen.tsx +200 -238
- package/src/ui/screens/AvatarCropScreen.tsx +17 -4
- package/src/ui/screens/ConnectedAppsScreen.tsx +16 -34
- package/src/ui/screens/CreateManagedAccountScreen.tsx +94 -170
- package/src/ui/screens/EditProfileFieldScreen.tsx +77 -190
- package/src/ui/screens/FAQScreen.tsx +77 -208
- package/src/ui/screens/FeedbackScreen.tsx +330 -239
- package/src/ui/screens/FileManagementScreen.tsx +20 -20
- package/src/ui/screens/HelpSupportScreen.tsx +67 -82
- package/src/ui/screens/HistoryViewScreen.tsx +32 -38
- package/src/ui/screens/LanguageSelectorScreen.tsx +79 -93
- package/src/ui/screens/LearnMoreUsernamesScreen.tsx +81 -164
- package/src/ui/screens/LegalDocumentsScreen.tsx +184 -123
- package/src/ui/screens/ManageAccountScreen.tsx +48 -114
- package/src/ui/screens/NotificationsScreen.tsx +107 -106
- package/src/ui/screens/OxyAuthScreen.tsx +76 -109
- package/src/ui/screens/PaymentGatewayScreen.tsx +16 -7
- package/src/ui/screens/PreferencesScreen.tsx +96 -116
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +419 -872
- package/src/ui/screens/PrivacySettingsScreen.tsx +203 -185
- package/src/ui/screens/ProfileScreen.tsx +158 -200
- package/src/ui/screens/SavesCollectionsScreen.tsx +78 -125
- package/src/ui/screens/SearchSettingsScreen.tsx +52 -41
- package/src/ui/screens/UserLinksScreen.tsx +18 -25
- package/src/ui/screens/UserListScreen.tsx +95 -188
- package/src/ui/screens/WelcomeNewUserScreen.tsx +109 -36
- package/src/ui/screens/trust/TrustAboutScreen.tsx +52 -41
- package/src/ui/screens/trust/TrustCenterScreen.tsx +184 -222
- package/src/ui/screens/trust/TrustFAQScreen.tsx +64 -124
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +190 -67
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +147 -182
- package/src/ui/screens/trust/TrustRulesScreen.tsx +77 -50
- package/src/ui/utils/activeAuthuser.ts +15 -9
- package/src/ui/utils/avatarUtils.ts +1 -1
- package/lib/commonjs/ui/components/feedback/FormInput.js +0 -72
- package/lib/commonjs/ui/components/feedback/FormInput.js.map +0 -1
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js +0 -261
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +0 -1
- package/lib/module/ui/components/feedback/FormInput.js +0 -67
- package/lib/module/ui/components/feedback/FormInput.js.map +0 -1
- package/lib/module/ui/components/feedback/feedbackStyles.js +0 -256
- package/lib/module/ui/components/feedback/feedbackStyles.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/feedback/FormInput.d.ts +0 -20
- package/lib/typescript/commonjs/ui/components/feedback/FormInput.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/feedback/feedbackStyles.d.ts +0 -279
- package/lib/typescript/commonjs/ui/components/feedback/feedbackStyles.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/feedback/FormInput.d.ts +0 -20
- package/lib/typescript/module/ui/components/feedback/FormInput.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/feedback/feedbackStyles.d.ts +0 -279
- package/lib/typescript/module/ui/components/feedback/feedbackStyles.d.ts.map +0 -1
- package/src/ui/components/feedback/FormInput.tsx +0 -84
- package/src/ui/components/feedback/feedbackStyles.ts +0 -246
|
@@ -1,38 +1,36 @@
|
|
|
1
1
|
import React, { useState, useMemo, useCallback } from 'react';
|
|
2
|
-
import { View,
|
|
2
|
+
import { View, ScrollView } from 'react-native';
|
|
3
3
|
import type { BaseScreenProps } from '../../types/navigation';
|
|
4
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
5
4
|
import Header from '../../components/Header';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
5
|
+
import EmptyState from '../../components/EmptyState';
|
|
6
|
+
import { SearchInput } from '@oxyhq/bloom/search-input';
|
|
7
|
+
import {
|
|
8
|
+
Accordion,
|
|
9
|
+
AccordionItem,
|
|
10
|
+
AccordionTrigger,
|
|
11
|
+
AccordionContent,
|
|
12
|
+
} from '@oxyhq/bloom/accordion';
|
|
13
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
8
14
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
9
|
-
import {
|
|
10
|
-
import { useColorScheme } from '../../hooks/useColorScheme';
|
|
11
|
-
import { Colors } from '../../constants/theme';
|
|
15
|
+
import { useI18n } from '../../hooks/useI18n';
|
|
12
16
|
|
|
13
17
|
const FAQ_KEYS = ['what', 'earn', 'lose', 'use', 'transfer', 'support'] as const;
|
|
14
18
|
|
|
15
19
|
/**
|
|
16
|
-
* TrustFAQScreen
|
|
20
|
+
* TrustFAQScreen
|
|
17
21
|
*
|
|
18
|
-
*
|
|
19
|
-
* -
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* - React.memo wrapper to prevent re-renders when props haven't changed
|
|
22
|
+
* Frequently asked questions about Oxy Trust, rendered with the shared Bloom
|
|
23
|
+
* Accordion (single-expand) + SearchInput. Styling is centralized Bloom token
|
|
24
|
+
* classes; the Bloom Accordion owns its own expand/collapse animation, so no
|
|
25
|
+
* `LayoutAnimation` is used here.
|
|
23
26
|
*/
|
|
24
|
-
const TrustFAQScreen: React.FC<BaseScreenProps> = ({ goBack
|
|
27
|
+
const TrustFAQScreen: React.FC<BaseScreenProps> = ({ goBack }) => {
|
|
25
28
|
const { t } = useI18n();
|
|
26
|
-
const [expanded, setExpanded] = useState<string | null>(null);
|
|
27
|
-
const [search, setSearch] = useState('');
|
|
28
|
-
|
|
29
|
-
// Memoize theme-related calculations to prevent unnecessary recalculations
|
|
30
29
|
const bloomTheme = useTheme();
|
|
31
|
-
const colorScheme = useColorScheme();
|
|
32
|
-
const normalizedColorScheme = normalizeColorScheme(colorScheme);
|
|
33
|
-
const colors = Colors[normalizedColorScheme];
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
const [search, setSearch] = useState('');
|
|
32
|
+
const [expanded, setExpanded] = useState<string | undefined>(undefined);
|
|
33
|
+
|
|
36
34
|
const faqs = useMemo(() => FAQ_KEYS.map(key => ({
|
|
37
35
|
id: key,
|
|
38
36
|
q: t(`trust.faq.items.${key}.q`) || '',
|
|
@@ -48,123 +46,65 @@ const TrustFAQScreen: React.FC<BaseScreenProps> = ({ goBack, theme }) => {
|
|
|
48
46
|
);
|
|
49
47
|
}, [search, faqs]);
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
const handleAccordionChange = useCallback(
|
|
50
|
+
(value: string | string[] | undefined) => {
|
|
51
|
+
setExpanded(Array.isArray(value) ? value[0] : value);
|
|
52
|
+
},
|
|
53
|
+
[],
|
|
54
|
+
);
|
|
56
55
|
|
|
57
56
|
return (
|
|
58
|
-
<View
|
|
57
|
+
<View className="flex-1 bg-bg">
|
|
59
58
|
<Header
|
|
60
59
|
title={t('trust.faq.title') || 'Trust FAQ'}
|
|
61
60
|
subtitle={t('trust.faq.subtitle') || 'Frequently asked questions about Oxy Trust'}
|
|
62
61
|
subtitleVariant="muted"
|
|
63
|
-
|
|
64
62
|
onBack={goBack}
|
|
65
63
|
elevation="subtle"
|
|
66
64
|
/>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
returnKeyType="search"
|
|
80
|
-
/>
|
|
81
|
-
</View>
|
|
65
|
+
|
|
66
|
+
<View className="px-screen-margin pt-space-20 pb-space-12">
|
|
67
|
+
<SearchInput
|
|
68
|
+
label={t('trust.faq.search') || 'Search FAQ...'}
|
|
69
|
+
value={search}
|
|
70
|
+
onChangeText={setSearch}
|
|
71
|
+
onClearText={() => setSearch('')}
|
|
72
|
+
accessibilityLabel="Search Trust FAQ"
|
|
73
|
+
/>
|
|
74
|
+
</View>
|
|
75
|
+
|
|
76
|
+
<ScrollView className="flex-1 px-screen-margin" showsVerticalScrollIndicator={false}>
|
|
82
77
|
{filteredFaqs.length === 0 ? (
|
|
83
|
-
<
|
|
84
|
-
{
|
|
85
|
-
|
|
78
|
+
<EmptyState
|
|
79
|
+
message={
|
|
80
|
+
t('trust.faq.noResults', { query: search }) ||
|
|
81
|
+
`No FAQ items found matching "${search}"`
|
|
82
|
+
}
|
|
83
|
+
textColor={bloomTheme.colors.text}
|
|
84
|
+
/>
|
|
86
85
|
) : (
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
/>
|
|
106
|
-
{isExpanded && (
|
|
107
|
-
<View style={[styles.answerContainer, { backgroundColor: colors.card }, isLast && styles.lastAnswerContainer]}>
|
|
108
|
-
<Text style={[styles.answer, { color: bloomTheme.colors.text }]}>
|
|
109
|
-
{faq.a}
|
|
110
|
-
</Text>
|
|
111
|
-
</View>
|
|
112
|
-
)}
|
|
113
|
-
</View>
|
|
114
|
-
);
|
|
115
|
-
})}
|
|
116
|
-
</View>
|
|
86
|
+
<Accordion
|
|
87
|
+
type="single"
|
|
88
|
+
value={expanded}
|
|
89
|
+
onValueChange={handleAccordionChange}
|
|
90
|
+
>
|
|
91
|
+
{filteredFaqs.map(faq => (
|
|
92
|
+
<AccordionItem key={faq.id} value={faq.id}>
|
|
93
|
+
<AccordionTrigger>
|
|
94
|
+
{faq.q}
|
|
95
|
+
</AccordionTrigger>
|
|
96
|
+
<AccordionContent>
|
|
97
|
+
<Text className="font-sans text-bodyMedium text-text-secondary">
|
|
98
|
+
{faq.a}
|
|
99
|
+
</Text>
|
|
100
|
+
</AccordionContent>
|
|
101
|
+
</AccordionItem>
|
|
102
|
+
))}
|
|
103
|
+
</Accordion>
|
|
117
104
|
)}
|
|
118
105
|
</ScrollView>
|
|
119
106
|
</View>
|
|
120
107
|
);
|
|
121
108
|
};
|
|
122
109
|
|
|
123
|
-
const styles = StyleSheet.create({
|
|
124
|
-
container: { flex: 1 },
|
|
125
|
-
contentContainer: {
|
|
126
|
-
paddingHorizontal: 24,
|
|
127
|
-
paddingTop: 20,
|
|
128
|
-
paddingBottom: 40,
|
|
129
|
-
},
|
|
130
|
-
searchContainer: {
|
|
131
|
-
flexDirection: 'row',
|
|
132
|
-
alignItems: 'center',
|
|
133
|
-
paddingHorizontal: 14,
|
|
134
|
-
paddingVertical: 10,
|
|
135
|
-
marginBottom: 12,
|
|
136
|
-
borderRadius: 999,
|
|
137
|
-
gap: 10,
|
|
138
|
-
},
|
|
139
|
-
searchInput: {
|
|
140
|
-
flex: 1,
|
|
141
|
-
fontSize: 16,
|
|
142
|
-
lineHeight: 20,
|
|
143
|
-
},
|
|
144
|
-
groupedSectionContainer: {
|
|
145
|
-
width: '100%',
|
|
146
|
-
},
|
|
147
|
-
faqItemWrapper: {
|
|
148
|
-
width: '100%',
|
|
149
|
-
},
|
|
150
|
-
answerContainer: {
|
|
151
|
-
paddingHorizontal: 10,
|
|
152
|
-
paddingTop: 4,
|
|
153
|
-
paddingBottom: 12,
|
|
154
|
-
},
|
|
155
|
-
lastAnswerContainer: {
|
|
156
|
-
borderBottomLeftRadius: 18,
|
|
157
|
-
borderBottomRightRadius: 18,
|
|
158
|
-
},
|
|
159
|
-
answer: {
|
|
160
|
-
fontSize: 14,
|
|
161
|
-
lineHeight: 20,
|
|
162
|
-
},
|
|
163
|
-
noResults: {
|
|
164
|
-
fontSize: 16,
|
|
165
|
-
marginTop: 32,
|
|
166
|
-
textAlign: 'center',
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
|
|
170
110
|
export default React.memo(TrustFAQScreen);
|
|
@@ -1,101 +1,224 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import {
|
|
4
|
+
View,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
ActivityIndicator,
|
|
7
|
+
FlatList,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
} from 'react-native';
|
|
4
10
|
import type { ReputationLeaderboardEntry } from '@oxyhq/core';
|
|
11
|
+
import { getAccountDisplayName, logger } from '@oxyhq/core';
|
|
12
|
+
import { useTheme } from '@oxyhq/bloom/theme';
|
|
13
|
+
import { H6, Text } from '@oxyhq/bloom/typography';
|
|
14
|
+
import { Chip } from '@oxyhq/bloom/chip';
|
|
15
|
+
import { Button } from '@oxyhq/bloom/button';
|
|
16
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
5
17
|
import type { BaseScreenProps } from '../../types/navigation';
|
|
6
18
|
import Avatar from '../../components/Avatar';
|
|
7
19
|
import Header from '../../components/Header';
|
|
8
20
|
import { useI18n } from '../../hooks/useI18n';
|
|
9
|
-
import { useTheme } from '@oxyhq/bloom/theme';
|
|
10
21
|
import { useOxy } from '../../context/OxyContext';
|
|
11
22
|
import { getTrustTierLabel } from './trustTier';
|
|
12
23
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
const AVATAR_SIZE = 40;
|
|
25
|
+
const EMPTY_ICON_SIZE = 64;
|
|
26
|
+
const ERROR_ICON_SIZE = 48;
|
|
27
|
+
/** Ranks within the podium (1–3) get a highlighted row surface. */
|
|
28
|
+
const PODIUM_RANK = 3;
|
|
29
|
+
|
|
30
|
+
const TrustLeaderboardScreen: React.FC<BaseScreenProps> = ({ goBack, navigate }) => {
|
|
31
|
+
const { oxyServices, user: currentUser } = useOxy();
|
|
32
|
+
const { t, locale } = useI18n();
|
|
33
|
+
const bloomTheme = useTheme();
|
|
34
|
+
|
|
17
35
|
const [leaderboard, setLeaderboard] = useState<ReputationLeaderboardEntry[]>([]);
|
|
18
36
|
const [isLoading, setIsLoading] = useState(true);
|
|
19
37
|
const [error, setError] = useState<string | null>(null);
|
|
20
38
|
|
|
21
|
-
const
|
|
22
|
-
// Override primaryColor for Oxy Trust screens (purple instead of blue)
|
|
23
|
-
const primaryColor = '#d169e5';
|
|
39
|
+
const currentUserId = currentUser?.id ?? '';
|
|
24
40
|
|
|
25
|
-
|
|
41
|
+
const loadLeaderboard = useCallback(() => {
|
|
26
42
|
setIsLoading(true);
|
|
27
43
|
setError(null);
|
|
28
|
-
oxyServices
|
|
44
|
+
oxyServices
|
|
45
|
+
.getReputationLeaderboard()
|
|
29
46
|
.then((data) => setLeaderboard(Array.isArray(data) ? data : []))
|
|
30
|
-
.catch((err: unknown) =>
|
|
47
|
+
.catch((err: unknown) => {
|
|
48
|
+
logger.error(
|
|
49
|
+
'Failed to load trust leaderboard',
|
|
50
|
+
err instanceof Error ? err : new Error(String(err)),
|
|
51
|
+
{ component: 'TrustLeaderboardScreen' },
|
|
52
|
+
);
|
|
53
|
+
setError(err instanceof Error ? err.message : null);
|
|
54
|
+
})
|
|
31
55
|
.finally(() => setIsLoading(false));
|
|
32
56
|
}, [oxyServices]);
|
|
33
57
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
loadLeaderboard();
|
|
60
|
+
}, [loadLeaderboard]);
|
|
61
|
+
|
|
62
|
+
const title = t('trust.leaderboard.title') || 'Trust Leaderboard';
|
|
63
|
+
const subtitle = t('trust.leaderboard.subtitle') || 'Top contributors in the community';
|
|
64
|
+
|
|
65
|
+
const handleEntryPress = useCallback(
|
|
66
|
+
(entry: ReputationLeaderboardEntry) => {
|
|
67
|
+
navigate?.('Profile', { userId: entry.user.id, username: entry.user.username });
|
|
68
|
+
},
|
|
69
|
+
[navigate],
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const renderEntry = useCallback(
|
|
73
|
+
({ item }: { item: ReputationLeaderboardEntry }) => {
|
|
74
|
+
const displayName = getAccountDisplayName(item.user, locale);
|
|
75
|
+
const isViewer = currentUserId !== '' && item.user.id === currentUserId;
|
|
76
|
+
const isPodium = item.rank <= PODIUM_RANK;
|
|
77
|
+
// Viewer's own row and podium ranks get a subtle highlighted surface.
|
|
78
|
+
const highlightClass = isViewer || isPodium ? 'bg-fill-secondary' : '';
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<TouchableOpacity
|
|
82
|
+
style={styles.row}
|
|
83
|
+
className={`px-screen-margin py-space-12 gap-space-12 rounded-radius-12 ${highlightClass}`}
|
|
84
|
+
onPress={() => handleEntryPress(item)}
|
|
85
|
+
activeOpacity={0.7}
|
|
86
|
+
accessibilityRole="button"
|
|
87
|
+
accessibilityLabel={`${displayName}, ${t('trust.leaderboard.rankLabel', { rank: item.rank }) || `rank ${item.rank}`}`}
|
|
88
|
+
>
|
|
89
|
+
<Text
|
|
90
|
+
className="text-text-secondary font-bold text-subtitle text-center"
|
|
91
|
+
style={styles.rank}
|
|
92
|
+
numberOfLines={1}
|
|
93
|
+
>
|
|
94
|
+
{item.rank}
|
|
95
|
+
</Text>
|
|
96
|
+
<Avatar
|
|
97
|
+
uri={item.user.avatar ? oxyServices.getFileDownloadUrl(item.user.avatar, 'thumb') : undefined}
|
|
98
|
+
name={displayName}
|
|
99
|
+
size={AVATAR_SIZE}
|
|
100
|
+
/>
|
|
101
|
+
<View style={styles.userColumn}>
|
|
102
|
+
<Text className="text-text font-medium text-base" numberOfLines={1}>
|
|
103
|
+
{displayName}
|
|
104
|
+
</Text>
|
|
105
|
+
<View style={styles.tierRow} className="mt-space-4">
|
|
106
|
+
<Chip size="small" variant="soft" color={isPodium ? 'primary' : 'default'}>
|
|
107
|
+
{getTrustTierLabel(item.trustTier, t)}
|
|
108
|
+
</Chip>
|
|
109
|
+
</View>
|
|
110
|
+
</View>
|
|
111
|
+
<Text className="text-text font-bold text-base" numberOfLines={1}>
|
|
112
|
+
{item.total}
|
|
113
|
+
</Text>
|
|
114
|
+
</TouchableOpacity>
|
|
115
|
+
);
|
|
116
|
+
},
|
|
117
|
+
[oxyServices, locale, currentUserId, handleEntryPress, t],
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const keyExtractor = useCallback(
|
|
121
|
+
(item: ReputationLeaderboardEntry, index: number) => item.user.id || `entry-${index}`,
|
|
122
|
+
[],
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const ItemSeparator = useMemo(
|
|
126
|
+
() => () => <View style={styles.separator} className="border-b border-border-image" />,
|
|
127
|
+
[],
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
if (isLoading) {
|
|
131
|
+
return (
|
|
132
|
+
<View className="flex-1 bg-bg">
|
|
133
|
+
<Header title={title} subtitle={subtitle} onBack={goBack} elevation="subtle" />
|
|
134
|
+
<View style={styles.center}>
|
|
135
|
+
<ActivityIndicator size="large" color={bloomTheme.colors.primary} />
|
|
136
|
+
</View>
|
|
137
|
+
</View>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
39
140
|
|
|
40
|
-
|
|
41
|
-
|
|
141
|
+
if (error) {
|
|
142
|
+
return (
|
|
143
|
+
<View className="flex-1 bg-bg">
|
|
144
|
+
<Header title={title} subtitle={subtitle} onBack={goBack} elevation="subtle" />
|
|
145
|
+
<View style={styles.center} className="px-space-32 gap-space-16">
|
|
146
|
+
<Ionicons name="alert-circle" size={ERROR_ICON_SIZE} color={bloomTheme.colors.error} />
|
|
147
|
+
<Text className="text-text-secondary text-base text-center">
|
|
148
|
+
{error || t('trust.leaderboard.error') || 'Failed to load leaderboard'}
|
|
149
|
+
</Text>
|
|
150
|
+
<Button variant="primary" onPress={loadLeaderboard}>
|
|
151
|
+
{t('common.retry') || 'Retry'}
|
|
152
|
+
</Button>
|
|
153
|
+
</View>
|
|
154
|
+
</View>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<View className="flex-1 bg-bg">
|
|
160
|
+
<Header title={title} subtitle={subtitle} onBack={goBack} elevation="subtle" />
|
|
161
|
+
<FlatList
|
|
162
|
+
data={leaderboard}
|
|
163
|
+
renderItem={renderEntry}
|
|
164
|
+
keyExtractor={keyExtractor}
|
|
165
|
+
contentContainerStyle={styles.listContent}
|
|
166
|
+
className="px-space-8 pt-space-12"
|
|
167
|
+
ItemSeparatorComponent={ItemSeparator}
|
|
168
|
+
ListEmptyComponent={
|
|
169
|
+
<View style={styles.emptyContainer} className="px-space-32 gap-space-8">
|
|
170
|
+
<Ionicons name="trophy-outline" size={EMPTY_ICON_SIZE} color={bloomTheme.colors.textSecondary} />
|
|
171
|
+
<H6 className="text-text text-center mt-space-8">
|
|
172
|
+
{t('trust.leaderboard.empty') || 'No leaderboard data'}
|
|
173
|
+
</H6>
|
|
174
|
+
<Text className="text-text-secondary text-sm text-center">
|
|
175
|
+
{t('trust.leaderboard.emptyDesc') || 'Top contributors will appear here as the community grows.'}
|
|
176
|
+
</Text>
|
|
177
|
+
</View>
|
|
178
|
+
}
|
|
42
179
|
/>
|
|
43
|
-
{isLoading ? (
|
|
44
|
-
<ActivityIndicator size="large" color={primaryColor} style={{ marginTop: 40 }} />
|
|
45
|
-
) : error ? (
|
|
46
|
-
<Text style={[styles.error, { color: bloomTheme.colors.error }]}>{error}</Text>
|
|
47
|
-
) : (
|
|
48
|
-
<ScrollView contentContainerStyle={styles.listContainer}>
|
|
49
|
-
{leaderboard.length === 0 ? (
|
|
50
|
-
<Text style={[styles.placeholder, { color: bloomTheme.colors.text }]}>{t('trust.leaderboard.empty') || 'No leaderboard data.'}</Text>
|
|
51
|
-
) : (
|
|
52
|
-
leaderboard.map((entry) => {
|
|
53
|
-
const username = entry.user.username;
|
|
54
|
-
const displayName = username || entry.user.id;
|
|
55
|
-
return (
|
|
56
|
-
<TouchableOpacity
|
|
57
|
-
key={entry.user.id}
|
|
58
|
-
style={[styles.row, { borderColor: bloomTheme.colors.border }, entry.rank <= 3 && { backgroundColor: bloomTheme.colors.primarySubtle }]}
|
|
59
|
-
onPress={() => navigate?.('Profile', { userId: entry.user.id, username })}
|
|
60
|
-
activeOpacity={0.7}
|
|
61
|
-
>
|
|
62
|
-
<Text style={[styles.rank, { color: primaryColor }]}>{entry.rank}</Text>
|
|
63
|
-
<Avatar name={username || 'User'} size={40} style={styles.avatar} />
|
|
64
|
-
<View style={styles.userColumn}>
|
|
65
|
-
<Text style={[styles.username, { color: bloomTheme.colors.text }]} numberOfLines={1}>{displayName}</Text>
|
|
66
|
-
<Text style={[styles.tier, { color: bloomTheme.colors.textTertiary }]} numberOfLines={1}>
|
|
67
|
-
{getTrustTierLabel(entry.trustTier, t)}
|
|
68
|
-
</Text>
|
|
69
|
-
</View>
|
|
70
|
-
<Text style={[styles.reputation, { color: primaryColor }]}>{entry.total}</Text>
|
|
71
|
-
</TouchableOpacity>
|
|
72
|
-
);
|
|
73
|
-
})
|
|
74
|
-
)}
|
|
75
|
-
</ScrollView>
|
|
76
|
-
)}
|
|
77
180
|
</View>
|
|
78
181
|
);
|
|
79
182
|
};
|
|
80
183
|
|
|
184
|
+
// Layout-only styles: flex centering, measured rank column width, separator
|
|
185
|
+
// inset, and row flex layout. Colors, spacing, radius, and typography roles
|
|
186
|
+
// live on Bloom components + NativeWind token classes.
|
|
81
187
|
const styles = StyleSheet.create({
|
|
82
|
-
|
|
83
|
-
|
|
188
|
+
center: {
|
|
189
|
+
flex: 1,
|
|
190
|
+
justifyContent: 'center',
|
|
191
|
+
alignItems: 'center',
|
|
192
|
+
},
|
|
193
|
+
listContent: {
|
|
194
|
+
flexGrow: 1,
|
|
195
|
+
paddingBottom: 40,
|
|
196
|
+
},
|
|
84
197
|
row: {
|
|
85
198
|
flexDirection: 'row',
|
|
86
199
|
alignItems: 'center',
|
|
87
|
-
paddingVertical: 12,
|
|
88
|
-
paddingHorizontal: 20,
|
|
89
|
-
borderBottomWidth: 1,
|
|
90
200
|
},
|
|
91
|
-
rank: {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
201
|
+
rank: {
|
|
202
|
+
width: 28,
|
|
203
|
+
},
|
|
204
|
+
userColumn: {
|
|
205
|
+
flex: 1,
|
|
206
|
+
},
|
|
207
|
+
tierRow: {
|
|
208
|
+
flexDirection: 'row',
|
|
209
|
+
alignItems: 'flex-start',
|
|
210
|
+
},
|
|
211
|
+
// Inset the hairline separator to align with the start of the entry's text
|
|
212
|
+
// content (rank column + avatar + screen margin + gaps).
|
|
213
|
+
separator: {
|
|
214
|
+
marginLeft: 80,
|
|
215
|
+
},
|
|
216
|
+
emptyContainer: {
|
|
217
|
+
flex: 1,
|
|
218
|
+
justifyContent: 'center',
|
|
219
|
+
alignItems: 'center',
|
|
220
|
+
paddingTop: 80,
|
|
221
|
+
},
|
|
99
222
|
});
|
|
100
223
|
|
|
101
224
|
export default TrustLeaderboardScreen;
|