@oxyhq/services 6.10.7 → 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 +211 -21
- 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 +211 -21
- 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/queries/useSecurityQueries.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useSecurityQueries.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/queries/useSecurityQueries.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/useSecurityQueries.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 +204 -18
- 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
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Centralized query keys for TanStack Query
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Following best practices:
|
|
5
5
|
* - Use arrays for hierarchical keys
|
|
6
6
|
* - Include all parameters in the key
|
|
7
7
|
* - Use consistent naming conventions
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
11
|
+
|
|
10
12
|
export const queryKeys = {
|
|
11
13
|
// Account queries
|
|
12
14
|
accounts: {
|
|
@@ -72,6 +74,12 @@ export const queryKeys = {
|
|
|
72
74
|
usage: () => [...queryKeys.storage.all, 'usage'] as const,
|
|
73
75
|
},
|
|
74
76
|
|
|
77
|
+
// Connected apps (FedCM grants the user has authorized)
|
|
78
|
+
connectedApps: {
|
|
79
|
+
all: ['connectedApps'] as const,
|
|
80
|
+
list: () => [...queryKeys.connectedApps.all, 'list'] as const,
|
|
81
|
+
},
|
|
82
|
+
|
|
75
83
|
// Payment / wallet / subscription queries
|
|
76
84
|
payments: {
|
|
77
85
|
all: ['payments'] as const,
|
|
@@ -96,21 +104,63 @@ export const queryKeys = {
|
|
|
96
104
|
/**
|
|
97
105
|
* Helper to invalidate all account-related queries
|
|
98
106
|
*/
|
|
99
|
-
export const invalidateAccountQueries = (queryClient:
|
|
107
|
+
export const invalidateAccountQueries = (queryClient: QueryClient): void => {
|
|
100
108
|
queryClient.invalidateQueries({ queryKey: queryKeys.accounts.all });
|
|
101
109
|
};
|
|
102
110
|
|
|
103
111
|
/**
|
|
104
112
|
* Helper to invalidate all user-related queries
|
|
105
113
|
*/
|
|
106
|
-
export const invalidateUserQueries = (queryClient:
|
|
114
|
+
export const invalidateUserQueries = (queryClient: QueryClient): void => {
|
|
107
115
|
queryClient.invalidateQueries({ queryKey: queryKeys.users.all });
|
|
108
116
|
};
|
|
109
117
|
|
|
110
118
|
/**
|
|
111
119
|
* Helper to invalidate all session-related queries
|
|
112
120
|
*/
|
|
113
|
-
export const invalidateSessionQueries = (queryClient:
|
|
121
|
+
export const invalidateSessionQueries = (queryClient: QueryClient): void => {
|
|
114
122
|
queryClient.invalidateQueries({ queryKey: queryKeys.sessions.all });
|
|
115
123
|
};
|
|
116
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Helper to invalidate all device-related queries
|
|
127
|
+
*/
|
|
128
|
+
export const invalidateDeviceQueries = (queryClient: QueryClient): void => {
|
|
129
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.devices.all });
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Helper to invalidate all privacy-settings queries
|
|
134
|
+
*/
|
|
135
|
+
export const invalidatePrivacyQueries = (queryClient: QueryClient): void => {
|
|
136
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.privacy.all });
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Helper to invalidate all security-activity queries
|
|
141
|
+
*/
|
|
142
|
+
export const invalidateSecurityQueries = (queryClient: QueryClient): void => {
|
|
143
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.security.all });
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Helper to invalidate all storage-usage queries
|
|
148
|
+
*/
|
|
149
|
+
export const invalidateStorageQueries = (queryClient: QueryClient): void => {
|
|
150
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.storage.all });
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Helper to invalidate all payments / wallet / subscription queries
|
|
155
|
+
*/
|
|
156
|
+
export const invalidatePaymentsQueries = (queryClient: QueryClient): void => {
|
|
157
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.payments.all });
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Helper to invalidate the user's connected-apps list
|
|
162
|
+
*/
|
|
163
|
+
export const invalidateConnectedAppsQueries = (queryClient: QueryClient): void => {
|
|
164
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.connectedApps.all });
|
|
165
|
+
};
|
|
166
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import { useQuery, useQueries, useQueryClient } from '@tanstack/react-query';
|
|
3
3
|
import { authenticatedApiCall } from '@oxyhq/core';
|
|
4
|
-
import type { User } from '@oxyhq/core';
|
|
4
|
+
import type { AuthorizedApp, User } from '@oxyhq/core';
|
|
5
5
|
import { queryKeys } from './queryKeys';
|
|
6
6
|
import { mutationKeys } from '../mutations/mutationKeys';
|
|
7
7
|
import { useOxy } from '../../context/OxyContext';
|
|
@@ -204,6 +204,30 @@ export const useUsersBySessions = (sessionIds: string[], options?: { enabled?: b
|
|
|
204
204
|
});
|
|
205
205
|
};
|
|
206
206
|
|
|
207
|
+
/**
|
|
208
|
+
* List the authenticated user's authorized RP apps (FedCM grants).
|
|
209
|
+
*
|
|
210
|
+
* Returns the intersection of the user's grants with the currently-approved
|
|
211
|
+
* RP catalog. Drives the "Connected apps" management screen.
|
|
212
|
+
*/
|
|
213
|
+
export const useAuthorizedApps = (options?: { enabled?: boolean }) => {
|
|
214
|
+
const { oxyServices, activeSessionId, isAuthenticated } = useOxy();
|
|
215
|
+
|
|
216
|
+
return useQuery<AuthorizedApp[]>({
|
|
217
|
+
queryKey: queryKeys.connectedApps.list(),
|
|
218
|
+
queryFn: async () => {
|
|
219
|
+
return authenticatedApiCall<AuthorizedApp[]>(
|
|
220
|
+
oxyServices,
|
|
221
|
+
activeSessionId,
|
|
222
|
+
() => oxyServices.listAuthorizedApps()
|
|
223
|
+
);
|
|
224
|
+
},
|
|
225
|
+
enabled: (options?.enabled !== false) && isAuthenticated,
|
|
226
|
+
staleTime: 30 * 1000, // 30 seconds — short, drives a management UI
|
|
227
|
+
gcTime: 5 * 60 * 1000,
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
|
|
207
231
|
/**
|
|
208
232
|
* Get privacy settings for a user
|
|
209
233
|
*/
|
package/src/ui/hooks/useAuth.ts
CHANGED
|
@@ -50,8 +50,14 @@ export interface AuthActions {
|
|
|
50
50
|
* Sign in
|
|
51
51
|
* - Web: Opens popup to auth.oxy.so (no public key needed)
|
|
52
52
|
* - Native: Uses cryptographic identity from keychain
|
|
53
|
+
*
|
|
54
|
+
* @param publicKey - Native: identity public key. Ignored on web.
|
|
55
|
+
* @param preOpenedPopup - Web only: a popup the caller already opened
|
|
56
|
+
* SYNCHRONOUSLY on the raw click via `oxyServices.openBlankPopup()`. This
|
|
57
|
+
* keeps Chrome's user-activation alive across any prior `await` and is
|
|
58
|
+
* the only reliable way to avoid the popup blocker on cross-domain flows.
|
|
53
59
|
*/
|
|
54
|
-
signIn: (publicKey?: string) => Promise<User>;
|
|
60
|
+
signIn: (publicKey?: string, preOpenedPopup?: Window | null) => Promise<User>;
|
|
55
61
|
|
|
56
62
|
/**
|
|
57
63
|
* Sign out current session
|
|
@@ -72,7 +78,7 @@ export interface AuthActions {
|
|
|
72
78
|
export interface UseAuthReturn extends AuthState, AuthActions {
|
|
73
79
|
/** Access to full OxyServices instance for advanced usage */
|
|
74
80
|
oxyServices: ReturnType<typeof useOxy>['oxyServices'];
|
|
75
|
-
/** Open a bottom sheet screen (e.g. '
|
|
81
|
+
/** Open a bottom sheet screen (e.g. 'ManageAccount', 'FileManagement') */
|
|
76
82
|
showBottomSheet: ReturnType<typeof useOxy>['showBottomSheet'];
|
|
77
83
|
/** Open the avatar picker bottom sheet */
|
|
78
84
|
openAvatarPicker: ReturnType<typeof useOxy>['openAvatarPicker'];
|
|
@@ -106,7 +112,7 @@ export function useAuth(): UseAuthReturn {
|
|
|
106
112
|
openAvatarPicker,
|
|
107
113
|
} = useOxy();
|
|
108
114
|
|
|
109
|
-
const signIn = useCallback(async (publicKey?: string): Promise<User> => {
|
|
115
|
+
const signIn = useCallback(async (publicKey?: string, preOpenedPopup?: Window | null): Promise<User> => {
|
|
110
116
|
// Check if we're on the identity provider itself
|
|
111
117
|
// Only the IdP has local login forms - other apps are client apps
|
|
112
118
|
const authWebUrl = oxyServices.config?.authWebUrl;
|
|
@@ -122,8 +128,18 @@ export function useAuth(): UseAuthReturn {
|
|
|
122
128
|
// FedCM silent SSO already runs on page load via useWebSSO
|
|
123
129
|
// If user is clicking "Sign In", they need interactive auth NOW
|
|
124
130
|
if (isWebBrowser() && !publicKey && !isIdentityProvider) {
|
|
131
|
+
// Open the popup SYNCHRONOUSLY before any `await` runs so Chrome's
|
|
132
|
+
// transient user-activation is preserved across the async chain
|
|
133
|
+
// (React state updates + the `await` into `signInWithPopup`). If the
|
|
134
|
+
// caller already pre-opened one (e.g. they did so to be extra safe
|
|
135
|
+
// ahead of their own awaits), reuse it.
|
|
136
|
+
const popup: Window | null = preOpenedPopup
|
|
137
|
+
?? oxyServices.openBlankPopup?.()
|
|
138
|
+
?? null;
|
|
125
139
|
try {
|
|
126
|
-
const popupSession = await oxyServices.signInWithPopup?.(
|
|
140
|
+
const popupSession = await oxyServices.signInWithPopup?.({
|
|
141
|
+
popup,
|
|
142
|
+
});
|
|
127
143
|
if (popupSession?.user) {
|
|
128
144
|
// The popup auth flow fetches full user data, so the session user
|
|
129
145
|
// contains full User fields even though the base type is MinimalUserData.
|
|
@@ -137,6 +153,9 @@ export function useAuth(): UseAuthReturn {
|
|
|
137
153
|
}
|
|
138
154
|
throw new Error('Sign-in failed. Please try again.');
|
|
139
155
|
} catch (popupError) {
|
|
156
|
+
if (popup && !popup.closed) {
|
|
157
|
+
popup.close();
|
|
158
|
+
}
|
|
140
159
|
if (popupError instanceof Error && popupError.message.includes('blocked')) {
|
|
141
160
|
throw new Error('Popup blocked. Please allow popups for this site.');
|
|
142
161
|
}
|
|
@@ -8,6 +8,8 @@ import { handleAuthError, isInvalidSessionError } from '../utils/errorHandlers';
|
|
|
8
8
|
import type { OxyServices } from '@oxyhq/core';
|
|
9
9
|
import type { QueryClient } from '@tanstack/react-query';
|
|
10
10
|
import { clearQueryCache } from './queryClient';
|
|
11
|
+
import { isWebBrowser } from './useWebSSO';
|
|
12
|
+
import { writeActiveAuthuser } from '../utils/activeAuthuser';
|
|
11
13
|
|
|
12
14
|
export interface UseSessionManagementOptions {
|
|
13
15
|
oxyServices: OxyServices;
|
|
@@ -265,6 +267,33 @@ export const useSessionManagement = ({
|
|
|
265
267
|
const switchSession = useCallback(
|
|
266
268
|
async (sessionId: string): Promise<User> => {
|
|
267
269
|
try {
|
|
270
|
+
// Web multi-account: when the target session was sourced from
|
|
271
|
+
// `refreshAllSessions` it carries its `authuser` slot index. We
|
|
272
|
+
// proactively plant that slot's access token via the httpOnly
|
|
273
|
+
// refresh cookie BEFORE validating, so the bearer-protected
|
|
274
|
+
// validate/getCurrentUser calls don't need a token that was never
|
|
275
|
+
// in memory (cold reload / different browser tab). The native path
|
|
276
|
+
// has no per-session cookies and continues to rely on
|
|
277
|
+
// `validateSession` + `getTokenBySession` directly.
|
|
278
|
+
if (isWebBrowser()) {
|
|
279
|
+
const targetSession = sessionsRef.current.find((s) => s.sessionId === sessionId);
|
|
280
|
+
const targetAuthuser = targetSession?.authuser;
|
|
281
|
+
if (typeof targetAuthuser === 'number') {
|
|
282
|
+
const refreshed = await oxyServices.refreshTokenViaCookie({ authuser: targetAuthuser });
|
|
283
|
+
if (refreshed === null) {
|
|
284
|
+
// Slot's refresh cookie is missing / expired / reused. Fall
|
|
285
|
+
// through to the invalid-session branch below by throwing the
|
|
286
|
+
// canonical invalid-session error.
|
|
287
|
+
throw new Error('Session is invalid or expired');
|
|
288
|
+
}
|
|
289
|
+
// Plant the slot's fresh access token; subsequent bearer calls
|
|
290
|
+
// (`validateSession`, `getCurrentUser`) will use it. The server
|
|
291
|
+
// also rotated the cookie at this point.
|
|
292
|
+
oxyServices.httpService.setTokens(refreshed.accessToken);
|
|
293
|
+
writeActiveAuthuser(targetAuthuser);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
268
297
|
const validation = await oxyServices.validateSession(sessionId, { useHeaderValidation: true });
|
|
269
298
|
if (!validation?.valid) {
|
|
270
299
|
throw new Error('Session is invalid or expired');
|
package/src/ui/index.ts
CHANGED
|
@@ -1,110 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @oxyhq/services/ui — public subpath
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Tree-shakeable static re-exports of the most common UI surface. Backend
|
|
5
|
+
* environments (SSR) should import `@oxyhq/services/ui/server` instead;
|
|
6
|
+
* client-only callers can use `@oxyhq/services/ui/client` for a slightly
|
|
7
|
+
* narrower bundle.
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* // Client bundle (tree-shakeable)
|
|
14
|
-
* import { OxyProvider, useOxy } from '@oxyhq/services/ui/client';
|
|
15
|
-
*
|
|
16
|
-
* // SSR (noops)
|
|
17
|
-
* import { OxyProvider, useOxy } from '@oxyhq/services/ui/server';
|
|
9
|
+
* Static `export ... from` only — no runtime `require()`, no platform
|
|
10
|
+
* conditionals. The previous `if (isFrontend) require(...)` pattern was
|
|
11
|
+
* removed because it (a) violated the dual CJS/ESM build rule (ESM bundles
|
|
12
|
+
* cannot contain `require()` per CLAUDE.md) and (b) defeated tree-shaking.
|
|
18
13
|
*/
|
|
19
|
-
import isFrontend from './isFrontend';
|
|
20
14
|
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let useAuth;
|
|
33
|
-
let useFollow;
|
|
34
|
-
let ProfileScreen;
|
|
35
|
-
let useAuthStore;
|
|
36
|
-
let useAccountStore;
|
|
37
|
-
let useStorage;
|
|
15
|
+
// Components
|
|
16
|
+
export { default as OxyProvider } from './components/OxyProvider';
|
|
17
|
+
export { default as OxySignInButton } from './components/OxySignInButton';
|
|
18
|
+
export { default as OxyLogo } from './components/OxyLogo';
|
|
19
|
+
export { default as Avatar } from './components/Avatar';
|
|
20
|
+
export { default as FollowButton } from './components/FollowButton';
|
|
21
|
+
export { default as OxyPayButton } from './components/OxyPayButton';
|
|
22
|
+
export { FontLoader, setupFonts } from './components/FontLoader';
|
|
23
|
+
export { default as OxyIcon } from './components/icon/OxyIcon';
|
|
24
|
+
export { default as AccountMenu } from './components/AccountMenu';
|
|
25
|
+
export { default as AccountMenuButton } from './components/AccountMenuButton';
|
|
38
26
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
OxyPayButton = require('./components/OxyPayButton').default;
|
|
46
|
-
FontLoader = require('./components/FontLoader').FontLoader;
|
|
47
|
-
setupFonts = require('./components/FontLoader').setupFonts;
|
|
48
|
-
OxyIcon = require('./components/icon').OxyIcon;
|
|
49
|
-
useOxy = require('./context/OxyContext').useOxy;
|
|
50
|
-
useAuth = require('./hooks/useAuth').useAuth;
|
|
51
|
-
useFollow = require('./hooks').useFollow;
|
|
52
|
-
ProfileScreen = require('./screens/ProfileScreen').default;
|
|
53
|
-
useAuthStore = require('./stores/authStore').useAuthStore;
|
|
54
|
-
useAccountStore = require('./stores/accountStore').useAccountStore;
|
|
55
|
-
useStorage = require('./hooks/useStorage').useStorage;
|
|
56
|
-
} else {
|
|
57
|
-
// Backend: no-op fallbacks
|
|
58
|
-
const noopComponent = () => null;
|
|
59
|
-
const noopHook = () => ({});
|
|
60
|
-
const noopStorageResult = { storage: null, isReady: false };
|
|
27
|
+
// Context + hooks
|
|
28
|
+
export { useOxy } from './context/OxyContext';
|
|
29
|
+
export { useAuth } from './hooks/useAuth';
|
|
30
|
+
export { useFollow } from './hooks/useFollow';
|
|
31
|
+
export { useStorage } from './hooks/useStorage';
|
|
32
|
+
export type { UseStorageOptions, UseStorageResult } from './hooks/useStorage';
|
|
61
33
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Avatar = noopComponent;
|
|
66
|
-
FollowButton = noopComponent;
|
|
67
|
-
OxyPayButton = noopComponent;
|
|
68
|
-
FontLoader = noopComponent;
|
|
69
|
-
setupFonts = () => {};
|
|
70
|
-
OxyIcon = noopComponent;
|
|
71
|
-
useOxy = noopHook;
|
|
72
|
-
useAuth = noopHook;
|
|
73
|
-
useFollow = noopHook;
|
|
74
|
-
ProfileScreen = noopComponent;
|
|
75
|
-
useAuthStore = noopHook;
|
|
76
|
-
useAccountStore = noopHook;
|
|
77
|
-
useStorage = () => noopStorageResult;
|
|
78
|
-
}
|
|
34
|
+
// Screens
|
|
35
|
+
export { default as ProfileScreen } from './screens/ProfileScreen';
|
|
36
|
+
export { default as ManageAccountScreen } from './screens/ManageAccountScreen';
|
|
79
37
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
OxyLogo,
|
|
84
|
-
Avatar,
|
|
85
|
-
FollowButton,
|
|
86
|
-
OxyPayButton,
|
|
87
|
-
FontLoader,
|
|
88
|
-
setupFonts,
|
|
89
|
-
OxyIcon,
|
|
90
|
-
useOxy,
|
|
91
|
-
useAuth,
|
|
92
|
-
useFollow,
|
|
93
|
-
ProfileScreen,
|
|
94
|
-
useAuthStore,
|
|
95
|
-
useAccountStore,
|
|
96
|
-
useStorage,
|
|
97
|
-
};
|
|
38
|
+
// Stores
|
|
39
|
+
export { useAuthStore } from './stores/authStore';
|
|
40
|
+
export { useAccountStore } from './stores/accountStore';
|
|
98
41
|
|
|
99
|
-
|
|
100
|
-
// Export error handler utilities (pure functions, no conditional needed)
|
|
42
|
+
// Error handlers (pure functions)
|
|
101
43
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
44
|
+
handleAuthError,
|
|
45
|
+
isInvalidSessionError,
|
|
46
|
+
isTimeoutOrNetworkError,
|
|
47
|
+
extractErrorMessage,
|
|
106
48
|
} from './utils/errorHandlers';
|
|
107
49
|
export type { HandleAuthErrorOptions } from './utils/errorHandlers';
|
|
108
|
-
|
|
109
|
-
// Export useStorage hook and types (kept for external consumers)
|
|
110
|
-
export type { UseStorageOptions, UseStorageResult } from './hooks/useStorage';
|
|
@@ -8,12 +8,8 @@ import type { BaseScreenProps } from '../types/navigation';
|
|
|
8
8
|
// Define all available route names
|
|
9
9
|
export type RouteName =
|
|
10
10
|
| 'OxyAuth' // Sign in with Oxy (QR code / deep link to Accounts app)
|
|
11
|
-
| '
|
|
12
|
-
| 'AccountSettings'
|
|
13
|
-
| 'AccountCenter'
|
|
14
|
-
| 'AccountSwitcher'
|
|
11
|
+
| 'ManageAccount' // Unified "Manage your Oxy Account" surface
|
|
15
12
|
| 'AccountVerification'
|
|
16
|
-
| 'SessionManagement'
|
|
17
13
|
| 'PaymentGateway'
|
|
18
14
|
| 'Profile'
|
|
19
15
|
| 'LanguageSelector'
|
|
@@ -41,18 +37,17 @@ export type RouteName =
|
|
|
41
37
|
| 'FollowersList' // List of user's followers
|
|
42
38
|
| 'FollowingList' // List of users being followed
|
|
43
39
|
| 'CreateManagedAccount' // Create a new managed sub-account
|
|
44
|
-
| 'AvatarCrop'
|
|
40
|
+
| 'AvatarCrop' // Square-crop editor presented before avatar upload
|
|
41
|
+
| 'Notifications' // Per-channel notification preferences
|
|
42
|
+
| 'ConnectedApps' // FedCM-authorized RP apps the user can revoke
|
|
43
|
+
| 'Preferences'; // General user preferences (theme, reduce-motion, etc.)
|
|
45
44
|
|
|
46
45
|
// Lazy screen loaders - functions that return screen components on-demand
|
|
47
46
|
// This breaks the require cycle by deferring imports until screens are actually needed
|
|
48
47
|
const screenLoaders: Record<RouteName, () => ComponentType<BaseScreenProps>> = {
|
|
49
48
|
OxyAuth: () => require('../screens/OxyAuthScreen').default,
|
|
50
|
-
|
|
51
|
-
AccountSettings: () => require('../screens/AccountSettingsScreen').default,
|
|
52
|
-
AccountCenter: () => require('../screens/AccountCenterScreen').default,
|
|
53
|
-
AccountSwitcher: () => require('../screens/AccountSwitcherScreen').default,
|
|
49
|
+
ManageAccount: () => require('../screens/ManageAccountScreen').default,
|
|
54
50
|
AccountVerification: () => require('../screens/AccountVerificationScreen').default,
|
|
55
|
-
SessionManagement: () => require('../screens/SessionManagementScreen').default,
|
|
56
51
|
PaymentGateway: () => require('../screens/PaymentGatewayScreen').default,
|
|
57
52
|
Profile: () => require('../screens/ProfileScreen').default,
|
|
58
53
|
LanguageSelector: () => require('../screens/LanguageSelectorScreen').default,
|
|
@@ -84,6 +79,9 @@ const screenLoaders: Record<RouteName, () => ComponentType<BaseScreenProps>> = {
|
|
|
84
79
|
FollowingList: () => require('../screens/FollowingListScreen').default,
|
|
85
80
|
CreateManagedAccount: () => require('../screens/CreateManagedAccountScreen').default,
|
|
86
81
|
AvatarCrop: () => require('../screens/AvatarCropScreen').default,
|
|
82
|
+
Notifications: () => require('../screens/NotificationsScreen').default,
|
|
83
|
+
ConnectedApps: () => require('../screens/ConnectedAppsScreen').default,
|
|
84
|
+
Preferences: () => require('../screens/PreferencesScreen').default,
|
|
87
85
|
};
|
|
88
86
|
|
|
89
87
|
// Cache loaded components to avoid re-requiring
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import type { BaseScreenProps } from '../types/navigation';
|
|
12
12
|
import { Dialog, toast, useDialogControl } from '@oxyhq/bloom';
|
|
13
|
-
import
|
|
13
|
+
import Header from '../components/Header';
|
|
14
14
|
import { SettingsListGroup } from '@oxyhq/bloom/settings-list';
|
|
15
15
|
import { useI18n } from '../hooks/useI18n';
|
|
16
16
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
|
+
import { ActivityIndicator, FlatList, RefreshControl, StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Dialog, toast, useDialogControl } from '@oxyhq/bloom';
|
|
4
|
+
import { useTheme } from '@oxyhq/bloom/theme';
|
|
5
|
+
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
6
|
+
import type { AuthorizedApp } from '@oxyhq/core';
|
|
7
|
+
import { logger as loggerUtil } from '@oxyhq/core';
|
|
8
|
+
import type { BaseScreenProps } from '../types/navigation';
|
|
9
|
+
import Header from '../components/Header';
|
|
10
|
+
import EmptyState from '../components/EmptyState';
|
|
11
|
+
import { SettingsIcon } from '../components/SettingsIcon';
|
|
12
|
+
import { useI18n } from '../hooks/useI18n';
|
|
13
|
+
import { useOxy } from '../context/OxyContext';
|
|
14
|
+
import { useAuthorizedApps } from '../hooks/queries/useAccountQueries';
|
|
15
|
+
import { useRevokeAuthorizedApp } from '../hooks/mutations/useAccountMutations';
|
|
16
|
+
import { useColorScheme } from '../hooks/useColorScheme';
|
|
17
|
+
import { Colors } from '../constants/theme';
|
|
18
|
+
import { normalizeColorScheme, normalizeTheme } from '../utils/themeUtils';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Format an ISO-8601 timestamp as a human-readable relative time. Mirrors the
|
|
22
|
+
* formatter used in ManageAccountScreen — kept local to avoid pulling a new
|
|
23
|
+
* shared module into the package public surface for one consumer.
|
|
24
|
+
*/
|
|
25
|
+
const formatRelative = (iso: string): string => {
|
|
26
|
+
const date = new Date(iso);
|
|
27
|
+
if (Number.isNaN(date.getTime())) {
|
|
28
|
+
return '—';
|
|
29
|
+
}
|
|
30
|
+
const diffMs = Date.now() - date.getTime();
|
|
31
|
+
const absMin = Math.abs(diffMs) / 60000;
|
|
32
|
+
if (absMin < 1) return 'just now';
|
|
33
|
+
if (absMin < 60) return `${Math.floor(absMin)}m ago`;
|
|
34
|
+
const hrs = absMin / 60;
|
|
35
|
+
if (hrs < 24) return `${Math.floor(hrs)}h ago`;
|
|
36
|
+
const days = hrs / 24;
|
|
37
|
+
if (days < 7) return `${Math.floor(days)}d ago`;
|
|
38
|
+
return date.toLocaleDateString();
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* ConnectedAppsScreen — list and revoke FedCM-authorized RP applications.
|
|
43
|
+
*
|
|
44
|
+
* Fetches via `useAuthorizedApps` (drives `GET /fedcm/me/authorized-apps`)
|
|
45
|
+
* and exposes a "Revoke" action that hits `DELETE /fedcm/me/authorized-apps/
|
|
46
|
+
* :origin`. Each revoke invalidates the connected-apps query so the list
|
|
47
|
+
* refreshes immediately.
|
|
48
|
+
*/
|
|
49
|
+
const ConnectedAppsScreen: React.FC<BaseScreenProps> = ({ onClose, theme, goBack }) => {
|
|
50
|
+
const bloomTheme = useTheme();
|
|
51
|
+
const { t } = useI18n();
|
|
52
|
+
const colorScheme = useColorScheme();
|
|
53
|
+
const palette = useMemo(
|
|
54
|
+
() => Colors[normalizeColorScheme(colorScheme, normalizeTheme(theme))],
|
|
55
|
+
[colorScheme, theme],
|
|
56
|
+
);
|
|
57
|
+
const { isAuthenticated } = useOxy();
|
|
58
|
+
const {
|
|
59
|
+
data: apps,
|
|
60
|
+
isLoading,
|
|
61
|
+
refetch,
|
|
62
|
+
isRefetching,
|
|
63
|
+
} = useAuthorizedApps({ enabled: isAuthenticated });
|
|
64
|
+
const revokeMutation = useRevokeAuthorizedApp();
|
|
65
|
+
const revokeDialog = useDialogControl();
|
|
66
|
+
const [pendingRevoke, setPendingRevoke] = useState<AuthorizedApp | null>(null);
|
|
67
|
+
const [revokingOrigin, setRevokingOrigin] = useState<string | null>(null);
|
|
68
|
+
|
|
69
|
+
const confirmRevoke = useCallback(
|
|
70
|
+
(app: AuthorizedApp) => {
|
|
71
|
+
setPendingRevoke(app);
|
|
72
|
+
revokeDialog.open();
|
|
73
|
+
},
|
|
74
|
+
[revokeDialog],
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const handleRevoke = useCallback(async () => {
|
|
78
|
+
if (!pendingRevoke) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const target = pendingRevoke;
|
|
82
|
+
setRevokingOrigin(target.origin);
|
|
83
|
+
try {
|
|
84
|
+
await revokeMutation.mutateAsync(target.origin);
|
|
85
|
+
toast.success(
|
|
86
|
+
t('connectedApps.toasts.revoked', { name: target.name })
|
|
87
|
+
|| `Revoked access for ${target.name}`,
|
|
88
|
+
);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
loggerUtil.warn(
|
|
91
|
+
'Revoke authorized app failed',
|
|
92
|
+
{ component: 'ConnectedAppsScreen' },
|
|
93
|
+
error,
|
|
94
|
+
);
|
|
95
|
+
toast.error(
|
|
96
|
+
t('connectedApps.toasts.revokeFailed')
|
|
97
|
+
|| 'Failed to revoke access',
|
|
98
|
+
);
|
|
99
|
+
} finally {
|
|
100
|
+
setRevokingOrigin(null);
|
|
101
|
+
setPendingRevoke(null);
|
|
102
|
+
}
|
|
103
|
+
}, [pendingRevoke, revokeMutation, t]);
|
|
104
|
+
|
|
105
|
+
const renderEmpty = useCallback(
|
|
106
|
+
() => (
|
|
107
|
+
<View style={styles.emptyContainer}>
|
|
108
|
+
<EmptyState
|
|
109
|
+
message={
|
|
110
|
+
t('connectedApps.empty.subtitle')
|
|
111
|
+
|| 'Apps you authorize to sign in with your Oxy account will appear here'
|
|
112
|
+
}
|
|
113
|
+
textColor={bloomTheme.colors.textSecondary}
|
|
114
|
+
/>
|
|
115
|
+
</View>
|
|
116
|
+
),
|
|
117
|
+
[t, bloomTheme.colors.textSecondary],
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const renderItem = useCallback(
|
|
121
|
+
({ item }: { item: AuthorizedApp }) => {
|
|
122
|
+
const isRevoking = revokingOrigin === item.origin;
|
|
123
|
+
return (
|
|
124
|
+
<SettingsListGroup>
|
|
125
|
+
<SettingsListItem
|
|
126
|
+
icon={<SettingsIcon name="apps" color={palette.iconData} />}
|
|
127
|
+
title={item.name}
|
|
128
|
+
description={
|
|
129
|
+
t('connectedApps.item.lastUsed', {
|
|
130
|
+
relative: formatRelative(item.lastUsedAt),
|
|
131
|
+
})
|
|
132
|
+
|| `Last used ${formatRelative(item.lastUsedAt)}`
|
|
133
|
+
}
|
|
134
|
+
onPress={isRevoking ? undefined : () => confirmRevoke(item)}
|
|
135
|
+
disabled={isRevoking}
|
|
136
|
+
destructive
|
|
137
|
+
showChevron={false}
|
|
138
|
+
rightElement={
|
|
139
|
+
isRevoking ? (
|
|
140
|
+
<ActivityIndicator
|
|
141
|
+
color={bloomTheme.colors.error}
|
|
142
|
+
size="small"
|
|
143
|
+
/>
|
|
144
|
+
) : undefined
|
|
145
|
+
}
|
|
146
|
+
/>
|
|
147
|
+
</SettingsListGroup>
|
|
148
|
+
);
|
|
149
|
+
},
|
|
150
|
+
[bloomTheme.colors.error, confirmRevoke, palette.iconData, revokingOrigin, t],
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
return (
|
|
154
|
+
<View style={[styles.container, { backgroundColor: bloomTheme.colors.background }]}>
|
|
155
|
+
<Header
|
|
156
|
+
title={t('connectedApps.title') || 'Connected apps'}
|
|
157
|
+
onBack={goBack || onClose}
|
|
158
|
+
variant="minimal"
|
|
159
|
+
elevation="subtle"
|
|
160
|
+
/>
|
|
161
|
+
{isLoading && !apps ? (
|
|
162
|
+
<View style={styles.center}>
|
|
163
|
+
<ActivityIndicator color={bloomTheme.colors.primary} size="large" />
|
|
164
|
+
</View>
|
|
165
|
+
) : (
|
|
166
|
+
<FlatList
|
|
167
|
+
data={apps ?? []}
|
|
168
|
+
keyExtractor={(item) => item.origin}
|
|
169
|
+
renderItem={renderItem}
|
|
170
|
+
contentContainerStyle={styles.listContent}
|
|
171
|
+
ListEmptyComponent={renderEmpty}
|
|
172
|
+
refreshControl={
|
|
173
|
+
<RefreshControl
|
|
174
|
+
refreshing={isRefetching}
|
|
175
|
+
onRefresh={refetch}
|
|
176
|
+
tintColor={bloomTheme.colors.primary}
|
|
177
|
+
/>
|
|
178
|
+
}
|
|
179
|
+
/>
|
|
180
|
+
)}
|
|
181
|
+
<Dialog
|
|
182
|
+
control={revokeDialog}
|
|
183
|
+
title={t('connectedApps.confirm.title') || 'Revoke access'}
|
|
184
|
+
description={
|
|
185
|
+
pendingRevoke
|
|
186
|
+
? (t('connectedApps.confirm.message', { name: pendingRevoke.name })
|
|
187
|
+
|| `Revoke ${pendingRevoke.name}'s access to your Oxy account?`)
|
|
188
|
+
: ''
|
|
189
|
+
}
|
|
190
|
+
actions={[
|
|
191
|
+
{
|
|
192
|
+
label: t('common.revoke') || 'Revoke',
|
|
193
|
+
color: 'destructive',
|
|
194
|
+
onPress: handleRevoke,
|
|
195
|
+
},
|
|
196
|
+
{ label: t('common.cancel') || 'Cancel', color: 'cancel' },
|
|
197
|
+
]}
|
|
198
|
+
/>
|
|
199
|
+
</View>
|
|
200
|
+
);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const styles = StyleSheet.create({
|
|
204
|
+
container: {
|
|
205
|
+
flex: 1,
|
|
206
|
+
},
|
|
207
|
+
center: {
|
|
208
|
+
flex: 1,
|
|
209
|
+
alignItems: 'center',
|
|
210
|
+
justifyContent: 'center',
|
|
211
|
+
},
|
|
212
|
+
listContent: {
|
|
213
|
+
paddingHorizontal: 16,
|
|
214
|
+
paddingVertical: 16,
|
|
215
|
+
flexGrow: 1,
|
|
216
|
+
},
|
|
217
|
+
emptyContainer: {
|
|
218
|
+
flex: 1,
|
|
219
|
+
justifyContent: 'center',
|
|
220
|
+
alignItems: 'center',
|
|
221
|
+
paddingVertical: 48,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
export default React.memo(ConnectedAppsScreen);
|