@oxyhq/services 6.10.8 → 7.0.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 +211 -49
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/client.js +25 -4
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/AccountMenu.js +485 -0
- package/lib/commonjs/ui/components/AccountMenu.js.map +1 -0
- package/lib/commonjs/ui/components/AccountMenuButton.js +120 -0
- package/lib/commonjs/ui/components/AccountMenuButton.js.map +1 -0
- package/lib/commonjs/ui/components/ActingAsBanner.js +2 -2
- package/lib/commonjs/ui/components/ActingAsBanner.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +2 -2
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +2 -2
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/accountMenuRows.js +45 -0
- package/lib/commonjs/ui/components/accountMenuRows.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +5 -5
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +3 -2
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/commonjs/ui/components/theming.js +2 -2
- package/lib/commonjs/ui/components/theming.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +59 -131
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +36 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +6 -0
- package/lib/commonjs/ui/hooks/mutations/mutationKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +138 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +67 -2
- package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +27 -2
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +13 -2
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +30 -0
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/index.js +132 -85
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +6 -7
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +3 -2
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +202 -0
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js +3 -2
- package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +3 -2
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +7 -4
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +21 -16
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +3 -2
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +7 -4
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -2
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +6 -4
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +780 -0
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/NotificationsScreen.js +175 -0
- package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +18 -12
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PreferencesScreen.js +220 -0
- package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +14 -10
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +3 -3
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +8 -5
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +6 -4
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +3 -2
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +2 -2
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +3 -2
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +3 -2
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +2 -2
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +4 -3
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +3 -2
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/activeAuthuser.js +85 -0
- package/lib/commonjs/ui/utils/activeAuthuser.js.map +1 -0
- package/lib/module/index.js +58 -16
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/client.js +5 -3
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/AccountMenu.js +480 -0
- package/lib/module/ui/components/AccountMenu.js.map +1 -0
- package/lib/module/ui/components/AccountMenuButton.js +115 -0
- package/lib/module/ui/components/AccountMenuButton.js.map +1 -0
- package/lib/module/ui/components/ActingAsBanner.js +2 -2
- package/lib/module/ui/components/ActingAsBanner.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/StepBasedScreen.js +1 -1
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/accountMenuRows.js +41 -0
- package/lib/module/ui/components/accountMenuRows.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentMethodStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/module/ui/components/theming.js +1 -1
- package/lib/module/ui/components/theming.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +59 -131
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +36 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationKeys.js +6 -0
- package/lib/module/ui/hooks/mutations/mutationKeys.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +135 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/queryKeys.js +60 -1
- package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +24 -0
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +13 -2
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +30 -0
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/index.js +34 -78
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +6 -7
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +198 -0
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -0
- package/lib/module/ui/screens/CreateManagedAccountScreen.js +1 -1
- package/lib/module/ui/screens/CreateManagedAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +3 -1
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +6 -2
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +3 -1
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +2 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +775 -0
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -0
- package/lib/module/ui/screens/NotificationsScreen.js +169 -0
- package/lib/module/ui/screens/NotificationsScreen.js.map +1 -0
- package/lib/module/ui/screens/PaymentGatewayScreen.js +9 -3
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PreferencesScreen.js +214 -0
- package/lib/module/ui/screens/PreferencesScreen.js.map +1 -0
- package/lib/module/ui/screens/PrivacySettingsScreen.js +4 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +2 -2
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +3 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +2 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +1 -1
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/utils/activeAuthuser.js +79 -0
- package/lib/module/ui/utils/activeAuthuser.js.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +23 -6
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +7 -2
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +23 -0
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +19 -0
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/accountMenuRows.d.ts +27 -0
- package/lib/typescript/commonjs/ui/components/accountMenuRows.d.ts.map +1 -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/mutationKeys.d.ts +5 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +26 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +32 -3
- package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +10 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +8 -2
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +32 -18
- package/lib/typescript/commonjs/ui/index.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/{module/ui/screens/AccountOverviewScreen.d.ts → commonjs/ui/screens/ConnectedAppsScreen.d.ts} +1 -1
- package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -0
- 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/HistoryViewScreen.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 +13 -0
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/{AccountOverviewScreen.d.ts → NotificationsScreen.d.ts} +1 -1
- package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/{AccountSettingsScreen.d.ts → PreferencesScreen.d.ts} +2 -5
- package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.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/utils/activeAuthuser.d.ts +42 -0
- package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +23 -6
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +7 -2
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/AccountMenu.d.ts +23 -0
- package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +19 -0
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/accountMenuRows.d.ts +27 -0
- package/lib/typescript/module/ui/components/accountMenuRows.d.ts.map +1 -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/mutationKeys.d.ts +5 -0
- package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +26 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +32 -3
- package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +10 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts +8 -2
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +32 -18
- package/lib/typescript/module/ui/index.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/{AccountSettingsScreen.d.ts → ConnectedAppsScreen.d.ts} +2 -5
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -0
- 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/HistoryViewScreen.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 +13 -0
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts +5 -0
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts +5 -0
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.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/utils/activeAuthuser.d.ts +42 -0
- package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +1 -0
- package/package.json +20 -9
- package/src/index.ts +141 -47
- package/src/ui/client.ts +7 -2
- package/src/ui/components/AccountMenu.tsx +534 -0
- package/src/ui/components/AccountMenuButton.tsx +113 -0
- package/src/ui/components/ActingAsBanner.tsx +2 -2
- package/src/ui/components/ProfileCard.tsx +1 -1
- package/src/ui/components/StepBasedScreen.tsx +1 -1
- package/src/ui/components/accountMenuRows.ts +60 -0
- package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
- package/src/ui/components/payment/PaymentMethodStep.tsx +1 -1
- package/src/ui/components/theming.tsx +1 -1
- package/src/ui/context/OxyContext.tsx +61 -145
- package/src/ui/context/hooks/useAuthOperations.ts +36 -2
- package/src/ui/hooks/mutations/mutationKeys.ts +11 -0
- package/src/ui/hooks/mutations/useAccountMutations.ts +154 -2
- package/src/ui/hooks/queries/queryKeys.ts +54 -4
- package/src/ui/hooks/queries/useAccountQueries.ts +25 -1
- package/src/ui/hooks/useAuth.ts +23 -4
- package/src/ui/hooks/useSessionManagement.ts +29 -0
- package/src/ui/index.ts +37 -98
- package/src/ui/navigation/routes.ts +9 -11
- package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
- package/src/ui/screens/ConnectedAppsScreen.tsx +225 -0
- package/src/ui/screens/CreateManagedAccountScreen.tsx +1 -1
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
- package/src/ui/screens/FAQScreen.tsx +3 -1
- package/src/ui/screens/FeedbackScreen.tsx +6 -10
- package/src/ui/screens/HelpSupportScreen.tsx +1 -1
- package/src/ui/screens/HistoryViewScreen.tsx +3 -1
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/LegalDocumentsScreen.tsx +2 -1
- package/src/ui/screens/ManageAccountScreen.tsx +1102 -0
- package/src/ui/screens/NotificationsScreen.tsx +189 -0
- package/src/ui/screens/PaymentGatewayScreen.tsx +10 -12
- package/src/ui/screens/PreferencesScreen.tsx +263 -0
- package/src/ui/screens/PrivacySettingsScreen.tsx +4 -1
- package/src/ui/screens/ProfileScreen.tsx +2 -2
- package/src/ui/screens/SavesCollectionsScreen.tsx +3 -1
- package/src/ui/screens/SearchSettingsScreen.tsx +2 -1
- package/src/ui/screens/UserLinksScreen.tsx +1 -1
- package/src/ui/screens/UserListScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
- package/src/ui/utils/activeAuthuser.ts +78 -0
- package/lib/commonjs/ui/components/feedback/index.js +0 -54
- package/lib/commonjs/ui/components/feedback/index.js.map +0 -1
- package/lib/commonjs/ui/components/icon/index.js +0 -21
- package/lib/commonjs/ui/components/icon/index.js.map +0 -1
- package/lib/commonjs/ui/components/index.js +0 -104
- package/lib/commonjs/ui/components/index.js.map +0 -1
- package/lib/commonjs/ui/components/modals/index.js +0 -14
- package/lib/commonjs/ui/components/modals/index.js.map +0 -1
- package/lib/commonjs/ui/components/payment/index.js +0 -80
- package/lib/commonjs/ui/components/payment/index.js.map +0 -1
- package/lib/commonjs/ui/hooks/index.js +0 -92
- package/lib/commonjs/ui/hooks/index.js.map +0 -1
- package/lib/commonjs/ui/hooks/mutations/index.js +0 -68
- package/lib/commonjs/ui/hooks/mutations/index.js.map +0 -1
- package/lib/commonjs/ui/hooks/queries/index.js +0 -155
- package/lib/commonjs/ui/hooks/queries/index.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +0 -344
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +0 -724
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +0 -643
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -1029
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +0 -512
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +0 -1
- package/lib/commonjs/ui/styles/index.js +0 -39
- package/lib/commonjs/ui/styles/index.js.map +0 -1
- package/lib/module/ui/components/feedback/index.js +0 -8
- package/lib/module/ui/components/feedback/index.js.map +0 -1
- package/lib/module/ui/components/icon/index.js +0 -5
- package/lib/module/ui/components/icon/index.js.map +0 -1
- package/lib/module/ui/components/index.js +0 -18
- package/lib/module/ui/components/index.js.map +0 -1
- package/lib/module/ui/components/modals/index.js +0 -4
- package/lib/module/ui/components/modals/index.js.map +0 -1
- package/lib/module/ui/components/payment/index.js +0 -10
- package/lib/module/ui/components/payment/index.js.map +0 -1
- package/lib/module/ui/hooks/index.js +0 -11
- package/lib/module/ui/hooks/index.js.map +0 -1
- package/lib/module/ui/hooks/mutations/index.js +0 -15
- package/lib/module/ui/hooks/mutations/index.js.map +0 -1
- package/lib/module/ui/hooks/queries/index.js +0 -26
- package/lib/module/ui/hooks/queries/index.js.map +0 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +0 -339
- package/lib/module/ui/screens/AccountCenterScreen.js.map +0 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +0 -719
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +0 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +0 -638
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +0 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -1024
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +0 -508
- package/lib/module/ui/screens/SessionManagementScreen.js.map +0 -1
- package/lib/module/ui/styles/index.js +0 -6
- package/lib/module/ui/styles/index.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/feedback/index.d.ts +0 -7
- package/lib/typescript/commonjs/ui/components/feedback/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/icon/index.d.ts +0 -4
- package/lib/typescript/commonjs/ui/components/icon/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/index.d.ts +0 -13
- package/lib/typescript/commonjs/ui/components/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/modals/index.d.ts +0 -2
- package/lib/typescript/commonjs/ui/components/modals/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/payment/index.d.ts +0 -9
- package/lib/typescript/commonjs/ui/components/payment/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/index.d.ts +0 -9
- package/lib/typescript/commonjs/ui/hooks/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/index.d.ts +0 -9
- package/lib/typescript/commonjs/ui/hooks/mutations/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts +0 -13
- package/lib/typescript/commonjs/ui/hooks/queries/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts +0 -5
- package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/styles/index.d.ts +0 -4
- package/lib/typescript/commonjs/ui/styles/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/feedback/index.d.ts +0 -7
- package/lib/typescript/module/ui/components/feedback/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/icon/index.d.ts +0 -4
- package/lib/typescript/module/ui/components/icon/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/index.d.ts +0 -13
- package/lib/typescript/module/ui/components/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/modals/index.d.ts +0 -2
- package/lib/typescript/module/ui/components/modals/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/payment/index.d.ts +0 -9
- package/lib/typescript/module/ui/components/payment/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/index.d.ts +0 -9
- package/lib/typescript/module/ui/hooks/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/mutations/index.d.ts +0 -9
- package/lib/typescript/module/ui/hooks/mutations/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/queries/index.d.ts +0 -13
- package/lib/typescript/module/ui/hooks/queries/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts +0 -5
- package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/styles/index.d.ts +0 -4
- package/lib/typescript/module/ui/styles/index.d.ts.map +0 -1
- package/src/ui/components/feedback/index.ts +0 -6
- package/src/ui/components/icon/index.ts +0 -3
- package/src/ui/components/index.ts +0 -15
- package/src/ui/components/modals/index.ts +0 -1
- package/src/ui/components/payment/index.ts +0 -9
- package/src/ui/hooks/index.ts +0 -13
- package/src/ui/hooks/mutations/index.ts +0 -25
- package/src/ui/hooks/queries/index.ts +0 -61
- package/src/ui/screens/AccountCenterScreen.tsx +0 -182
- package/src/ui/screens/AccountOverviewScreen.tsx +0 -696
- package/src/ui/screens/AccountSettingsScreen.tsx +0 -620
- package/src/ui/screens/AccountSwitcherScreen.tsx +0 -1003
- package/src/ui/screens/SessionManagementScreen.tsx +0 -477
- package/src/ui/styles/index.ts +0 -3
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
|
+
import { View, StyleSheet, ScrollView } from 'react-native';
|
|
3
|
+
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
4
|
+
import { Switch } from '@oxyhq/bloom/switch';
|
|
5
|
+
import { useTheme } from '@oxyhq/bloom/theme';
|
|
6
|
+
import type { NotificationPreferences } from '@oxyhq/core';
|
|
7
|
+
import type { BaseScreenProps } from '../types/navigation';
|
|
8
|
+
import Header from '../components/Header';
|
|
9
|
+
import { SettingsIcon } from '../components/SettingsIcon';
|
|
10
|
+
import { useI18n } from '../hooks/useI18n';
|
|
11
|
+
import { useOxy } from '../context/OxyContext';
|
|
12
|
+
import { useCurrentUser } from '../hooks/queries/useAccountQueries';
|
|
13
|
+
import { useUpdateNotificationPreferences } from '../hooks/mutations/useAccountMutations';
|
|
14
|
+
import { useSettingToggles } from '../hooks/useSettingToggle';
|
|
15
|
+
import { useColorScheme } from '../hooks/useColorScheme';
|
|
16
|
+
import { Colors } from '../constants/theme';
|
|
17
|
+
import { normalizeColorScheme, normalizeTheme } from '../utils/themeUtils';
|
|
18
|
+
|
|
19
|
+
interface NotificationToggleValues {
|
|
20
|
+
pushEnabled: boolean;
|
|
21
|
+
emailDigest: boolean;
|
|
22
|
+
securityAlerts: boolean;
|
|
23
|
+
marketingEmails: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const DEFAULT_VALUES: NotificationToggleValues = {
|
|
27
|
+
pushEnabled: true,
|
|
28
|
+
emailDigest: true,
|
|
29
|
+
securityAlerts: true,
|
|
30
|
+
marketingEmails: false,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* NotificationsScreen — manage per-channel notification preferences.
|
|
35
|
+
*
|
|
36
|
+
* Persists every toggle change via `useUpdateNotificationPreferences`, which
|
|
37
|
+
* uses optimistic updates + offline-queue support. The initial values seed
|
|
38
|
+
* from the current user's `notificationPreferences` field, defaulting to the
|
|
39
|
+
* platform defaults when the field has never been set.
|
|
40
|
+
*/
|
|
41
|
+
const NotificationsScreen: React.FC<BaseScreenProps> = ({ onClose, theme, goBack }) => {
|
|
42
|
+
const bloomTheme = useTheme();
|
|
43
|
+
const { t } = useI18n();
|
|
44
|
+
const colorScheme = useColorScheme();
|
|
45
|
+
const palette = useMemo(
|
|
46
|
+
() => Colors[normalizeColorScheme(colorScheme, normalizeTheme(theme))],
|
|
47
|
+
[colorScheme, theme],
|
|
48
|
+
);
|
|
49
|
+
const { isAuthenticated } = useOxy();
|
|
50
|
+
const { data: user } = useCurrentUser({ enabled: isAuthenticated });
|
|
51
|
+
const updateMutation = useUpdateNotificationPreferences();
|
|
52
|
+
|
|
53
|
+
const initialValues = useMemo<NotificationToggleValues>(() => {
|
|
54
|
+
const prefs = user?.notificationPreferences;
|
|
55
|
+
return {
|
|
56
|
+
pushEnabled: prefs?.pushEnabled ?? DEFAULT_VALUES.pushEnabled,
|
|
57
|
+
emailDigest: prefs?.emailDigest ?? DEFAULT_VALUES.emailDigest,
|
|
58
|
+
securityAlerts: prefs?.securityAlerts ?? DEFAULT_VALUES.securityAlerts,
|
|
59
|
+
marketingEmails: prefs?.marketingEmails ?? DEFAULT_VALUES.marketingEmails,
|
|
60
|
+
};
|
|
61
|
+
}, [user?.notificationPreferences]);
|
|
62
|
+
|
|
63
|
+
const handleSave = useCallback(
|
|
64
|
+
async (key: keyof NotificationToggleValues, value: boolean) => {
|
|
65
|
+
const patch: Partial<NotificationPreferences> = { [key]: value };
|
|
66
|
+
await updateMutation.mutateAsync(patch);
|
|
67
|
+
},
|
|
68
|
+
[updateMutation],
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const { values, toggle, savingKeys } = useSettingToggles<NotificationToggleValues>({
|
|
72
|
+
initialValues,
|
|
73
|
+
onSave: handleSave,
|
|
74
|
+
errorMessage: t('notifications.updateError') || 'Failed to update notification preferences',
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const isSaving = savingKeys.size > 0;
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<View style={[styles.container, { backgroundColor: bloomTheme.colors.background }]}>
|
|
81
|
+
<Header
|
|
82
|
+
title={t('notifications.title') || 'Notifications'}
|
|
83
|
+
onBack={goBack || onClose}
|
|
84
|
+
variant="minimal"
|
|
85
|
+
elevation="subtle"
|
|
86
|
+
/>
|
|
87
|
+
<ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContent}>
|
|
88
|
+
<SettingsListGroup
|
|
89
|
+
title={t('notifications.sections.channels') || 'Channels'}
|
|
90
|
+
>
|
|
91
|
+
<SettingsListItem
|
|
92
|
+
icon={<SettingsIcon name="bell" color={palette.iconPersonalInfo} />}
|
|
93
|
+
title={t('notifications.items.push.title') || 'Push notifications'}
|
|
94
|
+
description={
|
|
95
|
+
t('notifications.items.push.subtitle')
|
|
96
|
+
|| 'Real-time alerts on your devices'
|
|
97
|
+
}
|
|
98
|
+
rightElement={
|
|
99
|
+
<Switch
|
|
100
|
+
value={values.pushEnabled}
|
|
101
|
+
onValueChange={() => toggle('pushEnabled')}
|
|
102
|
+
disabled={isSaving}
|
|
103
|
+
/>
|
|
104
|
+
}
|
|
105
|
+
showChevron={false}
|
|
106
|
+
/>
|
|
107
|
+
<SettingsListItem
|
|
108
|
+
icon={<SettingsIcon name="email" color={palette.iconData} />}
|
|
109
|
+
title={t('notifications.items.emailDigest.title') || 'Email digest'}
|
|
110
|
+
description={
|
|
111
|
+
t('notifications.items.emailDigest.subtitle')
|
|
112
|
+
|| 'Periodic summary of your account activity'
|
|
113
|
+
}
|
|
114
|
+
rightElement={
|
|
115
|
+
<Switch
|
|
116
|
+
value={values.emailDigest}
|
|
117
|
+
onValueChange={() => toggle('emailDigest')}
|
|
118
|
+
disabled={isSaving}
|
|
119
|
+
/>
|
|
120
|
+
}
|
|
121
|
+
showChevron={false}
|
|
122
|
+
/>
|
|
123
|
+
</SettingsListGroup>
|
|
124
|
+
|
|
125
|
+
<SettingsListGroup
|
|
126
|
+
title={t('notifications.sections.alerts') || 'Alerts'}
|
|
127
|
+
>
|
|
128
|
+
<SettingsListItem
|
|
129
|
+
icon={<SettingsIcon name="shield-check" color={palette.iconSecurity} />}
|
|
130
|
+
title={
|
|
131
|
+
t('notifications.items.securityAlerts.title') || 'Security alerts'
|
|
132
|
+
}
|
|
133
|
+
description={
|
|
134
|
+
t('notifications.items.securityAlerts.subtitle')
|
|
135
|
+
|| 'Sign-ins, recovery codes, and key changes'
|
|
136
|
+
}
|
|
137
|
+
rightElement={
|
|
138
|
+
<Switch
|
|
139
|
+
value={values.securityAlerts}
|
|
140
|
+
onValueChange={() => toggle('securityAlerts')}
|
|
141
|
+
disabled={isSaving}
|
|
142
|
+
/>
|
|
143
|
+
}
|
|
144
|
+
showChevron={false}
|
|
145
|
+
/>
|
|
146
|
+
</SettingsListGroup>
|
|
147
|
+
|
|
148
|
+
<SettingsListGroup
|
|
149
|
+
title={t('notifications.sections.marketing') || 'Marketing'}
|
|
150
|
+
>
|
|
151
|
+
<SettingsListItem
|
|
152
|
+
icon={<SettingsIcon name="megaphone" color={palette.iconSharing} />}
|
|
153
|
+
title={
|
|
154
|
+
t('notifications.items.marketingEmails.title')
|
|
155
|
+
|| 'Marketing emails'
|
|
156
|
+
}
|
|
157
|
+
description={
|
|
158
|
+
t('notifications.items.marketingEmails.subtitle')
|
|
159
|
+
|| 'Product news and occasional offers'
|
|
160
|
+
}
|
|
161
|
+
rightElement={
|
|
162
|
+
<Switch
|
|
163
|
+
value={values.marketingEmails}
|
|
164
|
+
onValueChange={() => toggle('marketingEmails')}
|
|
165
|
+
disabled={isSaving}
|
|
166
|
+
/>
|
|
167
|
+
}
|
|
168
|
+
showChevron={false}
|
|
169
|
+
/>
|
|
170
|
+
</SettingsListGroup>
|
|
171
|
+
</ScrollView>
|
|
172
|
+
</View>
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const styles = StyleSheet.create({
|
|
177
|
+
container: {
|
|
178
|
+
flex: 1,
|
|
179
|
+
},
|
|
180
|
+
scroll: {
|
|
181
|
+
flex: 1,
|
|
182
|
+
},
|
|
183
|
+
scrollContent: {
|
|
184
|
+
paddingHorizontal: 16,
|
|
185
|
+
paddingBottom: 24,
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
export default React.memo(NotificationsScreen);
|
|
@@ -9,23 +9,21 @@ import {
|
|
|
9
9
|
useWindowDimensions,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import type { BaseScreenProps } from '../types/navigation';
|
|
12
|
-
import { useThemeColors } from '../styles';
|
|
12
|
+
import { useThemeColors } from '../styles/theme';
|
|
13
13
|
import { normalizeTheme } from '../utils/themeUtils';
|
|
14
14
|
import { Button } from '@oxyhq/bloom/button';
|
|
15
15
|
import { Ionicons } from '@expo/vector-icons';
|
|
16
16
|
import { useI18n } from '../hooks/useI18n';
|
|
17
17
|
import QRCode from 'react-native-qrcode-svg';
|
|
18
18
|
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} from '../components/payment';
|
|
28
|
-
import type { PaymentItem, PaymentGatewayResult, CardDetails } from '../components/payment';
|
|
19
|
+
import PaymentSummaryStep from '../components/payment/PaymentSummaryStep';
|
|
20
|
+
import PaymentMethodStep from '../components/payment/PaymentMethodStep';
|
|
21
|
+
import PaymentDetailsStep from '../components/payment/PaymentDetailsStep';
|
|
22
|
+
import PaymentReviewStep from '../components/payment/PaymentReviewStep';
|
|
23
|
+
import PaymentSuccessStep from '../components/payment/PaymentSuccessStep';
|
|
24
|
+
import { PAYMENT_METHODS } from '../components/payment/constants';
|
|
25
|
+
import { createPaymentStyles } from '../components/payment/paymentStyles';
|
|
26
|
+
import type { PaymentItem, PaymentGatewayResult, CardDetails } from '../components/payment/types';
|
|
29
27
|
|
|
30
28
|
export type { PaymentItem, PaymentGatewayResult };
|
|
31
29
|
|
|
@@ -166,7 +164,7 @@ const PaymentGatewayScreen: React.FC<PaymentGatewayScreenProps> = (props) => {
|
|
|
166
164
|
if (onPaymentResult) {
|
|
167
165
|
onPaymentResult({ success: true });
|
|
168
166
|
}
|
|
169
|
-
navigate?.('
|
|
167
|
+
navigate?.('ManageAccount');
|
|
170
168
|
}, [onPaymentResult, navigate]);
|
|
171
169
|
|
|
172
170
|
const handleClose = useCallback(() => {
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { AccessibilityInfo, Platform, StyleSheet, View, ScrollView } from 'react-native';
|
|
3
|
+
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
4
|
+
import { Switch } from '@oxyhq/bloom/switch';
|
|
5
|
+
import { useTheme } from '@oxyhq/bloom/theme';
|
|
6
|
+
import type { UserPreferences } from '@oxyhq/core';
|
|
7
|
+
import type { BaseScreenProps } from '../types/navigation';
|
|
8
|
+
import Header from '../components/Header';
|
|
9
|
+
import { SettingsIcon } from '../components/SettingsIcon';
|
|
10
|
+
import { useI18n } from '../hooks/useI18n';
|
|
11
|
+
import { useOxy } from '../context/OxyContext';
|
|
12
|
+
import { useCurrentUser } from '../hooks/queries/useAccountQueries';
|
|
13
|
+
import { useUpdateUserPreferences } from '../hooks/mutations/useAccountMutations';
|
|
14
|
+
import { useColorScheme } from '../hooks/useColorScheme';
|
|
15
|
+
import { Colors } from '../constants/theme';
|
|
16
|
+
import { normalizeColorScheme, normalizeTheme } from '../utils/themeUtils';
|
|
17
|
+
|
|
18
|
+
type ThemePreference = 'light' | 'dark' | 'system';
|
|
19
|
+
|
|
20
|
+
const THEME_ORDER: ThemePreference[] = ['system', 'light', 'dark'];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the device's timezone using `Intl.DateTimeFormat`. Available on
|
|
24
|
+
* every Hermes/JSC build we support; no `expo-localization` native module
|
|
25
|
+
* needed.
|
|
26
|
+
*/
|
|
27
|
+
const getDeviceTimezone = (): string => {
|
|
28
|
+
try {
|
|
29
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone || '';
|
|
30
|
+
} catch {
|
|
31
|
+
return '';
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* PreferencesScreen — general user preferences applied across all Oxy apps.
|
|
37
|
+
*
|
|
38
|
+
* Language is delegated to the existing LanguageSelector screen. Theme,
|
|
39
|
+
* reduce-motion, and timezone are persisted on the User document via
|
|
40
|
+
* `useUpdateUserPreferences` so every Oxy app sees the same setting.
|
|
41
|
+
*/
|
|
42
|
+
const PreferencesScreen: React.FC<BaseScreenProps> = ({
|
|
43
|
+
onClose,
|
|
44
|
+
theme,
|
|
45
|
+
goBack,
|
|
46
|
+
navigate,
|
|
47
|
+
}) => {
|
|
48
|
+
const bloomTheme = useTheme();
|
|
49
|
+
const { t, locale } = useI18n();
|
|
50
|
+
const colorScheme = useColorScheme();
|
|
51
|
+
const palette = useMemo(
|
|
52
|
+
() => Colors[normalizeColorScheme(colorScheme, normalizeTheme(theme))],
|
|
53
|
+
[colorScheme, theme],
|
|
54
|
+
);
|
|
55
|
+
const { isAuthenticated } = useOxy();
|
|
56
|
+
const { data: user } = useCurrentUser({ enabled: isAuthenticated });
|
|
57
|
+
const updateMutation = useUpdateUserPreferences();
|
|
58
|
+
|
|
59
|
+
const prefs = user?.userPreferences;
|
|
60
|
+
const themePref: ThemePreference = (prefs?.theme as ThemePreference) ?? 'system';
|
|
61
|
+
const reduceMotionPref = prefs?.reduceMotion ?? false;
|
|
62
|
+
const deviceTimezone = useMemo(getDeviceTimezone, []);
|
|
63
|
+
const timezone = prefs?.timezone || deviceTimezone;
|
|
64
|
+
|
|
65
|
+
// Mirror the OS reduce-motion state on first mount so users can see whether
|
|
66
|
+
// the device itself is in reduced-motion mode (independent of their saved
|
|
67
|
+
// server preference). Persists into the saved value when toggled.
|
|
68
|
+
const [systemReduceMotion, setSystemReduceMotion] = useState<boolean>(false);
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
let cancelled = false;
|
|
71
|
+
AccessibilityInfo.isReduceMotionEnabled()
|
|
72
|
+
.then((value) => {
|
|
73
|
+
if (!cancelled) {
|
|
74
|
+
setSystemReduceMotion(value);
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
.catch(() => {
|
|
78
|
+
// AccessibilityInfo not available on this platform — keep default
|
|
79
|
+
});
|
|
80
|
+
const sub = AccessibilityInfo.addEventListener(
|
|
81
|
+
'reduceMotionChanged',
|
|
82
|
+
(value) => setSystemReduceMotion(value),
|
|
83
|
+
);
|
|
84
|
+
return () => {
|
|
85
|
+
cancelled = true;
|
|
86
|
+
sub.remove();
|
|
87
|
+
};
|
|
88
|
+
}, []);
|
|
89
|
+
|
|
90
|
+
const handleThemeChange = useCallback(
|
|
91
|
+
async (nextTheme: ThemePreference) => {
|
|
92
|
+
const patch: Partial<UserPreferences> = { theme: nextTheme };
|
|
93
|
+
await updateMutation.mutateAsync(patch);
|
|
94
|
+
},
|
|
95
|
+
[updateMutation],
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
const handleReduceMotionToggle = useCallback(async () => {
|
|
99
|
+
const next = !reduceMotionPref;
|
|
100
|
+
const patch: Partial<UserPreferences> = { reduceMotion: next };
|
|
101
|
+
await updateMutation.mutateAsync(patch);
|
|
102
|
+
}, [reduceMotionPref, updateMutation]);
|
|
103
|
+
|
|
104
|
+
const handleResetTimezone = useCallback(async () => {
|
|
105
|
+
// Empty string means "follow device" — server-side default
|
|
106
|
+
const patch: Partial<UserPreferences> = { timezone: '' };
|
|
107
|
+
await updateMutation.mutateAsync(patch);
|
|
108
|
+
}, [updateMutation]);
|
|
109
|
+
|
|
110
|
+
const themeDisplay = useMemo(() => {
|
|
111
|
+
switch (themePref) {
|
|
112
|
+
case 'light':
|
|
113
|
+
return t('preferences.theme.light') || 'Light';
|
|
114
|
+
case 'dark':
|
|
115
|
+
return t('preferences.theme.dark') || 'Dark';
|
|
116
|
+
default:
|
|
117
|
+
return t('preferences.theme.system') || 'System default';
|
|
118
|
+
}
|
|
119
|
+
}, [themePref, t]);
|
|
120
|
+
|
|
121
|
+
const nextTheme: ThemePreference =
|
|
122
|
+
THEME_ORDER[(THEME_ORDER.indexOf(themePref) + 1) % THEME_ORDER.length] ?? 'system';
|
|
123
|
+
|
|
124
|
+
const languageDescription = useMemo(() => {
|
|
125
|
+
if (prefs?.language) {
|
|
126
|
+
return prefs.language;
|
|
127
|
+
}
|
|
128
|
+
return locale;
|
|
129
|
+
}, [prefs?.language, locale]);
|
|
130
|
+
|
|
131
|
+
const isSaving = updateMutation.isPending;
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<View style={[styles.container, { backgroundColor: bloomTheme.colors.background }]}>
|
|
135
|
+
<Header
|
|
136
|
+
title={t('preferences.title') || 'Preferences'}
|
|
137
|
+
onBack={goBack || onClose}
|
|
138
|
+
variant="minimal"
|
|
139
|
+
elevation="subtle"
|
|
140
|
+
/>
|
|
141
|
+
<ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContent}>
|
|
142
|
+
<SettingsListGroup
|
|
143
|
+
title={t('preferences.sections.appearance') || 'Appearance'}
|
|
144
|
+
>
|
|
145
|
+
<SettingsListItem
|
|
146
|
+
icon={
|
|
147
|
+
<SettingsIcon
|
|
148
|
+
name="theme-light-dark"
|
|
149
|
+
color={palette.iconData}
|
|
150
|
+
/>
|
|
151
|
+
}
|
|
152
|
+
title={t('preferences.items.theme.title') || 'Theme'}
|
|
153
|
+
description={themeDisplay}
|
|
154
|
+
onPress={() => handleThemeChange(nextTheme)}
|
|
155
|
+
disabled={isSaving}
|
|
156
|
+
/>
|
|
157
|
+
<SettingsListItem
|
|
158
|
+
icon={
|
|
159
|
+
<SettingsIcon
|
|
160
|
+
name="motion"
|
|
161
|
+
color={palette.iconPersonalInfo}
|
|
162
|
+
/>
|
|
163
|
+
}
|
|
164
|
+
title={
|
|
165
|
+
t('preferences.items.reduceMotion.title') || 'Reduce motion'
|
|
166
|
+
}
|
|
167
|
+
description={
|
|
168
|
+
systemReduceMotion
|
|
169
|
+
? (t('preferences.items.reduceMotion.systemOn')
|
|
170
|
+
|| 'Following system: reduce motion is on')
|
|
171
|
+
: (t('preferences.items.reduceMotion.subtitle')
|
|
172
|
+
|| 'Minimise animations across Oxy apps')
|
|
173
|
+
}
|
|
174
|
+
rightElement={
|
|
175
|
+
<Switch
|
|
176
|
+
value={reduceMotionPref}
|
|
177
|
+
onValueChange={handleReduceMotionToggle}
|
|
178
|
+
disabled={isSaving}
|
|
179
|
+
/>
|
|
180
|
+
}
|
|
181
|
+
showChevron={false}
|
|
182
|
+
/>
|
|
183
|
+
</SettingsListGroup>
|
|
184
|
+
|
|
185
|
+
<SettingsListGroup
|
|
186
|
+
title={t('preferences.sections.language') || 'Language'}
|
|
187
|
+
>
|
|
188
|
+
<SettingsListItem
|
|
189
|
+
icon={
|
|
190
|
+
<SettingsIcon
|
|
191
|
+
name="translate"
|
|
192
|
+
color={palette.iconPersonalInfo}
|
|
193
|
+
/>
|
|
194
|
+
}
|
|
195
|
+
title={t('preferences.items.language.title') || 'Language'}
|
|
196
|
+
description={languageDescription}
|
|
197
|
+
onPress={() => navigate?.('LanguageSelector')}
|
|
198
|
+
/>
|
|
199
|
+
</SettingsListGroup>
|
|
200
|
+
|
|
201
|
+
<SettingsListGroup
|
|
202
|
+
title={t('preferences.sections.region') || 'Region'}
|
|
203
|
+
>
|
|
204
|
+
<SettingsListItem
|
|
205
|
+
icon={
|
|
206
|
+
<SettingsIcon
|
|
207
|
+
name="clock-outline"
|
|
208
|
+
color={palette.iconSecurity}
|
|
209
|
+
/>
|
|
210
|
+
}
|
|
211
|
+
title={t('preferences.items.timezone.title') || 'Timezone'}
|
|
212
|
+
description={
|
|
213
|
+
timezone
|
|
214
|
+
|| (t('preferences.items.timezone.unknown')
|
|
215
|
+
|| 'Unable to detect timezone')
|
|
216
|
+
}
|
|
217
|
+
onPress={prefs?.timezone ? handleResetTimezone : undefined}
|
|
218
|
+
disabled={isSaving || !prefs?.timezone}
|
|
219
|
+
showChevron={false}
|
|
220
|
+
/>
|
|
221
|
+
</SettingsListGroup>
|
|
222
|
+
|
|
223
|
+
{Platform.OS === 'web' ? null : (
|
|
224
|
+
<SettingsListGroup>
|
|
225
|
+
<SettingsListItem
|
|
226
|
+
icon={
|
|
227
|
+
<SettingsIcon
|
|
228
|
+
name="information"
|
|
229
|
+
color={palette.iconHome}
|
|
230
|
+
/>
|
|
231
|
+
}
|
|
232
|
+
title={
|
|
233
|
+
t('preferences.items.about.title')
|
|
234
|
+
|| 'About preferences'
|
|
235
|
+
}
|
|
236
|
+
description={
|
|
237
|
+
t('preferences.items.about.subtitle')
|
|
238
|
+
|| 'Preferences sync across every Oxy app you sign into'
|
|
239
|
+
}
|
|
240
|
+
showChevron={false}
|
|
241
|
+
disabled
|
|
242
|
+
/>
|
|
243
|
+
</SettingsListGroup>
|
|
244
|
+
)}
|
|
245
|
+
</ScrollView>
|
|
246
|
+
</View>
|
|
247
|
+
);
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const styles = StyleSheet.create({
|
|
251
|
+
container: {
|
|
252
|
+
flex: 1,
|
|
253
|
+
},
|
|
254
|
+
scroll: {
|
|
255
|
+
flex: 1,
|
|
256
|
+
},
|
|
257
|
+
scrollContent: {
|
|
258
|
+
paddingHorizontal: 16,
|
|
259
|
+
paddingBottom: 24,
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
export default React.memo(PreferencesScreen);
|
|
@@ -8,7 +8,10 @@ import {
|
|
|
8
8
|
} from 'react-native';
|
|
9
9
|
import type { BaseScreenProps } from '../types/navigation';
|
|
10
10
|
import { toast } from '@oxyhq/bloom';
|
|
11
|
-
import
|
|
11
|
+
import Header from '../components/Header';
|
|
12
|
+
import Avatar from '../components/Avatar';
|
|
13
|
+
import LoadingState from '../components/LoadingState';
|
|
14
|
+
import EmptyState from '../components/EmptyState';
|
|
12
15
|
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
13
16
|
import { Switch } from '@oxyhq/bloom/switch';
|
|
14
17
|
import { useI18n } from '../hooks/useI18n';
|
|
@@ -4,7 +4,7 @@ import { View, Text, StyleSheet, ActivityIndicator, ScrollView, TouchableOpacity
|
|
|
4
4
|
import type { BaseScreenProps } from '../types/navigation';
|
|
5
5
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
6
6
|
import Avatar from '../components/Avatar';
|
|
7
|
-
import
|
|
7
|
+
import FollowButton from '../components/FollowButton';
|
|
8
8
|
import { useFollow } from '../hooks/useFollow';
|
|
9
9
|
import { Ionicons } from '@expo/vector-icons';
|
|
10
10
|
import { useI18n } from '../hooks/useI18n';
|
|
@@ -227,7 +227,7 @@ const ProfileScreen: React.FC<ProfileScreenProps> = ({ userId, username, theme,
|
|
|
227
227
|
<TouchableOpacity
|
|
228
228
|
style={styles.actionButton}
|
|
229
229
|
className="bg-background border-primary"
|
|
230
|
-
onPress={() => navigate?.('
|
|
230
|
+
onPress={() => navigate?.('ManageAccount')}
|
|
231
231
|
>
|
|
232
232
|
<Text style={styles.actionButtonText} className="text-primary">{t('editProfile.title') || 'Edit Profile'}</Text>
|
|
233
233
|
</TouchableOpacity>
|
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
} from 'react-native';
|
|
9
9
|
import type { BaseScreenProps } from '../types/navigation';
|
|
10
10
|
import { toast } from '@oxyhq/bloom';
|
|
11
|
-
import
|
|
11
|
+
import Header from '../components/Header';
|
|
12
|
+
import LoadingState from '../components/LoadingState';
|
|
13
|
+
import EmptyState from '../components/EmptyState';
|
|
12
14
|
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
13
15
|
import { SettingsIcon } from '../components/SettingsIcon';
|
|
14
16
|
import { useI18n } from '../hooks/useI18n';
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
ScrollView,
|
|
6
6
|
} from 'react-native';
|
|
7
7
|
import type { BaseScreenProps } from '../types/navigation';
|
|
8
|
-
import
|
|
8
|
+
import Header from '../components/Header';
|
|
9
|
+
import LoadingState from '../components/LoadingState';
|
|
9
10
|
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
10
11
|
import { Switch } from '@oxyhq/bloom/switch';
|
|
11
12
|
import { useI18n } from '../hooks/useI18n';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { View, StyleSheet, ScrollView, Linking } from 'react-native';
|
|
3
3
|
import type { BaseScreenProps } from '../types/navigation';
|
|
4
|
-
import
|
|
4
|
+
import Header from '../components/Header';
|
|
5
5
|
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
6
6
|
import { SettingsIcon } from '../components/SettingsIcon';
|
|
7
7
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import type { BaseScreenProps } from '../types/navigation';
|
|
13
13
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
14
14
|
import Avatar from '../components/Avatar';
|
|
15
|
-
import
|
|
15
|
+
import FollowButton from '../components/FollowButton';
|
|
16
16
|
import { Ionicons } from '@expo/vector-icons';
|
|
17
17
|
import { useI18n } from '../hooks/useI18n';
|
|
18
18
|
import { useOxy } from '../context/OxyContext';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView, Platform } from 'react-native';
|
|
3
3
|
import type { BaseScreenProps } from '../../types/navigation';
|
|
4
|
-
import
|
|
4
|
+
import Header from '../../components/Header';
|
|
5
5
|
import { useI18n } from '../../hooks/useI18n';
|
|
6
6
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@ import React, { useState, useMemo, useCallback } from 'react';
|
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView, Platform, TextInput, LayoutAnimation } from 'react-native';
|
|
3
3
|
import type { BaseScreenProps } from '../../types/navigation';
|
|
4
4
|
import { Ionicons } from '@expo/vector-icons';
|
|
5
|
-
import
|
|
5
|
+
import Header from '../../components/Header';
|
|
6
6
|
import { SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
7
7
|
import { useI18n } from '../../hooks/useI18n';
|
|
8
8
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
@@ -3,7 +3,7 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { View, Text, StyleSheet, ScrollView, ActivityIndicator, TouchableOpacity } from 'react-native';
|
|
4
4
|
import type { BaseScreenProps } from '../../types/navigation';
|
|
5
5
|
import Avatar from '../../components/Avatar';
|
|
6
|
-
import
|
|
6
|
+
import Header from '../../components/Header';
|
|
7
7
|
import { useI18n } from '../../hooks/useI18n';
|
|
8
8
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
9
9
|
import { useOxy } from '../../context/OxyContext';
|
|
@@ -2,7 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
import { useMemo, useState, useEffect } from 'react';
|
|
3
3
|
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Platform } from 'react-native';
|
|
4
4
|
import type { BaseScreenProps } from '../../types/navigation';
|
|
5
|
-
import
|
|
5
|
+
import Header from '../../components/Header';
|
|
6
6
|
import { Ionicons } from '@expo/vector-icons';
|
|
7
7
|
import { useI18n } from '../../hooks/useI18n';
|
|
8
8
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
@@ -2,7 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { View, Text, StyleSheet, ScrollView, ActivityIndicator } from 'react-native';
|
|
4
4
|
import type { BaseScreenProps } from '../../types/navigation';
|
|
5
|
-
import
|
|
5
|
+
import Header from '../../components/Header';
|
|
6
6
|
import { useI18n } from '../../hooks/useI18n';
|
|
7
7
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
8
8
|
import { useOxy } from '../../context/OxyContext';
|