@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
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
View,
|
|
5
|
-
Text,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
StyleSheet,
|
|
8
|
-
ScrollView,
|
|
9
|
-
ActivityIndicator,
|
|
10
|
-
Platform,
|
|
11
|
-
RefreshControl,
|
|
12
|
-
} from 'react-native';
|
|
13
|
-
import type { BaseScreenProps } from '../types/navigation';
|
|
14
|
-
import { screenContentStyle } from '../constants/spacing';
|
|
15
|
-
import { Dialog, toast, useDialogControl } from '@oxyhq/bloom';
|
|
16
|
-
import type { ClientSession } from '@oxyhq/core';
|
|
17
|
-
import { Header } from '../components';
|
|
18
|
-
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
19
|
-
import { SettingsIcon } from '../components/SettingsIcon';
|
|
20
|
-
import { useTheme } from '@oxyhq/bloom/theme';
|
|
21
|
-
import { useOxy } from '../context/OxyContext';
|
|
22
|
-
import { useI18n } from '../hooks/useI18n';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const SessionManagementScreen: React.FC<BaseScreenProps> = ({
|
|
26
|
-
onClose,
|
|
27
|
-
theme,
|
|
28
|
-
goBack,
|
|
29
|
-
}) => {
|
|
30
|
-
// Use useOxy() hook for OxyContext values
|
|
31
|
-
const {
|
|
32
|
-
sessions: userSessions,
|
|
33
|
-
activeSessionId,
|
|
34
|
-
refreshSessions,
|
|
35
|
-
logout,
|
|
36
|
-
logoutAll,
|
|
37
|
-
switchSession,
|
|
38
|
-
} = useOxy();
|
|
39
|
-
const { t } = useI18n();
|
|
40
|
-
const [loading, setLoading] = useState(true);
|
|
41
|
-
const [refreshing, setRefreshing] = useState(false);
|
|
42
|
-
const [actionLoading, setActionLoading] = useState<string | null>(null);
|
|
43
|
-
const [switchLoading, setSwitchLoading] = useState<string | null>(null);
|
|
44
|
-
const [lastRefreshed, setLastRefreshed] = useState<Date | null>(null);
|
|
45
|
-
const [pendingLogoutSessionId, setPendingLogoutSessionId] = useState<string | null>(null);
|
|
46
|
-
|
|
47
|
-
// Prompt controls
|
|
48
|
-
const logoutSessionDialog = useDialogControl();
|
|
49
|
-
const logoutOtherSessionsDialog = useDialogControl();
|
|
50
|
-
const logoutAllSessionsDialog = useDialogControl();
|
|
51
|
-
|
|
52
|
-
// Use bloom theme for non-style color props (ActivityIndicator, icon colors, etc.)
|
|
53
|
-
const bloomTheme = useTheme();
|
|
54
|
-
const primaryColor = bloomTheme.colors.primary;
|
|
55
|
-
const dangerColor = bloomTheme.colors.error;
|
|
56
|
-
const successColor = bloomTheme.colors.success;
|
|
57
|
-
|
|
58
|
-
// Memoized load sessions function - prevents unnecessary re-renders
|
|
59
|
-
const loadSessions = useCallback(async (isRefresh = false) => {
|
|
60
|
-
try {
|
|
61
|
-
if (isRefresh) {
|
|
62
|
-
setRefreshing(true);
|
|
63
|
-
} else {
|
|
64
|
-
setLoading(true);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
await refreshSessions();
|
|
68
|
-
setLastRefreshed(new Date());
|
|
69
|
-
} catch (error) {
|
|
70
|
-
if (__DEV__) {
|
|
71
|
-
console.error('Failed to load sessions:', error);
|
|
72
|
-
}
|
|
73
|
-
toast.error(t('sessionManagement.toasts.loadFailed'));
|
|
74
|
-
} finally {
|
|
75
|
-
setLoading(false);
|
|
76
|
-
setRefreshing(false);
|
|
77
|
-
}
|
|
78
|
-
}, [refreshSessions]);
|
|
79
|
-
|
|
80
|
-
// Confirm logout session - opens prompt
|
|
81
|
-
const confirmLogoutSession = useCallback((sessionId: string) => {
|
|
82
|
-
setPendingLogoutSessionId(sessionId);
|
|
83
|
-
logoutSessionDialog.open();
|
|
84
|
-
}, [logoutSessionDialog]);
|
|
85
|
-
|
|
86
|
-
// Handle logout session - executes after prompt confirmation
|
|
87
|
-
const handleLogoutSession = useCallback(async () => {
|
|
88
|
-
if (!pendingLogoutSessionId) return;
|
|
89
|
-
try {
|
|
90
|
-
setActionLoading(pendingLogoutSessionId);
|
|
91
|
-
await logout(pendingLogoutSessionId);
|
|
92
|
-
await refreshSessions();
|
|
93
|
-
toast.success(t('sessionManagement.toasts.logoutSuccess'));
|
|
94
|
-
} catch (error) {
|
|
95
|
-
if (__DEV__) {
|
|
96
|
-
console.error('Logout session failed:', error);
|
|
97
|
-
}
|
|
98
|
-
toast.error(t('sessionManagement.toasts.logoutFailed'));
|
|
99
|
-
} finally {
|
|
100
|
-
setActionLoading(null);
|
|
101
|
-
setPendingLogoutSessionId(null);
|
|
102
|
-
}
|
|
103
|
-
}, [pendingLogoutSessionId, logout, refreshSessions, t]);
|
|
104
|
-
|
|
105
|
-
// Memoized bulk action items - prevents unnecessary re-renders when dependencies haven't changed
|
|
106
|
-
const otherSessionsCount = useMemo(() =>
|
|
107
|
-
userSessions.filter(s => s.sessionId !== activeSessionId).length,
|
|
108
|
-
[userSessions, activeSessionId]
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
// Confirm logout other sessions - opens prompt
|
|
112
|
-
const confirmLogoutOtherSessions = useCallback(() => {
|
|
113
|
-
if (otherSessionsCount === 0) {
|
|
114
|
-
toast.info(t('sessionManagement.toasts.noOtherSessions'));
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
logoutOtherSessionsDialog.open();
|
|
118
|
-
}, [otherSessionsCount, logoutOtherSessionsDialog, t]);
|
|
119
|
-
|
|
120
|
-
// Handle logout other sessions - executes after prompt confirmation
|
|
121
|
-
const handleLogoutOtherSessions = useCallback(async () => {
|
|
122
|
-
try {
|
|
123
|
-
setActionLoading('others');
|
|
124
|
-
for (const session of userSessions) {
|
|
125
|
-
if (session.sessionId !== activeSessionId) {
|
|
126
|
-
await logout(session.sessionId);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
await refreshSessions();
|
|
130
|
-
toast.success(t('sessionManagement.toasts.logoutOthersSuccess'));
|
|
131
|
-
} catch (error) {
|
|
132
|
-
if (__DEV__) {
|
|
133
|
-
console.error('Logout other sessions failed:', error);
|
|
134
|
-
}
|
|
135
|
-
toast.error(t('sessionManagement.toasts.logoutOthersFailed'));
|
|
136
|
-
} finally {
|
|
137
|
-
setActionLoading(null);
|
|
138
|
-
}
|
|
139
|
-
}, [userSessions, activeSessionId, logout, refreshSessions, t]);
|
|
140
|
-
|
|
141
|
-
// Confirm logout all sessions - opens prompt
|
|
142
|
-
const confirmLogoutAllSessions = useCallback(() => {
|
|
143
|
-
logoutAllSessionsDialog.open();
|
|
144
|
-
}, [logoutAllSessionsDialog]);
|
|
145
|
-
|
|
146
|
-
// Handle logout all sessions - executes after prompt confirmation
|
|
147
|
-
const handleLogoutAllSessions = useCallback(async () => {
|
|
148
|
-
try {
|
|
149
|
-
setActionLoading('all');
|
|
150
|
-
await logoutAll();
|
|
151
|
-
} catch (error) {
|
|
152
|
-
if (__DEV__) {
|
|
153
|
-
console.error('Logout all sessions failed:', error);
|
|
154
|
-
}
|
|
155
|
-
toast.error(t('sessionManagement.toasts.logoutAllFailed'));
|
|
156
|
-
} finally {
|
|
157
|
-
setActionLoading(null);
|
|
158
|
-
}
|
|
159
|
-
}, [logoutAll, t]);
|
|
160
|
-
|
|
161
|
-
// Memoized relative time formatter - prevents function recreation on every render
|
|
162
|
-
const formatRelative = useCallback((dateString?: string) => {
|
|
163
|
-
if (!dateString) return t('appInfo.items.unknown');
|
|
164
|
-
const date = new Date(dateString);
|
|
165
|
-
const now = new Date();
|
|
166
|
-
const diffMs = date.getTime() - now.getTime();
|
|
167
|
-
const absMin = Math.abs(diffMs) / 60000;
|
|
168
|
-
const isFuture = diffMs > 0;
|
|
169
|
-
const fmt = (n: number) => (n < 1 ? 'moments' : Math.floor(n));
|
|
170
|
-
if (absMin < 1) return isFuture ? 'in moments' : 'just now';
|
|
171
|
-
if (absMin < 60) return isFuture ? `in ${fmt(absMin)}m` : `${fmt(absMin)}m ago`;
|
|
172
|
-
const hrs = absMin / 60;
|
|
173
|
-
if (hrs < 24) return isFuture ? `in ${fmt(hrs)}h` : `${fmt(hrs)}h ago`;
|
|
174
|
-
const days = hrs / 24;
|
|
175
|
-
if (days < 7) return isFuture ? `in ${fmt(days)}d` : `${fmt(days)}d ago`;
|
|
176
|
-
return date.toLocaleDateString();
|
|
177
|
-
}, []);
|
|
178
|
-
|
|
179
|
-
// Memoized switch session handler - prevents unnecessary re-renders
|
|
180
|
-
const handleSwitchSession = useCallback(async (sessionId: string) => {
|
|
181
|
-
if (sessionId === activeSessionId) return;
|
|
182
|
-
setSwitchLoading(sessionId);
|
|
183
|
-
try {
|
|
184
|
-
await switchSession(sessionId);
|
|
185
|
-
toast.success(t('sessionManagement.toasts.switchSuccess'));
|
|
186
|
-
} catch (e) {
|
|
187
|
-
if (__DEV__) {
|
|
188
|
-
console.error('Switch session failed', e);
|
|
189
|
-
}
|
|
190
|
-
toast.error(t('sessionManagement.toasts.switchFailed'));
|
|
191
|
-
} finally {
|
|
192
|
-
setSwitchLoading(null);
|
|
193
|
-
}
|
|
194
|
-
}, [activeSessionId, switchSession]);
|
|
195
|
-
|
|
196
|
-
// Memoized refresh handler for pull-to-refresh
|
|
197
|
-
const handleRefresh = useCallback(() => {
|
|
198
|
-
loadSessions(true);
|
|
199
|
-
}, [loadSessions]);
|
|
200
|
-
|
|
201
|
-
useEffect(() => {
|
|
202
|
-
loadSessions();
|
|
203
|
-
}, [loadSessions]);
|
|
204
|
-
|
|
205
|
-
// Memoized session items - prevents unnecessary re-renders when dependencies haven't changed
|
|
206
|
-
const sessionItems = useMemo(() => {
|
|
207
|
-
return userSessions.map((session) => {
|
|
208
|
-
const isCurrent = session.sessionId === activeSessionId;
|
|
209
|
-
const subtitleParts: string[] = [];
|
|
210
|
-
if (session.deviceId) subtitleParts.push(`Device ${session.deviceId.substring(0, 10)}...`);
|
|
211
|
-
subtitleParts.push(`Last ${formatRelative(session.lastActive)}`);
|
|
212
|
-
subtitleParts.push(`Expires ${formatRelative(session.expiresAt)}`);
|
|
213
|
-
|
|
214
|
-
return {
|
|
215
|
-
id: session.sessionId,
|
|
216
|
-
icon: isCurrent ? 'shield-checkmark' : 'laptop-outline',
|
|
217
|
-
iconColor: isCurrent ? successColor : primaryColor,
|
|
218
|
-
title: isCurrent ? t('sessionManagement.currentSession') : t('sessionManagement.sessionLabel', { id: session.sessionId.substring(0, 8) }),
|
|
219
|
-
subtitle: subtitleParts.join(' \u2022 '),
|
|
220
|
-
showChevron: false,
|
|
221
|
-
multiRow: true,
|
|
222
|
-
customContentBelow: !isCurrent ? (
|
|
223
|
-
<View style={styles.sessionActionsRow}>
|
|
224
|
-
<TouchableOpacity
|
|
225
|
-
onPress={() => handleSwitchSession(session.sessionId)}
|
|
226
|
-
style={[styles.sessionPillButton, { backgroundColor: bloomTheme.colors.primarySubtle, borderColor: primaryColor }]}
|
|
227
|
-
disabled={switchLoading === session.sessionId || actionLoading === session.sessionId}
|
|
228
|
-
>
|
|
229
|
-
{switchLoading === session.sessionId ? (
|
|
230
|
-
<ActivityIndicator size="small" color={primaryColor} />
|
|
231
|
-
) : (
|
|
232
|
-
<Text style={[styles.sessionPillText, { color: primaryColor }]}>{t('sessionManagement.switch')}</Text>
|
|
233
|
-
)}
|
|
234
|
-
</TouchableOpacity>
|
|
235
|
-
<TouchableOpacity
|
|
236
|
-
onPress={() => confirmLogoutSession(session.sessionId)}
|
|
237
|
-
style={[styles.sessionPillButton, { backgroundColor: bloomTheme.colors.negativeSubtle, borderColor: dangerColor }]}
|
|
238
|
-
disabled={actionLoading === session.sessionId || switchLoading === session.sessionId}
|
|
239
|
-
>
|
|
240
|
-
{actionLoading === session.sessionId ? (
|
|
241
|
-
<ActivityIndicator size="small" color={dangerColor} />
|
|
242
|
-
) : (
|
|
243
|
-
<Text style={[styles.sessionPillText, { color: dangerColor }]}>{t('sessionManagement.logout')}</Text>
|
|
244
|
-
)}
|
|
245
|
-
</TouchableOpacity>
|
|
246
|
-
</View>
|
|
247
|
-
) : (
|
|
248
|
-
<View style={styles.sessionActionsRow}>
|
|
249
|
-
<Text style={[styles.currentBadgeText, { color: successColor, backgroundColor: `${successColor}20` }]}>{t('sessionManagement.active')}</Text>
|
|
250
|
-
</View>
|
|
251
|
-
),
|
|
252
|
-
selected: isCurrent,
|
|
253
|
-
dense: true,
|
|
254
|
-
};
|
|
255
|
-
});
|
|
256
|
-
}, [userSessions, activeSessionId, formatRelative, successColor, primaryColor, bloomTheme.colors.primarySubtle, bloomTheme.colors.negativeSubtle, switchLoading, actionLoading, handleSwitchSession, confirmLogoutSession, dangerColor, t]);
|
|
257
|
-
|
|
258
|
-
const bulkItems = useMemo(() => [
|
|
259
|
-
{
|
|
260
|
-
id: 'logout-others',
|
|
261
|
-
icon: 'exit-outline',
|
|
262
|
-
iconColor: primaryColor,
|
|
263
|
-
title: t('sessionManagement.logoutOthers.title'),
|
|
264
|
-
subtitle: otherSessionsCount === 0 ? t('sessionManagement.logoutOthers.noOtherSessions') : t('sessionManagement.logoutOthers.subtitle'),
|
|
265
|
-
onPress: confirmLogoutOtherSessions,
|
|
266
|
-
showChevron: false,
|
|
267
|
-
customContent: actionLoading === 'others' ? <ActivityIndicator size="small" color={primaryColor} /> : undefined,
|
|
268
|
-
disabled: actionLoading === 'others' || otherSessionsCount === 0,
|
|
269
|
-
dense: true,
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
id: 'logout-all',
|
|
273
|
-
icon: 'warning-outline',
|
|
274
|
-
iconColor: dangerColor,
|
|
275
|
-
title: t('sessionManagement.logoutAll.title'),
|
|
276
|
-
subtitle: t('sessionManagement.logoutAll.subtitle'),
|
|
277
|
-
onPress: confirmLogoutAllSessions,
|
|
278
|
-
showChevron: false,
|
|
279
|
-
customContent: actionLoading === 'all' ? <ActivityIndicator size="small" color={dangerColor} /> : undefined,
|
|
280
|
-
disabled: actionLoading === 'all',
|
|
281
|
-
dense: true,
|
|
282
|
-
},
|
|
283
|
-
], [otherSessionsCount, primaryColor, dangerColor, confirmLogoutOtherSessions, confirmLogoutAllSessions, actionLoading]);
|
|
284
|
-
|
|
285
|
-
if (loading) {
|
|
286
|
-
return (
|
|
287
|
-
<View style={[styles.container, styles.centerContent, { backgroundColor: bloomTheme.colors.background }]}>
|
|
288
|
-
<ActivityIndicator size="large" color={primaryColor} />
|
|
289
|
-
<Text style={styles.loadingText} className="text-foreground">{t('sessionManagement.loading')}</Text>
|
|
290
|
-
</View>
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return (
|
|
295
|
-
<View style={[styles.container, { backgroundColor: bloomTheme.colors.background }]}>
|
|
296
|
-
<Header
|
|
297
|
-
title={t('sessionManagement.title')}
|
|
298
|
-
subtitle={t('sessionManagement.subtitle')}
|
|
299
|
-
|
|
300
|
-
onBack={goBack || onClose}
|
|
301
|
-
elevation="subtle"
|
|
302
|
-
/>
|
|
303
|
-
<ScrollView
|
|
304
|
-
style={styles.scrollView}
|
|
305
|
-
contentContainerStyle={styles.scrollContainer}
|
|
306
|
-
refreshControl={
|
|
307
|
-
<RefreshControl
|
|
308
|
-
refreshing={refreshing}
|
|
309
|
-
onRefresh={handleRefresh}
|
|
310
|
-
tintColor={primaryColor}
|
|
311
|
-
/>
|
|
312
|
-
}
|
|
313
|
-
>
|
|
314
|
-
{userSessions.length > 0 ? (
|
|
315
|
-
<>
|
|
316
|
-
{lastRefreshed && (
|
|
317
|
-
<Text style={[styles.metaText, { color: bloomTheme.colors.textTertiary, marginBottom: 6 }]}>{t('sessionManagement.lastRefreshed', { time: formatRelative(lastRefreshed.toISOString()) })}</Text>
|
|
318
|
-
)}
|
|
319
|
-
<View style={styles.fullBleed}>
|
|
320
|
-
<SettingsListGroup>
|
|
321
|
-
{sessionItems.map(item => (
|
|
322
|
-
<SettingsListItem
|
|
323
|
-
key={item.id}
|
|
324
|
-
icon={<SettingsIcon name={item.icon} color={item.iconColor} />}
|
|
325
|
-
title={item.title}
|
|
326
|
-
description={item.subtitle}
|
|
327
|
-
showChevron={false}
|
|
328
|
-
rightElement={item.customContentBelow}
|
|
329
|
-
/>
|
|
330
|
-
))}
|
|
331
|
-
</SettingsListGroup>
|
|
332
|
-
</View>
|
|
333
|
-
<View style={styles.sectionSpacer} />
|
|
334
|
-
<View style={styles.fullBleed}>
|
|
335
|
-
<SettingsListGroup>
|
|
336
|
-
{bulkItems.map(item => (
|
|
337
|
-
<SettingsListItem
|
|
338
|
-
key={item.id}
|
|
339
|
-
icon={<SettingsIcon name={item.icon} color={item.iconColor} />}
|
|
340
|
-
title={item.title}
|
|
341
|
-
description={item.subtitle}
|
|
342
|
-
onPress={item.onPress}
|
|
343
|
-
showChevron={false}
|
|
344
|
-
disabled={item.disabled}
|
|
345
|
-
rightElement={item.customContent}
|
|
346
|
-
/>
|
|
347
|
-
))}
|
|
348
|
-
</SettingsListGroup>
|
|
349
|
-
</View>
|
|
350
|
-
</>
|
|
351
|
-
) : (
|
|
352
|
-
<View style={styles.emptyState}>
|
|
353
|
-
<Text style={[styles.emptyStateText, { color: bloomTheme.colors.textSecondary }]}>{t('sessionManagement.empty')}</Text>
|
|
354
|
-
</View>
|
|
355
|
-
)}
|
|
356
|
-
</ScrollView>
|
|
357
|
-
<View style={styles.footer} className="border-border">
|
|
358
|
-
<TouchableOpacity style={styles.closeButton} onPress={onClose}>
|
|
359
|
-
<Text style={styles.closeButtonText} className="text-primary">{t('sessionManagement.close')}</Text>
|
|
360
|
-
</TouchableOpacity>
|
|
361
|
-
</View>
|
|
362
|
-
<Dialog
|
|
363
|
-
control={logoutSessionDialog}
|
|
364
|
-
title={t('sessionManagement.confirms.logoutSessionTitle') || 'Log Out Session'}
|
|
365
|
-
description={t('sessionManagement.confirms.logoutSession')}
|
|
366
|
-
actions={[
|
|
367
|
-
{ label: t('sessionManagement.logout') || 'Log Out', color: 'destructive', onPress: handleLogoutSession },
|
|
368
|
-
{ label: t('common.cancel') || 'Cancel', color: 'cancel' },
|
|
369
|
-
]}
|
|
370
|
-
/>
|
|
371
|
-
<Dialog
|
|
372
|
-
control={logoutOtherSessionsDialog}
|
|
373
|
-
title={t('sessionManagement.confirms.logoutOthersTitle') || 'Log Out Other Sessions'}
|
|
374
|
-
description={t('sessionManagement.confirms.logoutOthers', { count: otherSessionsCount })}
|
|
375
|
-
actions={[
|
|
376
|
-
{ label: t('sessionManagement.logoutOthers.title') || 'Log Out Others', color: 'destructive', onPress: handleLogoutOtherSessions },
|
|
377
|
-
{ label: t('common.cancel') || 'Cancel', color: 'cancel' },
|
|
378
|
-
]}
|
|
379
|
-
/>
|
|
380
|
-
<Dialog
|
|
381
|
-
control={logoutAllSessionsDialog}
|
|
382
|
-
title={t('sessionManagement.confirms.logoutAllTitle') || 'Log Out All Sessions'}
|
|
383
|
-
description={t('sessionManagement.confirms.logoutAll')}
|
|
384
|
-
actions={[
|
|
385
|
-
{ label: t('sessionManagement.logoutAll.title') || 'Log Out All', color: 'destructive', onPress: handleLogoutAllSessions },
|
|
386
|
-
{ label: t('common.cancel') || 'Cancel', color: 'cancel' },
|
|
387
|
-
]}
|
|
388
|
-
/>
|
|
389
|
-
</View>
|
|
390
|
-
);
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
const styles = StyleSheet.create({
|
|
394
|
-
container: {
|
|
395
|
-
flex: 1,
|
|
396
|
-
},
|
|
397
|
-
centerContent: {
|
|
398
|
-
justifyContent: 'center',
|
|
399
|
-
alignItems: 'center',
|
|
400
|
-
},
|
|
401
|
-
scrollView: {
|
|
402
|
-
flex: 1,
|
|
403
|
-
},
|
|
404
|
-
scrollContainer: {
|
|
405
|
-
...screenContentStyle,
|
|
406
|
-
paddingTop: 0, // Header handles top spacing
|
|
407
|
-
},
|
|
408
|
-
sessionActionsRow: {
|
|
409
|
-
flexDirection: 'row',
|
|
410
|
-
gap: 8,
|
|
411
|
-
marginTop: 6,
|
|
412
|
-
},
|
|
413
|
-
sessionPillButton: {
|
|
414
|
-
paddingHorizontal: 14,
|
|
415
|
-
paddingVertical: 6,
|
|
416
|
-
borderRadius: 20,
|
|
417
|
-
borderWidth: 1,
|
|
418
|
-
flexDirection: 'row',
|
|
419
|
-
alignItems: 'center',
|
|
420
|
-
},
|
|
421
|
-
sessionPillText: {
|
|
422
|
-
fontSize: 12,
|
|
423
|
-
fontWeight: '600',
|
|
424
|
-
letterSpacing: 0.3,
|
|
425
|
-
textTransform: 'uppercase',
|
|
426
|
-
},
|
|
427
|
-
currentBadgeText: {
|
|
428
|
-
fontSize: 12,
|
|
429
|
-
fontWeight: '600',
|
|
430
|
-
paddingHorizontal: 10,
|
|
431
|
-
paddingVertical: 4,
|
|
432
|
-
borderRadius: 16,
|
|
433
|
-
overflow: 'hidden',
|
|
434
|
-
textTransform: 'uppercase',
|
|
435
|
-
letterSpacing: 0.5,
|
|
436
|
-
},
|
|
437
|
-
metaText: {
|
|
438
|
-
fontSize: 12,
|
|
439
|
-
textTransform: 'uppercase',
|
|
440
|
-
letterSpacing: 0.5,
|
|
441
|
-
fontWeight: '600',
|
|
442
|
-
},
|
|
443
|
-
fullBleed: {
|
|
444
|
-
width: '100%',
|
|
445
|
-
alignSelf: 'stretch',
|
|
446
|
-
},
|
|
447
|
-
sectionSpacer: {
|
|
448
|
-
height: 12,
|
|
449
|
-
},
|
|
450
|
-
emptyState: {
|
|
451
|
-
alignItems: 'center',
|
|
452
|
-
paddingVertical: 40,
|
|
453
|
-
},
|
|
454
|
-
emptyStateText: {
|
|
455
|
-
fontSize: 16,
|
|
456
|
-
fontStyle: 'italic',
|
|
457
|
-
},
|
|
458
|
-
loadingText: {
|
|
459
|
-
fontSize: 16,
|
|
460
|
-
marginTop: 16,
|
|
461
|
-
},
|
|
462
|
-
footer: {
|
|
463
|
-
padding: 16,
|
|
464
|
-
borderTopWidth: 1,
|
|
465
|
-
alignItems: 'center',
|
|
466
|
-
},
|
|
467
|
-
closeButton: {
|
|
468
|
-
paddingVertical: 8,
|
|
469
|
-
paddingHorizontal: 16,
|
|
470
|
-
},
|
|
471
|
-
closeButtonText: {
|
|
472
|
-
fontSize: 16,
|
|
473
|
-
fontWeight: '600',
|
|
474
|
-
},
|
|
475
|
-
});
|
|
476
|
-
|
|
477
|
-
export default SessionManagementScreen;
|
package/src/ui/styles/index.ts
DELETED