@oxyhq/services 5.5.9 → 5.6.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/README.md +16 -2
- package/lib/commonjs/core/index.js +69 -82
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +24 -183
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/node/index.js +0 -2
- package/lib/commonjs/node/index.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +100 -229
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js +131 -0
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +41 -198
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +15 -2
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js +66 -0
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js.map +1 -0
- package/lib/commonjs/ui/components/icon/index.js +7 -0
- package/lib/commonjs/ui/components/icon/index.js.map +1 -1
- package/lib/commonjs/ui/components/index.js +7 -0
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +14 -7
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +108 -0
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -0
- package/lib/commonjs/ui/components/internal/TextField.js +20 -0
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +26 -36
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/index.js +2 -15
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollow.js +52 -136
- package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +52 -0
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -0
- package/lib/commonjs/ui/index.js +8 -191
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +52 -60
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +18 -30
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +4 -22
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +6 -14
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +37 -66
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +21 -44
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +44 -23
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +59 -78
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1588 -0
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +22 -36
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +269 -0
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +47 -69
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +99 -333
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +136 -340
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +192 -0
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +135 -0
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +108 -0
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +126 -0
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js +84 -0
- package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js +59 -0
- package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +15 -2
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +31 -0
- package/lib/commonjs/ui/stores/authStore.js.map +1 -0
- package/lib/commonjs/ui/stores/followStore.js +124 -0
- package/lib/commonjs/ui/stores/followStore.js.map +1 -0
- package/lib/commonjs/ui/styles/index.js +0 -11
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/commonjs/ui/utils/confirmAction.js +28 -0
- package/lib/commonjs/ui/utils/confirmAction.js.map +1 -0
- package/lib/module/core/index.js +69 -81
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +14 -17
- package/lib/module/index.js.map +1 -1
- package/lib/module/node/index.js +0 -3
- package/lib/module/node/index.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +100 -229
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +125 -0
- package/lib/module/ui/components/OxyPayButton.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +42 -199
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +15 -2
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/icon/FAIRWalletIcon.js +60 -0
- package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -0
- package/lib/module/ui/components/icon/index.js +1 -0
- package/lib/module/ui/components/icon/index.js.map +1 -1
- package/lib/module/ui/components/index.js +1 -0
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +15 -8
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +103 -0
- package/lib/module/ui/components/internal/PinInput.js.map +1 -0
- package/lib/module/ui/components/internal/TextField.js +20 -0
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +26 -36
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/index.js +1 -2
- package/lib/module/ui/hooks/index.js.map +1 -1
- package/lib/module/ui/hooks/useFollow.js +52 -137
- package/lib/module/ui/hooks/useFollow.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +47 -0
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -0
- package/lib/module/ui/index.js +2 -13
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +53 -61
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +6 -18
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +5 -23
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +7 -15
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +38 -67
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +22 -45
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +44 -23
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +59 -78
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1583 -0
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -0
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +23 -37
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +263 -0
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -0
- package/lib/module/ui/screens/SessionManagementScreen.js +47 -69
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +100 -334
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +137 -341
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +186 -0
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +129 -0
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js +102 -0
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js +120 -0
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpSummaryStep.js +79 -0
- package/lib/module/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
- package/lib/module/ui/screens/internal/SignUpWelcomeStep.js +54 -0
- package/lib/module/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +16 -3
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +27 -0
- package/lib/module/ui/stores/authStore.js.map +1 -0
- package/lib/module/ui/stores/followStore.js +120 -0
- package/lib/module/ui/stores/followStore.js.map +1 -0
- package/lib/module/ui/styles/index.js +0 -1
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/module/ui/utils/confirmAction.js +25 -0
- package/lib/module/ui/utils/confirmAction.js.map +1 -0
- package/lib/typescript/core/index.d.ts +28 -10
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +5 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/secureSession.d.ts +0 -1
- package/lib/typescript/models/secureSession.d.ts.map +1 -1
- package/lib/typescript/node/index.d.ts +0 -1
- package/lib/typescript/node/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/FollowButton.d.ts +1 -77
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyPayButton.d.ts +29 -0
- package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts.map +1 -0
- package/lib/typescript/ui/components/icon/index.d.ts +1 -0
- package/lib/typescript/ui/components/icon/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/index.d.ts +1 -0
- package/lib/typescript/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/PinInput.d.ts +12 -0
- package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -0
- package/lib/typescript/ui/components/internal/TextField.d.ts +1 -0
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +0 -2
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/index.d.ts +1 -2
- package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useFollow.d.ts +14 -15
- package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts +11 -0
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -0
- package/lib/typescript/ui/index.d.ts +2 -5
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +5 -23
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +27 -0
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +8 -0
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +27 -0
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +26 -0
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts +20 -0
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts +24 -0
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts +15 -0
- package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts +13 -0
- package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +14 -0
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -0
- package/lib/typescript/ui/stores/followStore.d.ts +15 -0
- package/lib/typescript/ui/stores/followStore.d.ts.map +1 -0
- package/lib/typescript/ui/styles/index.d.ts +0 -1
- package/lib/typescript/ui/styles/index.d.ts.map +1 -1
- package/lib/typescript/ui/utils/confirmAction.d.ts +7 -0
- package/lib/typescript/ui/utils/confirmAction.d.ts.map +1 -0
- package/package.json +12 -7
- package/src/core/index.ts +78 -88
- package/src/index.ts +8 -45
- package/src/models/secureSession.ts +1 -2
- package/src/node/index.ts +0 -3
- package/src/ui/components/FollowButton.tsx +100 -322
- package/src/ui/components/OxyPayButton.tsx +133 -0
- package/src/ui/components/OxyProvider.tsx +39 -201
- package/src/ui/components/OxySignInButton.tsx +13 -2
- package/src/ui/components/icon/FAIRWalletIcon.tsx +49 -0
- package/src/ui/components/icon/index.ts +1 -0
- package/src/ui/components/index.ts +1 -0
- package/src/ui/components/internal/GroupedPillButtons.tsx +12 -8
- package/src/ui/components/internal/PinInput.tsx +102 -0
- package/src/ui/components/internal/TextField.tsx +9 -0
- package/src/ui/context/OxyContext.tsx +26 -40
- package/src/ui/hooks/index.ts +1 -2
- package/src/ui/hooks/useFollow.ts +58 -129
- package/src/ui/hooks/useSessionSocket.ts +50 -0
- package/src/ui/index.ts +2 -37
- package/src/ui/navigation/OxyRouter.tsx +47 -63
- package/src/ui/navigation/types.ts +5 -26
- package/src/ui/screens/AccountCenterScreen.tsx +12 -21
- package/src/ui/screens/AccountOverviewScreen.tsx +6 -30
- package/src/ui/screens/AccountSettingsScreen.tsx +7 -22
- package/src/ui/screens/AccountSwitcherScreen.tsx +46 -88
- package/src/ui/screens/AppInfoScreen.tsx +27 -47
- package/src/ui/screens/FeedbackScreen.tsx +34 -19
- package/src/ui/screens/FileManagementScreen.tsx +293 -321
- package/src/ui/screens/PaymentGatewayScreen.tsx +1315 -0
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +109 -124
- package/src/ui/screens/RecoverAccountScreen.tsx +260 -0
- package/src/ui/screens/SessionManagementScreen.tsx +65 -137
- package/src/ui/screens/SignInScreen.tsx +89 -283
- package/src/ui/screens/SignUpScreen.tsx +138 -291
- package/src/ui/screens/internal/SignInPasswordStep.tsx +179 -0
- package/src/ui/screens/internal/SignInUsernameStep.tsx +139 -0
- package/src/ui/screens/internal/SignUpIdentityStep.tsx +114 -0
- package/src/ui/screens/internal/SignUpSecurityStep.tsx +132 -0
- package/src/ui/screens/internal/SignUpSummaryStep.tsx +66 -0
- package/src/ui/screens/internal/SignUpWelcomeStep.tsx +52 -0
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +13 -3
- package/src/ui/stores/authStore.ts +24 -0
- package/src/ui/stores/followStore.ts +80 -0
- package/src/ui/styles/index.ts +0 -1
- package/src/ui/utils/confirmAction.ts +23 -0
- package/lib/commonjs/ui/components/bottomSheet/index.js +0 -37
- package/lib/commonjs/ui/components/bottomSheet/index.js.map +0 -1
- package/lib/commonjs/ui/hooks/useAuthFetch.js +0 -217
- package/lib/commonjs/ui/hooks/useAuthFetch.js.map +0 -1
- package/lib/commonjs/ui/hooks/useOxyFollow.js +0 -190
- package/lib/commonjs/ui/hooks/useOxyFollow.js.map +0 -1
- package/lib/commonjs/ui/screens/BillingManagementScreen.js +0 -636
- package/lib/commonjs/ui/screens/BillingManagementScreen.js.map +0 -1
- package/lib/commonjs/ui/store/index.js +0 -67
- package/lib/commonjs/ui/store/index.js.map +0 -1
- package/lib/commonjs/ui/store/setupOxyStore.js +0 -63
- package/lib/commonjs/ui/store/setupOxyStore.js.map +0 -1
- package/lib/commonjs/ui/store/slices/authSlice.js +0 -56
- package/lib/commonjs/ui/store/slices/authSlice.js.map +0 -1
- package/lib/commonjs/ui/store/slices/followSlice.js +0 -238
- package/lib/commonjs/ui/store/slices/followSlice.js.map +0 -1
- package/lib/commonjs/ui/store/slices/index.js +0 -129
- package/lib/commonjs/ui/store/slices/index.js.map +0 -1
- package/lib/commonjs/ui/store/slices/types.js +0 -19
- package/lib/commonjs/ui/store/slices/types.js.map +0 -1
- package/lib/commonjs/ui/styles/shadows.js +0 -123
- package/lib/commonjs/ui/styles/shadows.js.map +0 -1
- package/lib/commonjs/utils/polyfills.js +0 -42
- package/lib/commonjs/utils/polyfills.js.map +0 -1
- package/lib/module/ui/components/bottomSheet/index.js +0 -5
- package/lib/module/ui/components/bottomSheet/index.js.map +0 -1
- package/lib/module/ui/hooks/useAuthFetch.js +0 -212
- package/lib/module/ui/hooks/useAuthFetch.js.map +0 -1
- package/lib/module/ui/hooks/useOxyFollow.js +0 -186
- package/lib/module/ui/hooks/useOxyFollow.js.map +0 -1
- package/lib/module/ui/screens/BillingManagementScreen.js +0 -631
- package/lib/module/ui/screens/BillingManagementScreen.js.map +0 -1
- package/lib/module/ui/store/index.js +0 -33
- package/lib/module/ui/store/index.js.map +0 -1
- package/lib/module/ui/store/setupOxyStore.js +0 -59
- package/lib/module/ui/store/setupOxyStore.js.map +0 -1
- package/lib/module/ui/store/slices/authSlice.js +0 -48
- package/lib/module/ui/store/slices/authSlice.js.map +0 -1
- package/lib/module/ui/store/slices/followSlice.js +0 -232
- package/lib/module/ui/store/slices/followSlice.js.map +0 -1
- package/lib/module/ui/store/slices/index.js +0 -11
- package/lib/module/ui/store/slices/index.js.map +0 -1
- package/lib/module/ui/store/slices/types.js +0 -15
- package/lib/module/ui/store/slices/types.js.map +0 -1
- package/lib/module/ui/styles/shadows.js +0 -119
- package/lib/module/ui/styles/shadows.js.map +0 -1
- package/lib/module/utils/polyfills.js +0 -36
- package/lib/module/utils/polyfills.js.map +0 -1
- package/lib/typescript/types/react-redux.d.ts +0 -5
- package/lib/typescript/ui/components/bottomSheet/index.d.ts +0 -4
- package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useAuthFetch.d.ts +0 -34
- package/lib/typescript/ui/hooks/useAuthFetch.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useOxyFollow.d.ts +0 -81
- package/lib/typescript/ui/hooks/useOxyFollow.d.ts.map +0 -1
- package/lib/typescript/ui/screens/BillingManagementScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/BillingManagementScreen.d.ts.map +0 -1
- package/lib/typescript/ui/store/index.d.ts +0 -27
- package/lib/typescript/ui/store/index.d.ts.map +0 -1
- package/lib/typescript/ui/store/setupOxyStore.d.ts +0 -29
- package/lib/typescript/ui/store/setupOxyStore.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/authSlice.d.ts +0 -32
- package/lib/typescript/ui/store/slices/authSlice.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/followSlice.d.ts +0 -120
- package/lib/typescript/ui/store/slices/followSlice.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/index.d.ts +0 -9
- package/lib/typescript/ui/store/slices/index.d.ts.map +0 -1
- package/lib/typescript/ui/store/slices/types.d.ts +0 -16
- package/lib/typescript/ui/store/slices/types.d.ts.map +0 -1
- package/lib/typescript/ui/styles/shadows.d.ts +0 -233
- package/lib/typescript/ui/styles/shadows.d.ts.map +0 -1
- package/lib/typescript/utils/polyfills.d.ts +0 -6
- package/lib/typescript/utils/polyfills.d.ts.map +0 -1
- package/src/__tests__/backend-middleware.test.ts +0 -209
- package/src/__tests__/polyfills.test.ts +0 -30
- package/src/__tests__/setup.ts +0 -43
- package/src/__tests__/ui/hooks/authfetch-integration.test.ts +0 -197
- package/src/__tests__/ui/hooks/backward-compatibility.test.ts +0 -159
- package/src/__tests__/ui/hooks/real-world-scenarios.test.ts +0 -224
- package/src/__tests__/ui/hooks/url-resolution.test.ts +0 -129
- package/src/__tests__/ui/hooks/useAuthFetch-separation.test.ts +0 -69
- package/src/__tests__/ui/hooks/useAuthFetch.test.ts +0 -70
- package/src/__tests__/ui/hooks/useOxyFollow.test.tsx +0 -92
- package/src/__tests__/ui/screens/AccountSettingsScreen.test.tsx +0 -112
- package/src/__tests__/ui/store/setupOxyStore.test.ts +0 -50
- package/src/__tests__/validate-structure.js +0 -91
- package/src/__tests__/validation.js +0 -42
- package/src/types/react-redux.d.ts +0 -5
- package/src/ui/components/bottomSheet/index.tsx +0 -14
- package/src/ui/hooks/useAuthFetch.ts +0 -238
- package/src/ui/hooks/useOxyFollow.ts +0 -188
- package/src/ui/screens/BillingManagementScreen.tsx +0 -589
- package/src/ui/store/index.ts +0 -36
- package/src/ui/store/setupOxyStore.ts +0 -58
- package/src/ui/store/slices/authSlice.ts +0 -43
- package/src/ui/store/slices/followSlice.ts +0 -207
- package/src/ui/store/slices/index.ts +0 -31
- package/src/ui/store/slices/types.ts +0 -33
- package/src/ui/styles/shadows.ts +0 -112
- package/src/utils/polyfills.ts +0 -34
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
import { OxyServices } from '../../core';
|
|
4
4
|
|
|
@@ -11,7 +11,6 @@ import SessionManagementScreen from '../screens/SessionManagementScreen';
|
|
|
11
11
|
import AccountOverviewScreen from '../screens/AccountOverviewScreen';
|
|
12
12
|
import AccountSettingsScreen from '../screens/AccountSettingsScreen';
|
|
13
13
|
import PremiumSubscriptionScreen from '../screens/PremiumSubscriptionScreen';
|
|
14
|
-
import BillingManagementScreen from '../screens/BillingManagementScreen';
|
|
15
14
|
import AppInfoScreen from '../screens/AppInfoScreen';
|
|
16
15
|
import FeedbackScreen from '../screens/FeedbackScreen';
|
|
17
16
|
import KarmaCenterScreen from '../screens/karma/KarmaCenterScreen';
|
|
@@ -22,6 +21,8 @@ import KarmaRewardsScreen from '../screens/karma/KarmaRewardsScreen';
|
|
|
22
21
|
import KarmaFAQScreen from '../screens/karma/KarmaFAQScreen';
|
|
23
22
|
import ProfileScreen from '../screens/ProfileScreen';
|
|
24
23
|
import FileManagementScreen from '../screens/FileManagementScreen';
|
|
24
|
+
import RecoverAccountScreen from '../screens/RecoverAccountScreen';
|
|
25
|
+
import PaymentGatewayScreen from '../screens/PaymentGatewayScreen';
|
|
25
26
|
|
|
26
27
|
// Import types
|
|
27
28
|
import { OxyRouterProps, RouteConfig } from './types';
|
|
@@ -36,6 +37,10 @@ const routes: Record<string, RouteConfig> = {
|
|
|
36
37
|
component: SignUpScreen,
|
|
37
38
|
snapPoints: ['10%', '90%'],
|
|
38
39
|
},
|
|
40
|
+
RecoverAccount: {
|
|
41
|
+
component: RecoverAccountScreen,
|
|
42
|
+
snapPoints: ['10%', '80%'],
|
|
43
|
+
},
|
|
39
44
|
AccountCenter: {
|
|
40
45
|
component: AccountCenterScreen,
|
|
41
46
|
snapPoints: ['60%', '100%'],
|
|
@@ -60,10 +65,6 @@ const routes: Record<string, RouteConfig> = {
|
|
|
60
65
|
component: PremiumSubscriptionScreen,
|
|
61
66
|
snapPoints: ['70%', '100%'],
|
|
62
67
|
},
|
|
63
|
-
BillingManagement: {
|
|
64
|
-
component: BillingManagementScreen,
|
|
65
|
-
snapPoints: ['70%', '100%'],
|
|
66
|
-
},
|
|
67
68
|
AppInfo: {
|
|
68
69
|
component: AppInfoScreen,
|
|
69
70
|
snapPoints: ['60%', '90%'],
|
|
@@ -104,6 +105,10 @@ const routes: Record<string, RouteConfig> = {
|
|
|
104
105
|
component: FileManagementScreen,
|
|
105
106
|
snapPoints: ['70%', '100%'],
|
|
106
107
|
},
|
|
108
|
+
PaymentGateway: {
|
|
109
|
+
component: PaymentGatewayScreen,
|
|
110
|
+
snapPoints: ['60%', '90%'],
|
|
111
|
+
},
|
|
107
112
|
};
|
|
108
113
|
|
|
109
114
|
const OxyRouter: React.FC<OxyRouterProps> = ({
|
|
@@ -118,32 +123,49 @@ const OxyRouter: React.FC<OxyRouterProps> = ({
|
|
|
118
123
|
}) => {
|
|
119
124
|
const [currentScreen, setCurrentScreen] = useState<string>(initialScreen);
|
|
120
125
|
const [screenHistory, setScreenHistory] = useState<string[]>([initialScreen]);
|
|
121
|
-
|
|
126
|
+
// Store props per screen for correct restoration on back
|
|
127
|
+
const [screenPropsMap, setScreenPropsMap] = useState<Record<string, any>>({ [initialScreen]: {} });
|
|
122
128
|
|
|
123
129
|
// Update snap points when the screen changes
|
|
124
130
|
useEffect(() => {
|
|
125
|
-
if (routes[currentScreen]) {
|
|
131
|
+
if (routes[currentScreen] && typeof adjustSnapPoints === 'function') {
|
|
126
132
|
adjustSnapPoints(routes[currentScreen].snapPoints);
|
|
127
133
|
}
|
|
128
134
|
}, [currentScreen, adjustSnapPoints]);
|
|
129
135
|
|
|
130
|
-
//
|
|
131
|
-
const navigate = (screen: string, props: Record<string, any> = {}) => {
|
|
136
|
+
// Memoized navigation methods
|
|
137
|
+
const navigate = useCallback((screen: string, props: Record<string, any> = {}) => {
|
|
132
138
|
if (routes[screen]) {
|
|
133
139
|
setCurrentScreen(screen);
|
|
134
140
|
setScreenHistory(prev => [...prev, screen]);
|
|
135
|
-
|
|
141
|
+
setScreenPropsMap(prev => ({ ...prev, [screen]: props }));
|
|
136
142
|
} else {
|
|
137
|
-
|
|
143
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
144
|
+
console.error(`Screen "${screen}" not found`);
|
|
145
|
+
}
|
|
138
146
|
}
|
|
139
|
-
};
|
|
147
|
+
}, []);
|
|
148
|
+
|
|
149
|
+
const goBack = useCallback(() => {
|
|
150
|
+
setScreenHistory(prev => {
|
|
151
|
+
if (prev.length > 1) {
|
|
152
|
+
const newHistory = [...prev];
|
|
153
|
+
newHistory.pop();
|
|
154
|
+
const previousScreen = newHistory[newHistory.length - 1];
|
|
155
|
+
setCurrentScreen(previousScreen);
|
|
156
|
+
return newHistory;
|
|
157
|
+
} else {
|
|
158
|
+
if (onClose) onClose();
|
|
159
|
+
return prev;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}, [onClose]);
|
|
140
163
|
|
|
141
164
|
// Expose the navigate function to the parent component
|
|
142
165
|
useEffect(() => {
|
|
143
166
|
if (navigationRef) {
|
|
144
167
|
navigationRef.current = navigate;
|
|
145
168
|
}
|
|
146
|
-
|
|
147
169
|
return () => {
|
|
148
170
|
if (navigationRef) {
|
|
149
171
|
navigationRef.current = null;
|
|
@@ -153,83 +175,48 @@ const OxyRouter: React.FC<OxyRouterProps> = ({
|
|
|
153
175
|
|
|
154
176
|
// Expose the navigate method to the parent component (OxyProvider)
|
|
155
177
|
useEffect(() => {
|
|
156
|
-
// Set up event listener for navigation events
|
|
157
178
|
const handleNavigationEvent = (event: any) => {
|
|
158
179
|
if (event && event.detail) {
|
|
159
|
-
// Support both string and object detail
|
|
160
180
|
if (typeof event.detail === 'string') {
|
|
161
|
-
|
|
162
|
-
console.log(`Navigation event received for screen: ${screenName}`);
|
|
163
|
-
navigate(screenName);
|
|
181
|
+
navigate(event.detail);
|
|
164
182
|
} else if (typeof event.detail === 'object' && event.detail.screen) {
|
|
165
183
|
const { screen, props } = event.detail;
|
|
166
|
-
console.log(`Navigation event received for screen: ${screen} with props`, props);
|
|
167
184
|
navigate(screen, props || {});
|
|
168
185
|
}
|
|
169
186
|
}
|
|
170
187
|
};
|
|
171
188
|
|
|
172
|
-
// For React Native - check for global navigation events
|
|
173
189
|
let intervalId: any = null;
|
|
174
|
-
|
|
175
|
-
if (typeof document !== 'undefined') {
|
|
176
|
-
// Web - use custom event listener
|
|
190
|
+
if (typeof document !== 'undefined' && document.addEventListener) {
|
|
177
191
|
document.addEventListener('oxy:navigate', handleNavigationEvent);
|
|
178
192
|
} else {
|
|
179
|
-
// React Native - poll for global navigation events
|
|
180
193
|
intervalId = setInterval(() => {
|
|
181
194
|
const globalNav = (globalThis as any).oxyNavigateEvent;
|
|
182
|
-
if (globalNav) {
|
|
183
|
-
|
|
184
|
-
if (globalNav.screen) {
|
|
185
|
-
navigate(globalNav.screen, globalNav.props || {});
|
|
186
|
-
}
|
|
187
|
-
// Clear the event after processing
|
|
195
|
+
if (globalNav && globalNav.screen) {
|
|
196
|
+
navigate(globalNav.screen, globalNav.props || {});
|
|
188
197
|
(globalThis as any).oxyNavigateEvent = null;
|
|
189
198
|
}
|
|
190
|
-
}, 100);
|
|
199
|
+
}, 100);
|
|
191
200
|
}
|
|
192
|
-
|
|
193
|
-
// Cleanup
|
|
194
201
|
return () => {
|
|
195
|
-
if (typeof document !== 'undefined') {
|
|
202
|
+
if (typeof document !== 'undefined' && document.removeEventListener) {
|
|
196
203
|
document.removeEventListener('oxy:navigate', handleNavigationEvent);
|
|
197
204
|
}
|
|
198
205
|
if (intervalId) {
|
|
199
206
|
clearInterval(intervalId);
|
|
200
207
|
}
|
|
201
208
|
};
|
|
202
|
-
}, []);
|
|
203
|
-
|
|
204
|
-
const goBack = () => {
|
|
205
|
-
if (screenHistory.length > 1) {
|
|
206
|
-
const newHistory = [...screenHistory];
|
|
207
|
-
newHistory.pop();
|
|
208
|
-
const previousScreen = newHistory[newHistory.length - 1];
|
|
209
|
-
setCurrentScreen(previousScreen);
|
|
210
|
-
setScreenHistory(newHistory);
|
|
211
|
-
} else {
|
|
212
|
-
// If no history, close the UI
|
|
213
|
-
if (onClose) {
|
|
214
|
-
onClose();
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
};
|
|
209
|
+
}, [navigate]);
|
|
218
210
|
|
|
219
211
|
// Render the current screen component
|
|
220
212
|
const renderScreen = () => {
|
|
221
213
|
const CurrentScreen = routes[currentScreen]?.component;
|
|
222
|
-
|
|
223
|
-
console.log('[OxyRouter] Rendering screen:', currentScreen);
|
|
224
|
-
console.log('[OxyRouter] Available routes:', Object.keys(routes));
|
|
225
|
-
console.log('[OxyRouter] Current screen component found:', !!CurrentScreen);
|
|
226
|
-
|
|
227
214
|
if (!CurrentScreen) {
|
|
228
|
-
|
|
215
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
216
|
+
console.error(`Screen "${currentScreen}" not found`);
|
|
217
|
+
}
|
|
229
218
|
return <View style={styles.errorContainer} />;
|
|
230
219
|
}
|
|
231
|
-
|
|
232
|
-
console.log('[OxyRouter] Rendering screen component for:', currentScreen);
|
|
233
220
|
return (
|
|
234
221
|
<CurrentScreen
|
|
235
222
|
oxyServices={oxyServices}
|
|
@@ -239,7 +226,7 @@ const OxyRouter: React.FC<OxyRouterProps> = ({
|
|
|
239
226
|
onAuthenticated={onAuthenticated}
|
|
240
227
|
theme={theme}
|
|
241
228
|
containerWidth={containerWidth}
|
|
242
|
-
{...
|
|
229
|
+
{...(screenPropsMap[currentScreen] || {})}
|
|
243
230
|
/>
|
|
244
231
|
);
|
|
245
232
|
};
|
|
@@ -254,15 +241,12 @@ const OxyRouter: React.FC<OxyRouterProps> = ({
|
|
|
254
241
|
const styles = StyleSheet.create({
|
|
255
242
|
container: {
|
|
256
243
|
flex: 1,
|
|
257
|
-
minHeight: 200, // Ensure minimum height
|
|
258
|
-
backgroundColor: 'transparent', // Make sure it's visible
|
|
259
244
|
},
|
|
260
245
|
errorContainer: {
|
|
261
246
|
flex: 1,
|
|
262
247
|
justifyContent: 'center',
|
|
263
248
|
alignItems: 'center',
|
|
264
249
|
minHeight: 100,
|
|
265
|
-
backgroundColor: 'red', // Make errors visible
|
|
266
250
|
},
|
|
267
251
|
});
|
|
268
252
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { OxyServices } from '../../core';
|
|
2
2
|
import { User } from '../../models/interfaces';
|
|
3
3
|
import { ComponentType, ReactNode } from 'react';
|
|
4
|
-
import { BottomSheetModalRef } from '../components/bottomSheet';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Base props for all screens in the Oxy UI system
|
|
@@ -33,7 +32,7 @@ export interface OxyRouterProps {
|
|
|
33
32
|
onClose?: () => void;
|
|
34
33
|
onAuthenticated?: (user: User) => void;
|
|
35
34
|
theme: 'light' | 'dark';
|
|
36
|
-
adjustSnapPoints
|
|
35
|
+
adjustSnapPoints?: (snapPoints: string[]) => void;
|
|
37
36
|
navigationRef?: React.MutableRefObject<((screen: string, props?: Record<string, any>) => void) | null>;
|
|
38
37
|
containerWidth?: number;
|
|
39
38
|
}
|
|
@@ -120,35 +119,15 @@ export interface OxyProviderProps {
|
|
|
120
119
|
onAuthStateChange?: (user: User | null) => void;
|
|
121
120
|
|
|
122
121
|
/**
|
|
123
|
-
*
|
|
122
|
+
* Prefix for keys in AsyncStorage
|
|
123
|
+
* @default "oxy"
|
|
124
124
|
*/
|
|
125
125
|
storageKeyPrefix?: string;
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
|
-
* Whether to show the internal toaster
|
|
128
|
+
* Whether to show the internal toaster in the bottom sheet
|
|
129
|
+
* If false, only the provider's global toaster will be shown
|
|
129
130
|
* @default true
|
|
130
131
|
*/
|
|
131
132
|
showInternalToaster?: boolean;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* External Redux store to use instead of the internal store
|
|
135
|
-
* If provided, the store must include the Oxy reducers using setupOxyStore()
|
|
136
|
-
* @example
|
|
137
|
-
* ```ts
|
|
138
|
-
* const store = configureStore({
|
|
139
|
-
* reducer: {
|
|
140
|
-
* ...setupOxyStore(),
|
|
141
|
-
* myAppReducer,
|
|
142
|
-
* },
|
|
143
|
-
* });
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
store?: any;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Skip Redux Provider wrapper if store is managed externally
|
|
150
|
-
* Set to true if your app already has a Redux Provider higher in the component tree
|
|
151
|
-
* @default false
|
|
152
|
-
*/
|
|
153
|
-
skipReduxProvider?: boolean;
|
|
154
133
|
}
|
|
@@ -13,13 +13,16 @@ import { BaseScreenProps } from '../navigation/types';
|
|
|
13
13
|
import { useOxy } from '../context/OxyContext';
|
|
14
14
|
import { packageInfo } from '../../constants/version';
|
|
15
15
|
import { toast } from '../../lib/sonner';
|
|
16
|
+
import { confirmAction } from '../utils/confirmAction';
|
|
16
17
|
import { Ionicons } from '@expo/vector-icons';
|
|
17
18
|
import { fontFamilies } from '../styles/fonts';
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
import {
|
|
20
|
+
ProfileCard,
|
|
21
|
+
Section,
|
|
22
|
+
QuickActions,
|
|
23
|
+
GroupedSection,
|
|
24
|
+
GroupedItem
|
|
25
|
+
} from '../components';
|
|
23
26
|
|
|
24
27
|
const AccountCenterScreen: React.FC<BaseScreenProps> = ({
|
|
25
28
|
onClose,
|
|
@@ -49,21 +52,9 @@ const AccountCenterScreen: React.FC<BaseScreenProps> = ({
|
|
|
49
52
|
};
|
|
50
53
|
|
|
51
54
|
const confirmLogout = () => {
|
|
52
|
-
|
|
53
|
-
'Sign Out',
|
|
55
|
+
confirmAction(
|
|
54
56
|
'Are you sure you want to sign out?',
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
text: 'Cancel',
|
|
58
|
-
style: 'cancel',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
text: 'Sign Out',
|
|
62
|
-
onPress: handleLogout,
|
|
63
|
-
style: 'destructive',
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
{ cancelable: true }
|
|
57
|
+
handleLogout
|
|
67
58
|
);
|
|
68
59
|
};
|
|
69
60
|
|
|
@@ -105,7 +96,7 @@ const AccountCenterScreen: React.FC<BaseScreenProps> = ({
|
|
|
105
96
|
{ id: 'settings', icon: 'settings', iconColor: '#5856D6', title: 'Settings', onPress: () => navigate('AccountSettings') },
|
|
106
97
|
{ id: 'sessions', icon: 'shield-checkmark', iconColor: '#30D158', title: 'Sessions', onPress: () => navigate('SessionManagement') },
|
|
107
98
|
{ id: 'premium', icon: 'star', iconColor: '#FFD700', title: 'Premium', onPress: () => navigate('PremiumSubscription') },
|
|
108
|
-
...(user?.isPremium ? [{ id: 'billing', icon: 'card', iconColor: '#34C759', title: 'Billing', onPress: () => navigate('
|
|
99
|
+
...(user?.isPremium ? [{ id: 'billing', icon: 'card', iconColor: '#34C759', title: 'Billing', onPress: () => navigate('') }] : []),
|
|
109
100
|
...(sessions && sessions.length > 1 ? [{ id: 'switch', icon: 'swap-horizontal', iconColor: '#FF9500', title: 'Switch', onPress: () => navigate('AccountSwitcher') }] : []),
|
|
110
101
|
]}
|
|
111
102
|
theme={theme}
|
|
@@ -162,7 +153,7 @@ const AccountCenterScreen: React.FC<BaseScreenProps> = ({
|
|
|
162
153
|
iconColor: '#34C759',
|
|
163
154
|
title: 'Billing Management',
|
|
164
155
|
subtitle: 'Payment methods and invoices',
|
|
165
|
-
onPress: () => navigate('
|
|
156
|
+
onPress: () => navigate(''),
|
|
166
157
|
}] : []),
|
|
167
158
|
]}
|
|
168
159
|
theme={theme}
|
|
@@ -18,6 +18,7 @@ import Avatar from '../components/Avatar';
|
|
|
18
18
|
import OxyIcon from '../components/icon/OxyIcon';
|
|
19
19
|
import { fontFamilies } from '../styles/fonts';
|
|
20
20
|
import { toast } from '../../lib/sonner';
|
|
21
|
+
import { confirmAction } from '../utils/confirmAction';
|
|
21
22
|
import { Ionicons } from '@expo/vector-icons';
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -89,7 +90,7 @@ const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
|
|
|
89
90
|
return {
|
|
90
91
|
id: session.sessionId,
|
|
91
92
|
sessionId: session.sessionId,
|
|
92
|
-
username:
|
|
93
|
+
username: 'Unknown User',
|
|
93
94
|
email: 'No email available',
|
|
94
95
|
avatar: null,
|
|
95
96
|
userProfile: null
|
|
@@ -129,21 +130,9 @@ const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
|
|
|
129
130
|
}, [logout, onClose]);
|
|
130
131
|
|
|
131
132
|
const confirmLogout = useCallback(() => {
|
|
132
|
-
|
|
133
|
-
'Sign Out',
|
|
133
|
+
confirmAction(
|
|
134
134
|
'Are you sure you want to sign out?',
|
|
135
|
-
|
|
136
|
-
{
|
|
137
|
-
text: 'Cancel',
|
|
138
|
-
style: 'cancel',
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
text: 'Sign Out',
|
|
142
|
-
onPress: handleLogout,
|
|
143
|
-
style: 'destructive',
|
|
144
|
-
},
|
|
145
|
-
],
|
|
146
|
-
{ cancelable: true }
|
|
135
|
+
handleLogout
|
|
147
136
|
);
|
|
148
137
|
}, [handleLogout]);
|
|
149
138
|
|
|
@@ -152,21 +141,9 @@ const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
|
|
|
152
141
|
}, []);
|
|
153
142
|
|
|
154
143
|
const handleSignOutAll = useCallback(() => {
|
|
155
|
-
|
|
156
|
-
'Sign Out of All Accounts',
|
|
144
|
+
confirmAction(
|
|
157
145
|
'Are you sure you want to sign out of all accounts?',
|
|
158
|
-
|
|
159
|
-
{
|
|
160
|
-
text: 'Cancel',
|
|
161
|
-
style: 'cancel',
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
text: 'Sign Out All',
|
|
165
|
-
onPress: handleLogout,
|
|
166
|
-
style: 'destructive',
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
{ cancelable: true }
|
|
146
|
+
handleLogout
|
|
170
147
|
);
|
|
171
148
|
}, [handleLogout]);
|
|
172
149
|
|
|
@@ -292,7 +269,6 @@ const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
|
|
|
292
269
|
{user?.isPremium && (
|
|
293
270
|
<TouchableOpacity
|
|
294
271
|
style={[styles.settingItem, styles.lastSettingItem]}
|
|
295
|
-
onPress={() => navigate?.('BillingManagement')}
|
|
296
272
|
>
|
|
297
273
|
<View style={styles.settingInfo}>
|
|
298
274
|
<OxyIcon name="card" size={20} color="#34C759" style={styles.settingIcon} />
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
Alert,
|
|
10
10
|
TextInput,
|
|
11
11
|
Animated,
|
|
12
|
+
Platform,
|
|
12
13
|
} from 'react-native';
|
|
13
14
|
import { BaseScreenProps } from '../navigation/types';
|
|
14
15
|
import { useOxy } from '../context/OxyContext';
|
|
@@ -17,6 +18,7 @@ import OxyIcon from '../components/icon/OxyIcon';
|
|
|
17
18
|
import { Ionicons } from '@expo/vector-icons';
|
|
18
19
|
import { toast } from '../../lib/sonner';
|
|
19
20
|
import { fontFamilies } from '../styles/fonts';
|
|
21
|
+
import { confirmAction } from '../utils/confirmAction';
|
|
20
22
|
|
|
21
23
|
const AccountSettingsScreen: React.FC<BaseScreenProps> = ({
|
|
22
24
|
onClose,
|
|
@@ -132,28 +134,11 @@ const AccountSettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
132
134
|
};
|
|
133
135
|
|
|
134
136
|
const handleAvatarUpdate = () => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
'
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
text: 'Cancel',
|
|
141
|
-
style: 'cancel',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
text: 'Use Mock URL',
|
|
145
|
-
onPress: () => {
|
|
146
|
-
const mockUrl = `https://ui-avatars.com/api/?name=${displayName || username}&background=random`;
|
|
147
|
-
setAvatarUrl(mockUrl);
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
text: 'Remove Avatar',
|
|
152
|
-
onPress: () => setAvatarUrl(''),
|
|
153
|
-
style: 'destructive',
|
|
154
|
-
},
|
|
155
|
-
]
|
|
156
|
-
);
|
|
137
|
+
// Always use confirmAction for both web and native
|
|
138
|
+
confirmAction('Remove your profile picture?', () => {
|
|
139
|
+
setAvatarUrl('');
|
|
140
|
+
toast.success('Avatar removed');
|
|
141
|
+
});
|
|
157
142
|
};
|
|
158
143
|
|
|
159
144
|
const startEditing = (type: string, currentValue: string) => {
|
|
@@ -17,6 +17,7 @@ import { SecureClientSession } from '../../models/secureSession';
|
|
|
17
17
|
import { fontFamilies } from '../styles/fonts';
|
|
18
18
|
import { User } from '../../models/interfaces';
|
|
19
19
|
import { toast } from '../../lib/sonner';
|
|
20
|
+
import { confirmAction } from '../utils/confirmAction';
|
|
20
21
|
import OxyIcon from '../components/icon/OxyIcon';
|
|
21
22
|
import { Ionicons } from '@expo/vector-icons';
|
|
22
23
|
import Avatar from '../components/Avatar';
|
|
@@ -142,40 +143,21 @@ const ModernAccountSwitcherScreen: React.FC<BaseScreenProps> = ({
|
|
|
142
143
|
}
|
|
143
144
|
};
|
|
144
145
|
|
|
145
|
-
const handleRemoveSession = async (sessionId: string) => {
|
|
146
|
-
|
|
147
|
-
if (!sessionToRemove) return;
|
|
148
|
-
|
|
149
|
-
const displayName = typeof sessionToRemove.userProfile?.name === 'object'
|
|
150
|
-
? sessionToRemove.userProfile.name.full || sessionToRemove.userProfile.name.first || sessionToRemove.userProfile.username
|
|
151
|
-
: sessionToRemove.userProfile?.name || sessionToRemove.userProfile?.username || 'this account';
|
|
152
|
-
|
|
153
|
-
Alert.alert(
|
|
154
|
-
'Remove Account',
|
|
146
|
+
const handleRemoveSession = async (sessionId: string, displayName: string) => {
|
|
147
|
+
confirmAction(
|
|
155
148
|
`Are you sure you want to remove ${displayName} from this device? You'll need to sign in again to access this account.`,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
toast.success('Account removed successfully!');
|
|
169
|
-
} catch (error) {
|
|
170
|
-
console.error('Remove session failed:', error);
|
|
171
|
-
toast.error('There was a problem removing the account. Please try again.');
|
|
172
|
-
} finally {
|
|
173
|
-
setRemovingUserId(null);
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
{ cancelable: true }
|
|
149
|
+
async () => {
|
|
150
|
+
setRemovingUserId(sessionId);
|
|
151
|
+
try {
|
|
152
|
+
await removeSession(sessionId);
|
|
153
|
+
toast.success('Account removed successfully!');
|
|
154
|
+
} catch (error) {
|
|
155
|
+
console.error('Remove session failed:', error);
|
|
156
|
+
toast.error('There was a problem removing the account. Please try again.');
|
|
157
|
+
} finally {
|
|
158
|
+
setRemovingUserId(null);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
179
161
|
);
|
|
180
162
|
};
|
|
181
163
|
|
|
@@ -238,34 +220,22 @@ const ModernAccountSwitcherScreen: React.FC<BaseScreenProps> = ({
|
|
|
238
220
|
};
|
|
239
221
|
|
|
240
222
|
const handleRemoteSessionLogout = async (sessionId: string, deviceName: string) => {
|
|
241
|
-
|
|
242
|
-
'Remove Device Session',
|
|
223
|
+
confirmAction(
|
|
243
224
|
`Are you sure you want to sign out from "${deviceName}"? This will end the session on that device.`,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
toast.success(`Signed out from ${deviceName} successfully!`);
|
|
259
|
-
} catch (error) {
|
|
260
|
-
console.error('Remote logout failed:', error);
|
|
261
|
-
toast.error('There was a problem signing out from the device. Please try again.');
|
|
262
|
-
} finally {
|
|
263
|
-
setRemoteLogoutSessionId(null);
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
},
|
|
267
|
-
],
|
|
268
|
-
{ cancelable: true }
|
|
225
|
+
async () => {
|
|
226
|
+
setRemoteLogoutSessionId(sessionId);
|
|
227
|
+
try {
|
|
228
|
+
await oxyServices?.logoutSecureSession(user?.sessionId || '', sessionId);
|
|
229
|
+
// Refresh device sessions list
|
|
230
|
+
await loadAllDeviceSessions();
|
|
231
|
+
toast.success(`Signed out from ${deviceName} successfully!`);
|
|
232
|
+
} catch (error) {
|
|
233
|
+
console.error('Remote logout failed:', error);
|
|
234
|
+
toast.error('There was a problem signing out from the device. Please try again.');
|
|
235
|
+
} finally {
|
|
236
|
+
setRemoteLogoutSessionId(null);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
269
239
|
);
|
|
270
240
|
};
|
|
271
241
|
|
|
@@ -277,34 +247,22 @@ const ModernAccountSwitcherScreen: React.FC<BaseScreenProps> = ({
|
|
|
277
247
|
return;
|
|
278
248
|
}
|
|
279
249
|
|
|
280
|
-
|
|
281
|
-
'Sign Out All Other Devices',
|
|
250
|
+
confirmAction(
|
|
282
251
|
`Are you sure you want to sign out from all ${otherDevicesCount} other device(s)? This will end sessions on all other devices except this one.`,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
toast.success('Signed out from all other devices successfully!');
|
|
298
|
-
} catch (error) {
|
|
299
|
-
console.error('Logout all devices failed:', error);
|
|
300
|
-
toast.error('There was a problem signing out from other devices. Please try again.');
|
|
301
|
-
} finally {
|
|
302
|
-
setLoggingOutAllDevices(false);
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
},
|
|
306
|
-
],
|
|
307
|
-
{ cancelable: true }
|
|
252
|
+
async () => {
|
|
253
|
+
setLoggingOutAllDevices(true);
|
|
254
|
+
try {
|
|
255
|
+
await oxyServices?.logoutAllDeviceSessions(user?.sessionId || '', undefined, true);
|
|
256
|
+
// Refresh device sessions list
|
|
257
|
+
await loadAllDeviceSessions();
|
|
258
|
+
toast.success('Signed out from all other devices successfully!');
|
|
259
|
+
} catch (error) {
|
|
260
|
+
console.error('Logout all devices failed:', error);
|
|
261
|
+
toast.error('There was a problem signing out from other devices. Please try again.');
|
|
262
|
+
} finally {
|
|
263
|
+
setLoggingOutAllDevices(false);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
308
266
|
);
|
|
309
267
|
};
|
|
310
268
|
|
|
@@ -432,7 +390,7 @@ const ModernAccountSwitcherScreen: React.FC<BaseScreenProps> = ({
|
|
|
432
390
|
</TouchableOpacity>
|
|
433
391
|
<TouchableOpacity
|
|
434
392
|
style={styles.removeButton}
|
|
435
|
-
onPress={() => handleRemoveSession(sessionWithUser.sessionId)}
|
|
393
|
+
onPress={() => handleRemoveSession(sessionWithUser.sessionId, displayName)}
|
|
436
394
|
disabled={isSwitching || isRemoving}
|
|
437
395
|
>
|
|
438
396
|
{isRemoving ? (
|