@oxyhq/services 22.8.7 → 22.10.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 +24 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +150 -0
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -0
- package/lib/commonjs/ui/components/OxyAuthChooser.js +137 -40
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyConsentScreen.js +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +9 -29
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +1 -1
- package/lib/commonjs/ui/components/RequireOxyAuth.js +1 -1
- package/lib/commonjs/ui/components/SurfaceHeaderAction.js +63 -0
- package/lib/commonjs/ui/components/SurfaceHeaderAction.js.map +1 -0
- package/lib/commonjs/ui/components/SurfaceScreen.js +193 -0
- package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +46 -29
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +47 -23
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js +22 -12
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +1 -1
- package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js +83 -0
- package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +49 -4
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +34 -39
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js +46 -0
- package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +14 -2
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js +38 -56
- package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +7 -57
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaceBackBridge.js +68 -0
- package/lib/commonjs/ui/navigation/surfaceBackBridge.js.map +1 -0
- package/lib/commonjs/ui/navigation/surfaceNavStack.js +98 -0
- package/lib/commonjs/ui/navigation/surfaceNavStack.js.map +1 -0
- package/lib/commonjs/ui/navigation/surfaceRegistry.js +152 -0
- package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -0
- package/lib/commonjs/ui/navigation/surfaces.js +256 -0
- package/lib/commonjs/ui/navigation/surfaces.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +214 -283
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +88 -118
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +22 -36
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +219 -226
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +10 -14
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +24 -39
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +136 -158
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +29 -36
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileScreen.js +101 -109
- package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +10 -15
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +8 -16
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +219 -206
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +62 -69
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +63 -79
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +69 -98
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +8 -14
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +77 -94
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +99 -134
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/NotificationsScreen.js +69 -76
- package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -8
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PreferencesScreen.js +67 -74
- package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +55 -91
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +291 -304
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +100 -114
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +38 -45
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +44 -57
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +24 -31
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +14 -24
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +1 -1
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +9 -7
- package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js +66 -75
- package/lib/commonjs/ui/screens/trust/TrustAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +111 -139
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js +13 -20
- package/lib/commonjs/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +14 -27
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +68 -85
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +28 -36
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/types/surfaceScreen.js +6 -0
- package/lib/commonjs/ui/types/surfaceScreen.js.map +1 -0
- package/lib/module/index.js +12 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialogScreen.js +145 -0
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -0
- package/lib/module/ui/components/OxyAuthChooser.js +137 -40
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyConsentScreen.js +1 -1
- package/lib/module/ui/components/OxyProvider.js +10 -30
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +1 -1
- package/lib/module/ui/components/RequireOxyAuth.js +1 -1
- package/lib/module/ui/components/SurfaceHeaderAction.js +58 -0
- package/lib/module/ui/components/SurfaceHeaderAction.js.map +1 -0
- package/lib/module/ui/components/SurfaceScreen.js +188 -0
- package/lib/module/ui/components/SurfaceScreen.js.map +1 -0
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +46 -29
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.js +46 -23
- package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/module/ui/components/oxyAuthChooserStyles.js +22 -12
- package/lib/module/ui/components/oxyAuthChooserStyles.js.map +1 -1
- package/lib/module/ui/components/surfaces/ActionSheetSurface.js +78 -0
- package/lib/module/ui/components/surfaces/ActionSheetSurface.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +49 -4
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useAvatarPicker.js +34 -39
- package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
- package/lib/module/ui/hooks/useSurfaceHeader.js +42 -0
- package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -0
- package/lib/module/ui/hooks/useSwitchableAccounts.js +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +14 -2
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
- package/lib/module/ui/navigation/bottomSheetManager.js +37 -53
- package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +6 -56
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/navigation/surfaceBackBridge.js +63 -0
- package/lib/module/ui/navigation/surfaceBackBridge.js.map +1 -0
- package/lib/module/ui/navigation/surfaceNavStack.js +95 -0
- package/lib/module/ui/navigation/surfaceNavStack.js.map +1 -0
- package/lib/module/ui/navigation/surfaceRegistry.js +146 -0
- package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -0
- package/lib/module/ui/navigation/surfaces.js +244 -0
- package/lib/module/ui/navigation/surfaces.js.map +1 -0
- package/lib/module/ui/screens/AccountMembersScreen.js +218 -286
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +92 -121
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +25 -38
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +220 -227
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +10 -14
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +26 -40
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +139 -160
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +32 -38
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileScreen.js +102 -110
- package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +11 -15
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +10 -17
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +222 -208
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +64 -70
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +65 -81
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +71 -99
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +10 -15
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +78 -94
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +102 -137
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/NotificationsScreen.js +71 -77
- package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +4 -9
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PreferencesScreen.js +69 -75
- package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +58 -93
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +293 -305
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +102 -116
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +40 -46
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +46 -58
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +26 -32
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +14 -24
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +1 -1
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +8 -7
- package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustAboutScreen.js +67 -75
- package/lib/module/ui/screens/trust/TrustAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +112 -139
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustFAQScreen.js +15 -21
- package/lib/module/ui/screens/trust/TrustFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +14 -26
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +69 -85
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRulesScreen.js +30 -37
- package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/module/ui/types/surfaceScreen.js +4 -0
- package/lib/module/ui/types/surfaceScreen.js.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts +39 -0
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +3 -3
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +3 -2
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts +26 -0
- package/lib/typescript/commonjs/ui/components/SurfaceScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +17 -2
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts +19 -9
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
- package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts +7 -11
- package/lib/typescript/commonjs/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +31 -0
- package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +14 -2
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +24 -16
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +2 -60
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts +16 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts +51 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceNavStack.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +135 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts +79 -0
- package/lib/typescript/commonjs/ui/navigation/surfaces.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts +0 -4
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PreferencesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +8 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/surfaceScreen.d.ts +38 -0
- package/lib/typescript/commonjs/ui/types/surfaceScreen.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts +39 -0
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +3 -3
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts +3 -2
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +2 -2
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +1 -1
- package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts +16 -0
- package/lib/typescript/module/ui/components/SurfaceHeaderAction.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts +26 -0
- package/lib/typescript/module/ui/components/SurfaceScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +14 -4
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +17 -2
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts +19 -9
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts +38 -0
- package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts +7 -11
- package/lib/typescript/module/ui/hooks/useAvatarPicker.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +31 -0
- package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +14 -2
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +24 -16
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +2 -60
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts +16 -0
- package/lib/typescript/module/ui/navigation/surfaceBackBridge.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts +51 -0
- package/lib/typescript/module/ui/navigation/surfaceNavStack.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +135 -0
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/surfaces.d.ts +79 -0
- package/lib/typescript/module/ui/navigation/surfaces.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts +0 -4
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/NotificationsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PreferencesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustAboutScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustFAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +8 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/surfaceScreen.d.ts +38 -0
- package/lib/typescript/module/ui/types/surfaceScreen.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +12 -5
- package/src/ui/components/OxyAccountDialogScreen.tsx +148 -0
- package/src/ui/components/OxyAuthChooser.tsx +153 -33
- package/src/ui/components/OxyConsentScreen.tsx +1 -1
- package/src/ui/components/OxyProvider.tsx +12 -34
- package/src/ui/components/ProfileButton.tsx +2 -2
- package/src/ui/components/RequireOxyAuth.tsx +1 -1
- package/src/ui/components/SurfaceHeaderAction.tsx +60 -0
- package/src/ui/components/SurfaceScreen.tsx +226 -0
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +50 -36
- package/src/ui/components/modals/DeleteAccountModal.tsx +47 -26
- package/src/ui/components/oxyAuthChooserStyles.ts +22 -12
- package/src/ui/components/surfaces/ActionSheetSurface.tsx +98 -0
- package/src/ui/context/OxyContext.tsx +43 -3
- package/src/ui/hooks/useAvatarPicker.ts +53 -66
- package/src/ui/hooks/useSurfaceHeader.ts +56 -0
- package/src/ui/hooks/useSwitchableAccounts.ts +1 -1
- package/src/ui/navigation/__tests__/getSurfaceConfig.test.ts +39 -0
- package/src/ui/navigation/__tests__/surfaceNavStack.test.ts +68 -0
- package/src/ui/navigation/accountDialogManager.ts +14 -2
- package/src/ui/navigation/bottomSheetManager.ts +46 -73
- package/src/ui/navigation/routes.ts +7 -106
- package/src/ui/navigation/surfaceBackBridge.ts +69 -0
- package/src/ui/navigation/surfaceNavStack.ts +110 -0
- package/src/ui/navigation/surfaceRegistry.ts +240 -0
- package/src/ui/navigation/surfaces.ts +272 -0
- package/src/ui/screens/AccountMembersScreen.tsx +39 -100
- package/src/ui/screens/AccountSettingsScreen.tsx +32 -54
- package/src/ui/screens/AccountVerificationScreen.tsx +23 -51
- package/src/ui/screens/AppInfoScreen.tsx +6 -13
- package/src/ui/screens/AvatarCropScreen.tsx +8 -17
- package/src/ui/screens/ConnectedAppsScreen.tsx +39 -60
- package/src/ui/screens/CreateAccountScreen.tsx +13 -39
- package/src/ui/screens/EditProfileFieldScreen.tsx +30 -48
- package/src/ui/screens/EditProfileScreen.tsx +7 -16
- package/src/ui/screens/FAQScreen.tsx +9 -13
- package/src/ui/screens/FeedbackScreen.tsx +8 -22
- package/src/ui/screens/FileManagementScreen.tsx +191 -188
- package/src/ui/screens/HelpSupportScreen.tsx +7 -13
- package/src/ui/screens/HistoryViewScreen.tsx +26 -31
- package/src/ui/screens/LanguageSelectorScreen.tsx +12 -46
- package/src/ui/screens/LearnMoreUsernamesScreen.tsx +8 -16
- package/src/ui/screens/LegalDocumentsScreen.tsx +7 -22
- package/src/ui/screens/ManageAccountScreen.tsx +96 -165
- package/src/ui/screens/NotificationsScreen.tsx +7 -13
- package/src/ui/screens/PaymentGatewayScreen.tsx +3 -10
- package/src/ui/screens/PreferencesScreen.tsx +7 -13
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +52 -90
- package/src/ui/screens/PrivacySettingsScreen.tsx +9 -21
- package/src/ui/screens/ProfileScreen.tsx +9 -11
- package/src/ui/screens/SavesCollectionsScreen.tsx +7 -13
- package/src/ui/screens/SearchSettingsScreen.tsx +9 -21
- package/src/ui/screens/UserLinksScreen.tsx +7 -14
- package/src/ui/screens/UserListScreen.tsx +2 -5
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +1 -1
- package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +9 -7
- package/src/ui/screens/trust/TrustAboutScreen.tsx +10 -17
- package/src/ui/screens/trust/TrustCenterScreen.tsx +9 -28
- package/src/ui/screens/trust/TrustFAQScreen.tsx +15 -18
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +3 -5
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +11 -26
- package/src/ui/screens/trust/TrustRulesScreen.tsx +10 -13
- package/src/ui/types/navigation.ts +8 -0
- package/src/ui/types/surfaceScreen.ts +38 -0
- package/lib/commonjs/ui/components/BottomSheet.js +0 -49
- package/lib/commonjs/ui/components/BottomSheet.js.map +0 -1
- package/lib/commonjs/ui/components/BottomSheetRouter.js +0 -298
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +0 -1
- package/lib/commonjs/ui/components/Header.js +0 -305
- package/lib/commonjs/ui/components/Header.js.map +0 -1
- package/lib/commonjs/ui/components/OxyAccountDialog.js +0 -259
- package/lib/commonjs/ui/components/OxyAccountDialog.js.map +0 -1
- package/lib/module/ui/components/BottomSheet.js +0 -45
- package/lib/module/ui/components/BottomSheet.js.map +0 -1
- package/lib/module/ui/components/BottomSheetRouter.js +0 -292
- package/lib/module/ui/components/BottomSheetRouter.js.map +0 -1
- package/lib/module/ui/components/Header.js +0 -299
- package/lib/module/ui/components/Header.js.map +0 -1
- package/lib/module/ui/components/OxyAccountDialog.js +0 -254
- package/lib/module/ui/components/OxyAccountDialog.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts +0 -29
- package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts +0 -9
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/Header.d.ts +0 -33
- package/lib/typescript/commonjs/ui/components/Header.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +0 -37
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/BottomSheet.d.ts +0 -29
- package/lib/typescript/module/ui/components/BottomSheet.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts +0 -9
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/Header.d.ts +0 -33
- package/lib/typescript/module/ui/components/Header.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +0 -37
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +0 -1
- package/src/ui/components/BottomSheet.tsx +0 -48
- package/src/ui/components/BottomSheetRouter.tsx +0 -310
- package/src/ui/components/Header.tsx +0 -224
- package/src/ui/components/OxyAccountDialog.tsx +0 -243
- package/src/ui/navigation/__tests__/getSheetConfig.test.ts +0 -36
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import type { ViewStyle } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
surfaces as bloomSurfaces,
|
|
5
|
+
type PresentOptions,
|
|
6
|
+
type SurfaceControls,
|
|
7
|
+
} from '@oxyhq/bloom/surfaces';
|
|
8
|
+
import SurfaceScreen from '../components/SurfaceScreen';
|
|
9
|
+
import type { RouteName } from './routes';
|
|
10
|
+
import {
|
|
11
|
+
getSurfaceConfig,
|
|
12
|
+
getSurfacePresentation,
|
|
13
|
+
type SurfacePresentation,
|
|
14
|
+
type SurfaceProps,
|
|
15
|
+
type SurfaceResult,
|
|
16
|
+
type SurfaceRouteConfig,
|
|
17
|
+
} from './surfaceRegistry';
|
|
18
|
+
import { createSurfaceNavStack, type SurfaceNavStack } from './surfaceNavStack';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The SDK's typed surface API — a route registry layered on top of Bloom's
|
|
22
|
+
* content-agnostic surface stack (`@oxyhq/bloom/surfaces`).
|
|
23
|
+
*
|
|
24
|
+
* `present(route)` opens a NEW Bloom surface (the DEPTH axis) whose content is a
|
|
25
|
+
* {@link SurfaceScreen} driven by the route's own {@link SurfaceNavStack} (the
|
|
26
|
+
* NAV-WITHIN axis). Navigating within that surface mutates its nav stack and
|
|
27
|
+
* re-renders the SAME Bloom surface; presenting stacks another surface on top.
|
|
28
|
+
*
|
|
29
|
+
* Bloom coordinates z-order / backdrop / dismiss across every surface (SDK's and
|
|
30
|
+
* apps'), so nothing clashes.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/** Responsive "sheet": bottom sheet on narrow, centered card on wide. */
|
|
34
|
+
const SHEET_PLACEMENT = { base: 'bottom', md: 'center' } as const;
|
|
35
|
+
|
|
36
|
+
/** Full-bleed black canvas for the `'fullScreen'` approximation (image picker). */
|
|
37
|
+
const FULLSCREEN_SURFACE_STYLE: ViewStyle = { backgroundColor: '#000000', overflow: 'hidden' };
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Every SDK screen owns its own background + content padding + scroll region
|
|
41
|
+
* (they were authored for the bare `BottomSheet`). So the shared `Dialog` must
|
|
42
|
+
* NOT add its own `contentPadding` on top (that double-pads) — it owns only the
|
|
43
|
+
* structural chrome: the surface card, the size cap (`maxHeightRatio`) and the
|
|
44
|
+
* scroll boundary. `contentPadding: 0` makes the screen's own padding the single
|
|
45
|
+
* source, matching the image-picker (`fullScreen`) surface.
|
|
46
|
+
*/
|
|
47
|
+
const SDK_SURFACE_CHROME = { contentPadding: 0, maxHeightRatio: 0.9 } as const;
|
|
48
|
+
|
|
49
|
+
/** Map a route's presentation taxonomy onto concrete Bloom `Dialog` options. */
|
|
50
|
+
function bloomOptionsFor(config: SurfaceRouteConfig): PresentOptions {
|
|
51
|
+
// Threaded onto every placement so a route that owns its own scroll container
|
|
52
|
+
// (`scrollable: false`) opts out of the Dialog's internal ScrollView.
|
|
53
|
+
const scrollable = config.scrollable;
|
|
54
|
+
// Nav-header mode marker: turns on the Dialog's OWN sticky gradient nav bar +
|
|
55
|
+
// large collapsing title over its scroll content. The title/subtitle/action
|
|
56
|
+
// slots are contributed at runtime by the mounted screen via `useSurfaceHeader`
|
|
57
|
+
// (resolved in `SurfaceScreen`), so the seed here just enables the scaffold.
|
|
58
|
+
const header = config.header ? { largeTitle: true } : undefined;
|
|
59
|
+
switch (config.presentation) {
|
|
60
|
+
case 'center':
|
|
61
|
+
return { placement: 'center', scrollable, header, ...SDK_SURFACE_CHROME };
|
|
62
|
+
case 'drawer':
|
|
63
|
+
return { placement: { base: 'bottom', md: 'left' }, scrollable, header, ...SDK_SURFACE_CHROME };
|
|
64
|
+
case 'fullScreen':
|
|
65
|
+
// Approximate a full-screen surface with the shared `Dialog`: a tall
|
|
66
|
+
// sheet / large centered card, flush content, a black canvas and
|
|
67
|
+
// programmatic-only dismiss — matching the shipped image-picker Dialog.
|
|
68
|
+
return {
|
|
69
|
+
placement: SHEET_PLACEMENT,
|
|
70
|
+
contentPadding: 0,
|
|
71
|
+
maxWidth: 640,
|
|
72
|
+
maxHeightRatio: 0.9,
|
|
73
|
+
dismissOnBackdrop: false,
|
|
74
|
+
scrollable,
|
|
75
|
+
style: FULLSCREEN_SURFACE_STYLE,
|
|
76
|
+
panelStyle: FULLSCREEN_SURFACE_STYLE,
|
|
77
|
+
};
|
|
78
|
+
default:
|
|
79
|
+
return { placement: SHEET_PLACEMENT, scrollable, header, ...SDK_SURFACE_CHROME };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* A live handle to a presented SDK surface. Exposes DEPTH controls (`dismiss`,
|
|
85
|
+
* `result`) and NAV-WITHIN controls (`navigate`/`replace`/`goBack`/`setStep`) that
|
|
86
|
+
* drive this surface's own nav stack. Held by the `showBottomSheet` adapter (base
|
|
87
|
+
* surface) and by `OxyContext` (the AccountDialog surface).
|
|
88
|
+
*/
|
|
89
|
+
export interface SurfaceInstance<K extends RouteName = RouteName> {
|
|
90
|
+
readonly route: RouteName;
|
|
91
|
+
readonly presentation: SurfacePresentation;
|
|
92
|
+
navigate: (route: RouteName, props?: Record<string, unknown>) => void;
|
|
93
|
+
replace: (route: RouteName, props?: Record<string, unknown>) => void;
|
|
94
|
+
goBack: () => boolean;
|
|
95
|
+
canGoBack: () => boolean;
|
|
96
|
+
setStep: (step: number) => void;
|
|
97
|
+
dismiss: (result?: SurfaceResult<K>) => void;
|
|
98
|
+
readonly result: Promise<SurfaceResult<K> | undefined>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The type-erased handle the `showBottomSheet` adapter needs from a tracked
|
|
103
|
+
* surface: what it hosts, and how to drive/dismiss it. Kept result-type-free so
|
|
104
|
+
* the (generic) `SurfaceInstance<K>` never has to be widened into a shared array.
|
|
105
|
+
*/
|
|
106
|
+
interface TrackedSurface {
|
|
107
|
+
readonly route: RouteName;
|
|
108
|
+
readonly presentation: SurfacePresentation;
|
|
109
|
+
navigate: (route: RouteName, props?: Record<string, unknown>) => void;
|
|
110
|
+
goBack: () => boolean;
|
|
111
|
+
dismiss: () => void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Active SDK "route" surfaces (the `showBottomSheet` lineage), bottom → top.
|
|
116
|
+
* `present`/`presentRoute` register here; `presentDetached` (AccountDialog) does
|
|
117
|
+
* NOT, so the base-sheet navigation logic never treats the account modal as a
|
|
118
|
+
* navigable base. Entries self-remove when their surface is dismissed.
|
|
119
|
+
*/
|
|
120
|
+
const activeRouteSurfaces: TrackedSurface[] = [];
|
|
121
|
+
|
|
122
|
+
function presentInternal<K extends RouteName>(
|
|
123
|
+
route: K,
|
|
124
|
+
props: Record<string, unknown>,
|
|
125
|
+
opts: PresentOptions | undefined,
|
|
126
|
+
track: boolean,
|
|
127
|
+
): SurfaceInstance<K> {
|
|
128
|
+
const navStack = createSurfaceNavStack(route, props);
|
|
129
|
+
const config = getSurfaceConfig(route, props);
|
|
130
|
+
const bloomOpts: PresentOptions = { label: route, ...bloomOptionsFor(config), ...opts };
|
|
131
|
+
|
|
132
|
+
const result = bloomSurfaces.present<SurfaceResult<K>>((surface: SurfaceControls) =>
|
|
133
|
+
createElement(SurfaceScreen, {
|
|
134
|
+
navStack,
|
|
135
|
+
surface,
|
|
136
|
+
presentation: config.presentation,
|
|
137
|
+
dismissOnBackdrop: bloomOpts.dismissOnBackdrop ?? true,
|
|
138
|
+
}),
|
|
139
|
+
bloomOpts,
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
const instance: SurfaceInstance<K> = {
|
|
143
|
+
route,
|
|
144
|
+
presentation: config.presentation,
|
|
145
|
+
navigate: (nextRoute, nextProps) => {
|
|
146
|
+
const top = navStack.getTop();
|
|
147
|
+
if (top.route === nextRoute) navStack.replace(nextRoute, nextProps);
|
|
148
|
+
else navStack.navigate(nextRoute, nextProps);
|
|
149
|
+
},
|
|
150
|
+
replace: (nextRoute, nextProps) => navStack.replace(nextRoute, nextProps),
|
|
151
|
+
goBack: () => navStack.goBack(),
|
|
152
|
+
canGoBack: () => navStack.canGoBack(),
|
|
153
|
+
setStep: (step) => navStack.setStep(step),
|
|
154
|
+
dismiss: (dismissResult) => navStack.requestDismiss(dismissResult),
|
|
155
|
+
result,
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
if (track) {
|
|
159
|
+
const tracked: TrackedSurface = {
|
|
160
|
+
route: instance.route,
|
|
161
|
+
presentation: instance.presentation,
|
|
162
|
+
navigate: instance.navigate,
|
|
163
|
+
goBack: instance.goBack,
|
|
164
|
+
dismiss: () => instance.dismiss(),
|
|
165
|
+
};
|
|
166
|
+
activeRouteSurfaces.push(tracked);
|
|
167
|
+
result.finally(() => {
|
|
168
|
+
const index = activeRouteSurfaces.indexOf(tracked);
|
|
169
|
+
if (index >= 0) activeRouteSurfaces.splice(index, 1);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return instance;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Present a NEW route surface on top of the stack (the DEPTH axis). Resolves with
|
|
178
|
+
* the value the surface is dismissed with. Registered in the route-surface stack.
|
|
179
|
+
*/
|
|
180
|
+
export function present<K extends RouteName>(
|
|
181
|
+
route: K,
|
|
182
|
+
props?: SurfaceProps<K>,
|
|
183
|
+
opts?: PresentOptions,
|
|
184
|
+
): SurfaceInstance<K> {
|
|
185
|
+
return presentInternal(route, (props ?? {}) as Record<string, unknown>, opts, true);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Present a surface that is NOT part of the `showBottomSheet` base-navigation
|
|
190
|
+
* lineage (the AccountDialog modal). Otherwise identical to {@link present}.
|
|
191
|
+
*/
|
|
192
|
+
export function presentDetached<K extends RouteName>(
|
|
193
|
+
route: K,
|
|
194
|
+
props?: SurfaceProps<K>,
|
|
195
|
+
opts?: PresentOptions,
|
|
196
|
+
): SurfaceInstance<K> {
|
|
197
|
+
return presentInternal(route, (props ?? {}) as Record<string, unknown>, opts, false);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Untyped present for the adapter, the nav helpers, and the `SurfaceScreen`
|
|
202
|
+
* binding (where the route is a runtime value and its props are already erased).
|
|
203
|
+
*/
|
|
204
|
+
export function presentRoute(route: RouteName, props?: Record<string, unknown>): SurfaceInstance {
|
|
205
|
+
return presentInternal(route, props ?? {}, undefined, true);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** The top-most active route surface, or `undefined` when none are open. */
|
|
209
|
+
export function topRouteSurface(): TrackedSurface | undefined {
|
|
210
|
+
return activeRouteSurfaces[activeRouteSurfaces.length - 1];
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Dismiss every active route surface (the whole `showBottomSheet` session). The
|
|
215
|
+
* AccountDialog is untracked, so it is untouched. Iterates a snapshot because
|
|
216
|
+
* `dismiss` mutates `activeRouteSurfaces` asynchronously as surfaces settle.
|
|
217
|
+
*/
|
|
218
|
+
export function closeAllRouteSurfaces(): void {
|
|
219
|
+
for (const instance of [...activeRouteSurfaces].reverse()) instance.dismiss();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Drill in from a screen: navigate WITHIN the current surface when the target's
|
|
224
|
+
* presentation matches, else present the target as a NEW surface on top (so a
|
|
225
|
+
* sheet screen opening the full-bleed picker gets the right chrome).
|
|
226
|
+
*/
|
|
227
|
+
export function navigateWithinOrPresent(
|
|
228
|
+
currentPresentation: SurfacePresentation,
|
|
229
|
+
navStack: SurfaceNavStack,
|
|
230
|
+
route: RouteName,
|
|
231
|
+
props?: Record<string, unknown>,
|
|
232
|
+
): void {
|
|
233
|
+
const nextProps = props ?? {};
|
|
234
|
+
if (getSurfacePresentation(route, nextProps) === currentPresentation) {
|
|
235
|
+
navStack.navigate(route, nextProps);
|
|
236
|
+
} else {
|
|
237
|
+
presentRoute(route, nextProps);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** Replace variant of {@link navigateWithinOrPresent}. */
|
|
242
|
+
export function replaceWithinOrPresent(
|
|
243
|
+
currentPresentation: SurfacePresentation,
|
|
244
|
+
navStack: SurfaceNavStack,
|
|
245
|
+
route: RouteName,
|
|
246
|
+
props?: Record<string, unknown>,
|
|
247
|
+
): void {
|
|
248
|
+
const nextProps = props ?? {};
|
|
249
|
+
if (getSurfacePresentation(route, nextProps) === currentPresentation) {
|
|
250
|
+
navStack.replace(route, nextProps);
|
|
251
|
+
} else {
|
|
252
|
+
presentRoute(route, nextProps);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The SDK's imperative surface API (a module singleton). `present` is the typed
|
|
258
|
+
* route presenter; `dismissAll` unwinds the whole session. Not yet exported from
|
|
259
|
+
* the package root — the public `surfaces`/`useSurfaces` API lands in a later
|
|
260
|
+
* phase; for P1 the internal adapters (`showBottomSheet`, `openAccountDialog`)
|
|
261
|
+
* are the only public entry points.
|
|
262
|
+
*/
|
|
263
|
+
export const surfaces = {
|
|
264
|
+
present: <K extends RouteName>(route: K, props?: SurfaceProps<K>, opts?: PresentOptions) =>
|
|
265
|
+
present(route, props, opts).result,
|
|
266
|
+
dismissAll: closeAllRouteSurfaces,
|
|
267
|
+
} as const;
|
|
268
|
+
|
|
269
|
+
/** Hook form of {@link surfaces} (stable singleton). */
|
|
270
|
+
export function useSurfaces(): typeof surfaces {
|
|
271
|
+
return surfaces;
|
|
272
|
+
}
|
|
@@ -2,26 +2,23 @@ import type React from 'react';
|
|
|
2
2
|
import { useCallback, useMemo, useState } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
View,
|
|
5
|
-
ScrollView,
|
|
6
5
|
TouchableOpacity,
|
|
7
6
|
ActivityIndicator,
|
|
8
|
-
Platform,
|
|
9
|
-
KeyboardAvoidingView,
|
|
10
7
|
} from 'react-native';
|
|
11
8
|
import { Ionicons } from '@expo/vector-icons';
|
|
12
9
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
13
|
-
import { toast
|
|
10
|
+
import { toast } from '@oxyhq/bloom';
|
|
11
|
+
import { surfaces } from '@oxyhq/bloom/surfaces';
|
|
14
12
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
15
|
-
import {
|
|
13
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
16
14
|
import { Button } from '@oxyhq/bloom/button';
|
|
17
15
|
import { TextField, TextFieldInput } from '@oxyhq/bloom/text-field';
|
|
18
16
|
import { Divider } from '@oxyhq/bloom/divider';
|
|
19
17
|
import type { AccountMember, AccountRole } from '@oxyhq/core';
|
|
20
|
-
import { logger as loggerUtil } from '@oxyhq/core';
|
|
21
18
|
import type { BaseScreenProps } from '../types/navigation';
|
|
22
|
-
import Header from '../components/Header';
|
|
23
19
|
import { useOxy } from '../context/OxyContext';
|
|
24
20
|
import { useI18n } from '../hooks/useI18n';
|
|
21
|
+
import { useSurfaceHeader } from '../hooks/useSurfaceHeader';
|
|
25
22
|
|
|
26
23
|
/** Roles assignable via invite / role change — everything except `owner`. */
|
|
27
24
|
type AssignableRole = Exclude<AccountRole, 'owner'>;
|
|
@@ -45,6 +42,11 @@ const AccountMembersScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, acco
|
|
|
45
42
|
const bloomTheme = useTheme();
|
|
46
43
|
const colors = bloomTheme.colors;
|
|
47
44
|
const { t } = useI18n();
|
|
45
|
+
|
|
46
|
+
useSurfaceHeader({
|
|
47
|
+
title: t('accounts.members.title') || 'Members',
|
|
48
|
+
subtitle: t('accounts.members.subtitle') || 'People with access to this account.',
|
|
49
|
+
});
|
|
48
50
|
const { oxyServices, canUsePrivateApi } = useOxy();
|
|
49
51
|
const queryClient = useQueryClient();
|
|
50
52
|
|
|
@@ -155,11 +157,6 @@ const AccountMembersScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, acco
|
|
|
155
157
|
},
|
|
156
158
|
});
|
|
157
159
|
|
|
158
|
-
const [memberToRemove, setMemberToRemove] = useState<AccountMember | null>(null);
|
|
159
|
-
const [memberToPromote, setMemberToPromote] = useState<AccountMember | null>(null);
|
|
160
|
-
const removeDialog = useDialogControl();
|
|
161
|
-
const transferDialog = useDialogControl();
|
|
162
|
-
|
|
163
160
|
const handleInvite = useCallback(() => {
|
|
164
161
|
const usernameOrEmail = inviteIdentifier.trim();
|
|
165
162
|
if (!usernameOrEmail) {
|
|
@@ -177,53 +174,46 @@ const AccountMembersScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, acco
|
|
|
177
174
|
updateMutation.mutate({ memberId: member._id, role });
|
|
178
175
|
}, [updateMutation]);
|
|
179
176
|
|
|
180
|
-
const confirmRemove = useCallback((member: AccountMember) => {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
177
|
+
const confirmRemove = useCallback(async (member: AccountMember) => {
|
|
178
|
+
const confirmed = await surfaces.confirm({
|
|
179
|
+
title: t('accounts.members.removeConfirm.title') || 'Remove member',
|
|
180
|
+
message:
|
|
181
|
+
t('accounts.members.removeConfirm.description')
|
|
182
|
+
|| 'Remove this member from the account? They will lose all access.',
|
|
183
|
+
confirmLabel: t('accounts.members.actions.remove') || 'Remove',
|
|
184
|
+
cancelLabel: t('common.cancel') || 'Cancel',
|
|
185
|
+
destructive: true,
|
|
186
|
+
});
|
|
187
|
+
if (confirmed) removeMutation.mutate(member._id);
|
|
188
|
+
}, [removeMutation, t]);
|
|
189
|
+
|
|
190
|
+
const confirmTransfer = useCallback(async (member: AccountMember) => {
|
|
191
|
+
const confirmed = await surfaces.confirm({
|
|
192
|
+
title: t('accounts.members.transferConfirm.title') || 'Transfer ownership',
|
|
193
|
+
message:
|
|
194
|
+
t('accounts.members.transferConfirm.description')
|
|
195
|
+
|| 'Transfer ownership of this account to this member? You will be demoted to admin. This cannot be undone.',
|
|
196
|
+
confirmLabel: t('accounts.members.actions.transfer') || 'Transfer ownership',
|
|
197
|
+
cancelLabel: t('common.cancel') || 'Cancel',
|
|
198
|
+
destructive: true,
|
|
199
|
+
});
|
|
200
|
+
if (confirmed) transferMutation.mutate(member.memberUserId);
|
|
201
|
+
}, [transferMutation, t]);
|
|
191
202
|
|
|
192
203
|
if (!id) {
|
|
193
204
|
return (
|
|
194
|
-
|
|
195
|
-
<
|
|
196
|
-
<View className="flex-1 items-center justify-center px-screen-margin">
|
|
205
|
+
<>
|
|
206
|
+
<View className="items-center justify-center px-screen-margin py-space-40">
|
|
197
207
|
<Text className="text-body font-body text-text-secondary text-center">
|
|
198
208
|
{t('accounts.members.errors.missingAccount') || 'No account selected.'}
|
|
199
209
|
</Text>
|
|
200
210
|
</View>
|
|
201
|
-
|
|
211
|
+
</>
|
|
202
212
|
);
|
|
203
213
|
}
|
|
204
214
|
|
|
205
215
|
return (
|
|
206
|
-
|
|
207
|
-
<Header title={title} onBack={goBack} onClose={onClose} showBackButton showCloseButton elevation="subtle" />
|
|
208
|
-
|
|
209
|
-
<KeyboardAvoidingView
|
|
210
|
-
className="flex-1"
|
|
211
|
-
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
|
212
|
-
keyboardVerticalOffset={Platform.OS === 'ios' ? 88 : 0}
|
|
213
|
-
>
|
|
214
|
-
<ScrollView
|
|
215
|
-
className="flex-1"
|
|
216
|
-
contentContainerClassName="px-screen-margin pt-space-24 pb-space-32 gap-space-24"
|
|
217
|
-
showsVerticalScrollIndicator={false}
|
|
218
|
-
keyboardShouldPersistTaps="handled"
|
|
219
|
-
>
|
|
220
|
-
<View className="gap-space-8">
|
|
221
|
-
<H1 className="text-headerBold font-headerBold text-text">{title}</H1>
|
|
222
|
-
<Text className="text-body font-body text-text-secondary">
|
|
223
|
-
{t('accounts.members.subtitle') || 'People with access to this account.'}
|
|
224
|
-
</Text>
|
|
225
|
-
</View>
|
|
226
|
-
|
|
216
|
+
<View className="px-screen-margin pt-space-16 pb-space-32 gap-space-24">
|
|
227
217
|
{!accountQuery.isLoading && !canRead ? (
|
|
228
218
|
<Text className="text-body font-body text-text-secondary text-center py-space-24">
|
|
229
219
|
{t('accounts.members.errors.noPermission') || 'You do not have permission to view members.'}
|
|
@@ -423,58 +413,7 @@ const AccountMembersScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, acco
|
|
|
423
413
|
)}
|
|
424
414
|
</View>
|
|
425
415
|
) : null}
|
|
426
|
-
|
|
427
|
-
</KeyboardAvoidingView>
|
|
428
|
-
|
|
429
|
-
<Dialog
|
|
430
|
-
control={removeDialog}
|
|
431
|
-
title={t('accounts.members.removeConfirm.title') || 'Remove member'}
|
|
432
|
-
description={
|
|
433
|
-
t('accounts.members.removeConfirm.description')
|
|
434
|
-
|| 'Remove this member from the account? They will lose all access.'
|
|
435
|
-
}
|
|
436
|
-
actions={[
|
|
437
|
-
{
|
|
438
|
-
label: t('accounts.members.actions.remove') || 'Remove',
|
|
439
|
-
color: 'destructive',
|
|
440
|
-
onPress: () => {
|
|
441
|
-
const target = memberToRemove;
|
|
442
|
-
setMemberToRemove(null);
|
|
443
|
-
if (target) {
|
|
444
|
-
removeMutation.mutate(target._id);
|
|
445
|
-
} else {
|
|
446
|
-
loggerUtil.debug('Remove confirmed with no pending member', { component: 'AccountMembersScreen' });
|
|
447
|
-
}
|
|
448
|
-
},
|
|
449
|
-
},
|
|
450
|
-
{ label: t('common.cancel') || 'Cancel', color: 'cancel' },
|
|
451
|
-
]}
|
|
452
|
-
/>
|
|
453
|
-
<Dialog
|
|
454
|
-
control={transferDialog}
|
|
455
|
-
title={t('accounts.members.transferConfirm.title') || 'Transfer ownership'}
|
|
456
|
-
description={
|
|
457
|
-
t('accounts.members.transferConfirm.description')
|
|
458
|
-
|| 'Transfer ownership of this account to this member? You will be demoted to admin. This cannot be undone.'
|
|
459
|
-
}
|
|
460
|
-
actions={[
|
|
461
|
-
{
|
|
462
|
-
label: t('accounts.members.actions.transfer') || 'Transfer ownership',
|
|
463
|
-
color: 'destructive',
|
|
464
|
-
onPress: () => {
|
|
465
|
-
const target = memberToPromote;
|
|
466
|
-
setMemberToPromote(null);
|
|
467
|
-
if (target) {
|
|
468
|
-
transferMutation.mutate(target.memberUserId);
|
|
469
|
-
} else {
|
|
470
|
-
loggerUtil.debug('Transfer confirmed with no pending member', { component: 'AccountMembersScreen' });
|
|
471
|
-
}
|
|
472
|
-
},
|
|
473
|
-
},
|
|
474
|
-
{ label: t('common.cancel') || 'Cancel', color: 'cancel' },
|
|
475
|
-
]}
|
|
476
|
-
/>
|
|
477
|
-
</View>
|
|
416
|
+
</View>
|
|
478
417
|
);
|
|
479
418
|
};
|
|
480
419
|
|
|
@@ -2,24 +2,22 @@ import type React from 'react';
|
|
|
2
2
|
import { useCallback, useMemo, useState } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
View,
|
|
5
|
-
ScrollView,
|
|
6
5
|
ActivityIndicator,
|
|
7
|
-
Platform,
|
|
8
|
-
KeyboardAvoidingView,
|
|
9
6
|
} from 'react-native';
|
|
10
7
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
11
|
-
import { toast
|
|
8
|
+
import { toast } from '@oxyhq/bloom';
|
|
9
|
+
import { surfaces } from '@oxyhq/bloom/surfaces';
|
|
12
10
|
import { useTheme } from '@oxyhq/bloom/theme';
|
|
13
|
-
import {
|
|
11
|
+
import { Text } from '@oxyhq/bloom/typography';
|
|
14
12
|
import { Button } from '@oxyhq/bloom/button';
|
|
15
13
|
import { TextField, TextFieldInput } from '@oxyhq/bloom/text-field';
|
|
16
14
|
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
17
15
|
import type { UpdateAccountInput } from '@oxyhq/core';
|
|
18
16
|
import type { BaseScreenProps } from '../types/navigation';
|
|
19
|
-
import Header from '../components/Header';
|
|
20
17
|
import { SettingsIcon } from '../components/SettingsIcon';
|
|
21
18
|
import { useOxy } from '../context/OxyContext';
|
|
22
19
|
import { useI18n } from '../hooks/useI18n';
|
|
20
|
+
import { useSurfaceHeader } from '../hooks/useSurfaceHeader';
|
|
23
21
|
|
|
24
22
|
const DISPLAY_NAME_MAX = 50;
|
|
25
23
|
const BIO_MAX = 160;
|
|
@@ -38,6 +36,7 @@ const AccountSettingsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, nav
|
|
|
38
36
|
const bloomTheme = useTheme();
|
|
39
37
|
const colors = bloomTheme.colors;
|
|
40
38
|
const { t } = useI18n();
|
|
39
|
+
|
|
41
40
|
const { oxyServices, canUsePrivateApi, user, accounts, switchToAccount } = useOxy();
|
|
42
41
|
const queryClient = useQueryClient();
|
|
43
42
|
|
|
@@ -109,7 +108,18 @@ const AccountSettingsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, nav
|
|
|
109
108
|
},
|
|
110
109
|
});
|
|
111
110
|
|
|
112
|
-
const
|
|
111
|
+
const handleArchive = useCallback(async () => {
|
|
112
|
+
const confirmed = await surfaces.confirm({
|
|
113
|
+
title: t('accounts.settings.archive.confirmTitle') || 'Archive account',
|
|
114
|
+
message:
|
|
115
|
+
t('accounts.settings.archive.confirmDescription')
|
|
116
|
+
|| 'Archive this account? It will be deactivated and its members will lose access.',
|
|
117
|
+
confirmLabel: t('accounts.settings.archive.title') || 'Archive account',
|
|
118
|
+
cancelLabel: t('common.cancel') || 'Cancel',
|
|
119
|
+
destructive: true,
|
|
120
|
+
});
|
|
121
|
+
if (confirmed) archiveMutation.mutate();
|
|
122
|
+
}, [archiveMutation, t]);
|
|
113
123
|
|
|
114
124
|
const handleSave = useCallback(() => {
|
|
115
125
|
const trimmed = displayName.trim();
|
|
@@ -129,49 +139,35 @@ const AccountSettingsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, nav
|
|
|
129
139
|
return username ? `@${username}` : '';
|
|
130
140
|
}, [node?.account?.username]);
|
|
131
141
|
|
|
142
|
+
// The nav large title is the account's handle once loaded (falls back to the
|
|
143
|
+
// generic screen title before the account resolves).
|
|
144
|
+
useSurfaceHeader({
|
|
145
|
+
title: accountHandle || title,
|
|
146
|
+
subtitle: t('accounts.settings.subtitle') || 'Manage this account’s profile, members, and access.',
|
|
147
|
+
});
|
|
148
|
+
|
|
132
149
|
if (!id) {
|
|
133
150
|
return (
|
|
134
|
-
|
|
135
|
-
<
|
|
136
|
-
<View className="flex-1 items-center justify-center px-screen-margin">
|
|
151
|
+
<>
|
|
152
|
+
<View className="items-center justify-center px-screen-margin py-space-40">
|
|
137
153
|
<Text className="text-body font-body text-text-secondary text-center">
|
|
138
154
|
{t('accounts.settings.errors.missingAccount') || 'No account selected.'}
|
|
139
155
|
</Text>
|
|
140
156
|
</View>
|
|
141
|
-
|
|
157
|
+
</>
|
|
142
158
|
);
|
|
143
159
|
}
|
|
144
160
|
|
|
145
161
|
return (
|
|
146
|
-
|
|
147
|
-
<Header title={title} onBack={goBack} onClose={onClose} showBackButton showCloseButton elevation="subtle" />
|
|
162
|
+
<>
|
|
148
163
|
|
|
149
|
-
<
|
|
150
|
-
className="flex-1"
|
|
151
|
-
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
|
152
|
-
keyboardVerticalOffset={Platform.OS === 'ios' ? 88 : 0}
|
|
153
|
-
>
|
|
154
|
-
<ScrollView
|
|
155
|
-
className="flex-1"
|
|
156
|
-
contentContainerClassName="px-screen-margin pt-space-24 pb-space-32 gap-space-24"
|
|
157
|
-
showsVerticalScrollIndicator={false}
|
|
158
|
-
keyboardShouldPersistTaps="handled"
|
|
159
|
-
>
|
|
164
|
+
<View className="px-screen-margin pt-space-24 pb-space-32 gap-space-24">
|
|
160
165
|
{accountQuery.isLoading ? (
|
|
161
166
|
<View className="items-center py-space-32">
|
|
162
167
|
<ActivityIndicator color={colors.primary} />
|
|
163
168
|
</View>
|
|
164
169
|
) : (
|
|
165
170
|
<>
|
|
166
|
-
<View className="gap-space-8">
|
|
167
|
-
<H1 className="text-headerBold font-headerBold text-text" numberOfLines={1}>
|
|
168
|
-
{accountHandle || title}
|
|
169
|
-
</H1>
|
|
170
|
-
<Text className="text-body font-body text-text-secondary">
|
|
171
|
-
{t('accounts.settings.subtitle') || 'Manage this account’s profile, members, and access.'}
|
|
172
|
-
</Text>
|
|
173
|
-
</View>
|
|
174
|
-
|
|
175
171
|
{/* Profile edit */}
|
|
176
172
|
{canUpdate ? (
|
|
177
173
|
<View className="gap-space-16 p-space-16 rounded-radius-20 bg-fill">
|
|
@@ -233,32 +229,14 @@ const AccountSettingsScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, nav
|
|
|
233
229
|
icon={<SettingsIcon name="archive-arrow-down" color={colors.error} />}
|
|
234
230
|
title={t('accounts.settings.archive.title') || 'Archive account'}
|
|
235
231
|
description={t('accounts.settings.archive.subtitle') || 'Deactivate this account'}
|
|
236
|
-
onPress={
|
|
232
|
+
onPress={handleArchive}
|
|
237
233
|
/>
|
|
238
234
|
</SettingsListGroup>
|
|
239
235
|
) : null}
|
|
240
236
|
</>
|
|
241
237
|
)}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
<Dialog
|
|
246
|
-
control={archiveDialog}
|
|
247
|
-
title={t('accounts.settings.archive.confirmTitle') || 'Archive account'}
|
|
248
|
-
description={
|
|
249
|
-
t('accounts.settings.archive.confirmDescription')
|
|
250
|
-
|| 'Archive this account? It will be deactivated and its members will lose access.'
|
|
251
|
-
}
|
|
252
|
-
actions={[
|
|
253
|
-
{
|
|
254
|
-
label: t('accounts.settings.archive.title') || 'Archive account',
|
|
255
|
-
color: 'destructive',
|
|
256
|
-
onPress: () => archiveMutation.mutate(),
|
|
257
|
-
},
|
|
258
|
-
{ label: t('common.cancel') || 'Cancel', color: 'cancel' },
|
|
259
|
-
]}
|
|
260
|
-
/>
|
|
261
|
-
</View>
|
|
238
|
+
</View>
|
|
239
|
+
</>
|
|
262
240
|
);
|
|
263
241
|
};
|
|
264
242
|
|