@oxyhq/services 5.7.5 → 5.8.2
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 +76 -76
- package/lib/commonjs/core/index.js +177 -102
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +69 -28
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +15 -6
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +100 -12
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +58 -13
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +7 -1
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +356 -0
- package/lib/commonjs/ui/components/Header.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +28 -7
- package/lib/commonjs/ui/components/OxyProvider.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 +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.js +606 -546
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.md +436 -0
- package/lib/commonjs/ui/context/OxyContext.js +181 -199
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/index.js +6 -0
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollow.js +59 -2
- package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +5 -2
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +11 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +6 -6
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +3 -3
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +241 -598
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +1160 -406
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +135 -237
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +246 -463
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +3 -3
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +808 -650
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +214 -37
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +51 -72
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +11 -29
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +30 -303
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +4 -4
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +90 -0
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +19 -31
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +7 -10
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +11 -5
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +11 -4
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +9 -6
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +3 -30
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +37 -46
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +9 -12
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +9 -12
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +9 -12
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +36 -6
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/stores/followStore.js +106 -1
- package/lib/commonjs/ui/stores/followStore.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +337 -0
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -0
- package/lib/commonjs/ui/styles/index.js +11 -0
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/module/core/index.js +177 -41
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +24 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +15 -6
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +101 -13
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +59 -14
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +7 -1
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/Header.js +351 -0
- package/lib/module/ui/components/Header.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +30 -9
- package/lib/module/ui/components/OxyProvider.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 +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.js +607 -547
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.md +436 -0
- package/lib/module/ui/context/OxyContext.js +180 -198
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/index.js +1 -1
- package/lib/module/ui/hooks/index.js.map +1 -1
- package/lib/module/ui/hooks/useFollow.js +57 -1
- package/lib/module/ui/hooks/useFollow.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +5 -2
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +11 -1
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +6 -6
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +3 -3
- package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +242 -597
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +1161 -407
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +135 -237
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +248 -465
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +3 -3
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +809 -651
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +214 -37
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +53 -74
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +11 -29
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +32 -305
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +5 -5
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +85 -0
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -0
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +19 -31
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +7 -10
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js +11 -5
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js +11 -4
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +9 -6
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +3 -30
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +37 -46
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +9 -12
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +9 -12
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +9 -12
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +36 -6
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/stores/followStore.js +106 -1
- package/lib/module/ui/stores/followStore.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +332 -0
- package/lib/module/ui/styles/authStyles.js.map +1 -0
- package/lib/module/ui/styles/index.js +1 -0
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/typescript/core/index.d.ts +68 -24
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +13 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/ui/components/FollowButton.d.ts +1 -0
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts +6 -0
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedSection.d.ts +6 -0
- package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/ui/components/Header.d.ts +24 -0
- package/lib/typescript/ui/components/Header.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyProvider.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/TextField.d.ts +31 -16
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +5 -2
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/index.d.ts +1 -1
- package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useFollow.d.ts +20 -0
- package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +9 -2
- package/lib/typescript/ui/navigation/types.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/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +5 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
- 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/UserLinksScreen.d.ts +15 -0
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +0 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +3 -1
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/stores/followStore.d.ts +10 -0
- package/lib/typescript/ui/stores/followStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/authStyles.d.ts +326 -0
- package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -0
- package/lib/typescript/ui/styles/index.d.ts +1 -0
- package/lib/typescript/ui/styles/index.d.ts.map +1 -1
- package/package.json +1 -4
- package/src/core/index.ts +195 -41
- package/src/index.ts +64 -4
- package/src/ui/components/Avatar.tsx +11 -5
- package/src/ui/components/FollowButton.tsx +95 -11
- package/src/ui/components/GroupedItem.tsx +57 -9
- package/src/ui/components/GroupedSection.tsx +12 -0
- package/src/ui/components/Header.tsx +405 -0
- package/src/ui/components/OxyProvider.tsx +37 -15
- package/src/ui/components/index.ts +1 -0
- package/src/ui/components/internal/GroupedPillButtons.tsx +1 -1
- package/src/ui/components/internal/TextField.md +436 -0
- package/src/ui/components/internal/TextField.tsx +720 -620
- package/src/ui/context/OxyContext.tsx +211 -195
- package/src/ui/hooks/index.ts +1 -1
- package/src/ui/hooks/useFollow.ts +63 -0
- package/src/ui/hooks/useSessionSocket.ts +5 -2
- package/src/ui/navigation/OxyRouter.tsx +11 -1
- package/src/ui/navigation/types.ts +10 -2
- package/src/ui/screens/AccountCenterScreen.tsx +5 -5
- package/src/ui/screens/AccountManagementDemo.tsx +9 -9
- package/src/ui/screens/AccountOverviewScreen.tsx +265 -414
- package/src/ui/screens/AccountSettingsScreen.tsx +1173 -403
- package/src/ui/screens/AccountSwitcherScreen.tsx +158 -202
- package/src/ui/screens/AppInfoScreen.tsx +270 -497
- package/src/ui/screens/FeedbackScreen.tsx +3 -3
- package/src/ui/screens/PaymentGatewayScreen.tsx +668 -365
- package/src/ui/screens/ProfileScreen.tsx +196 -33
- package/src/ui/screens/RecoverAccountScreen.tsx +46 -74
- package/src/ui/screens/SessionManagementScreen.tsx +14 -22
- package/src/ui/screens/SignInScreen.tsx +27 -294
- package/src/ui/screens/SignUpScreen.tsx +5 -5
- package/src/ui/screens/UserLinksScreen.tsx +96 -0
- package/src/ui/screens/internal/SignInPasswordStep.tsx +11 -22
- package/src/ui/screens/internal/SignInUsernameStep.tsx +3 -10
- package/src/ui/screens/internal/SignUpIdentityStep.tsx +2 -5
- package/src/ui/screens/internal/SignUpSecurityStep.tsx +3 -4
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +9 -2
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +1 -20
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +40 -24
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +9 -3
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +9 -3
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +9 -3
- package/src/ui/stores/authStore.ts +34 -7
- package/src/ui/stores/followStore.ts +102 -1
- package/src/ui/styles/authStyles.ts +352 -0
- package/src/ui/styles/index.ts +1 -0
- package/lib/commonjs/core/auth-manager.js +0 -440
- package/lib/commonjs/core/auth-manager.js.map +0 -1
- package/lib/commonjs/core/use-auth.js +0 -244
- package/lib/commonjs/core/use-auth.js.map +0 -1
- package/lib/module/core/auth-manager.js +0 -432
- package/lib/module/core/auth-manager.js.map +0 -1
- package/lib/module/core/use-auth.js +0 -235
- package/lib/module/core/use-auth.js.map +0 -1
- package/lib/typescript/core/auth-manager.d.ts +0 -136
- package/lib/typescript/core/auth-manager.d.ts.map +0 -1
- package/lib/typescript/core/use-auth.d.ts +0 -79
- package/lib/typescript/core/use-auth.d.ts.map +0 -1
- package/src/__tests__/middleware.test.ts +0 -105
- package/src/__tests__/setup.ts +0 -10
- package/src/__tests__/zero-config-auth.test.ts +0 -607
- package/src/core/auth-manager.ts +0 -500
- package/src/core/use-auth.tsx +0 -245
|
@@ -14,6 +14,11 @@ export const useFollow = (userId?: string | string[]) => {
|
|
|
14
14
|
const isFollowing = isSingleUser && userId ? followState.followingUsers[userId] ?? false : false;
|
|
15
15
|
const isLoading = isSingleUser && userId ? followState.loadingUsers[userId] ?? false : false;
|
|
16
16
|
const error = isSingleUser && userId ? followState.errors[userId] ?? null : null;
|
|
17
|
+
|
|
18
|
+
// Follower count helpers
|
|
19
|
+
const followerCount = isSingleUser && userId ? followState.followerCounts[userId] ?? null : null;
|
|
20
|
+
const followingCount = isSingleUser && userId ? followState.followingCounts[userId] ?? null : null;
|
|
21
|
+
const isLoadingCounts = isSingleUser && userId ? followState.loadingCounts[userId] ?? false : false;
|
|
17
22
|
|
|
18
23
|
const toggleFollow = useCallback(async () => {
|
|
19
24
|
if (!isSingleUser || !userId) throw new Error('toggleFollow is only available for single user mode');
|
|
@@ -35,6 +40,21 @@ export const useFollow = (userId?: string | string[]) => {
|
|
|
35
40
|
followState.clearFollowError(userId);
|
|
36
41
|
}, [isSingleUser, userId, followState]);
|
|
37
42
|
|
|
43
|
+
const fetchUserCounts = useCallback(async () => {
|
|
44
|
+
if (!isSingleUser || !userId) throw new Error('fetchUserCounts is only available for single user mode');
|
|
45
|
+
await followState.fetchUserCounts(userId, oxyServices);
|
|
46
|
+
}, [isSingleUser, userId, followState, oxyServices]);
|
|
47
|
+
|
|
48
|
+
const setFollowerCount = useCallback((count: number) => {
|
|
49
|
+
if (!isSingleUser || !userId) throw new Error('setFollowerCount is only available for single user mode');
|
|
50
|
+
followState.setFollowerCount(userId, count);
|
|
51
|
+
}, [isSingleUser, userId, followState]);
|
|
52
|
+
|
|
53
|
+
const setFollowingCount = useCallback((count: number) => {
|
|
54
|
+
if (!isSingleUser || !userId) throw new Error('setFollowingCount is only available for single user mode');
|
|
55
|
+
followState.setFollowingCount(userId, count);
|
|
56
|
+
}, [isSingleUser, userId, followState]);
|
|
57
|
+
|
|
38
58
|
// Multiple user helpers
|
|
39
59
|
const followData = useMemo(() => {
|
|
40
60
|
const data: Record<string, { isFollowing: boolean; isLoading: boolean; error: string | null }> = {};
|
|
@@ -69,6 +89,11 @@ export const useFollow = (userId?: string | string[]) => {
|
|
|
69
89
|
followState.clearFollowError(targetUserId);
|
|
70
90
|
}, [followState]);
|
|
71
91
|
|
|
92
|
+
const updateCountsFromFollowAction = useCallback((targetUserId: string, action: 'follow' | 'unfollow', counts: { followers: number; following: number }) => {
|
|
93
|
+
const currentUserId = oxyServices.getCurrentUserId() || undefined;
|
|
94
|
+
followState.updateCountsFromFollowAction(targetUserId, action, counts, currentUserId);
|
|
95
|
+
}, [followState, oxyServices]);
|
|
96
|
+
|
|
72
97
|
// Aggregate helpers for multiple users
|
|
73
98
|
const isAnyLoading = userIds.some(uid => followState.loadingUsers[uid]);
|
|
74
99
|
const hasAnyError = userIds.some(uid => !!followState.errors[uid]);
|
|
@@ -84,6 +109,13 @@ export const useFollow = (userId?: string | string[]) => {
|
|
|
84
109
|
setFollowStatus,
|
|
85
110
|
fetchStatus,
|
|
86
111
|
clearError,
|
|
112
|
+
// Follower count methods
|
|
113
|
+
followerCount,
|
|
114
|
+
followingCount,
|
|
115
|
+
isLoadingCounts,
|
|
116
|
+
fetchUserCounts,
|
|
117
|
+
setFollowerCount,
|
|
118
|
+
setFollowingCount,
|
|
87
119
|
};
|
|
88
120
|
}
|
|
89
121
|
|
|
@@ -99,4 +131,35 @@ export const useFollow = (userId?: string | string[]) => {
|
|
|
99
131
|
allFollowing,
|
|
100
132
|
allNotFollowing,
|
|
101
133
|
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// Convenience hook for just follower counts
|
|
137
|
+
export const useFollowerCounts = (userId: string) => {
|
|
138
|
+
const { oxyServices } = useOxy();
|
|
139
|
+
const followState = useFollowStore();
|
|
140
|
+
|
|
141
|
+
const followerCount = followState.followerCounts[userId] ?? null;
|
|
142
|
+
const followingCount = followState.followingCounts[userId] ?? null;
|
|
143
|
+
const isLoadingCounts = followState.loadingCounts[userId] ?? false;
|
|
144
|
+
|
|
145
|
+
const fetchUserCounts = useCallback(async () => {
|
|
146
|
+
await followState.fetchUserCounts(userId, oxyServices);
|
|
147
|
+
}, [userId, followState, oxyServices]);
|
|
148
|
+
|
|
149
|
+
const setFollowerCount = useCallback((count: number) => {
|
|
150
|
+
followState.setFollowerCount(userId, count);
|
|
151
|
+
}, [userId, followState]);
|
|
152
|
+
|
|
153
|
+
const setFollowingCount = useCallback((count: number) => {
|
|
154
|
+
followState.setFollowingCount(userId, count);
|
|
155
|
+
}, [userId, followState]);
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
followerCount,
|
|
159
|
+
followingCount,
|
|
160
|
+
isLoadingCounts,
|
|
161
|
+
fetchUserCounts,
|
|
162
|
+
setFollowerCount,
|
|
163
|
+
setFollowingCount,
|
|
164
|
+
};
|
|
102
165
|
};
|
|
@@ -33,12 +33,15 @@ export function useSessionSocket({ userId, activeSessionId, refreshSessions, log
|
|
|
33
33
|
|
|
34
34
|
socket.on('session_update', (data: { type: string; sessionId: string }) => {
|
|
35
35
|
console.log('Received session_update:', data);
|
|
36
|
+
|
|
37
|
+
// Always refresh sessions to get the latest state
|
|
38
|
+
refreshSessions();
|
|
39
|
+
|
|
40
|
+
// If the current session was logged out, handle it specially
|
|
36
41
|
if (data.sessionId === activeSessionId) {
|
|
37
42
|
if (onRemoteSignOut) onRemoteSignOut();
|
|
38
43
|
else toast.info('You have been signed out remotely.');
|
|
39
44
|
logout();
|
|
40
|
-
} else {
|
|
41
|
-
refreshSessions();
|
|
42
45
|
}
|
|
43
46
|
});
|
|
44
47
|
|
|
@@ -20,6 +20,7 @@ import KarmaAboutScreen from '../screens/karma/KarmaAboutScreen';
|
|
|
20
20
|
import KarmaRewardsScreen from '../screens/karma/KarmaRewardsScreen';
|
|
21
21
|
import KarmaFAQScreen from '../screens/karma/KarmaFAQScreen';
|
|
22
22
|
import ProfileScreen from '../screens/ProfileScreen';
|
|
23
|
+
import UserLinksScreen from '../screens/UserLinksScreen';
|
|
23
24
|
import FileManagementScreen from '../screens/FileManagementScreen';
|
|
24
25
|
import RecoverAccountScreen from '../screens/RecoverAccountScreen';
|
|
25
26
|
import PaymentGatewayScreen from '../screens/PaymentGatewayScreen';
|
|
@@ -57,7 +58,7 @@ const routes: Record<string, RouteConfig> = {
|
|
|
57
58
|
component: AccountOverviewScreen,
|
|
58
59
|
snapPoints: ['60%', '85%'],
|
|
59
60
|
},
|
|
60
|
-
|
|
61
|
+
EditProfile: {
|
|
61
62
|
component: AccountSettingsScreen,
|
|
62
63
|
snapPoints: ['60%', '100%'],
|
|
63
64
|
},
|
|
@@ -101,6 +102,10 @@ const routes: Record<string, RouteConfig> = {
|
|
|
101
102
|
component: ProfileScreen,
|
|
102
103
|
snapPoints: ['60%', '90%'],
|
|
103
104
|
},
|
|
105
|
+
UserLinks: {
|
|
106
|
+
component: UserLinksScreen,
|
|
107
|
+
snapPoints: ['60%', '90%'],
|
|
108
|
+
},
|
|
104
109
|
FileManagement: {
|
|
105
110
|
component: FileManagementScreen,
|
|
106
111
|
snapPoints: ['70%', '100%'],
|
|
@@ -135,11 +140,14 @@ const OxyRouter: React.FC<OxyRouterProps> = ({
|
|
|
135
140
|
|
|
136
141
|
// Memoized navigation methods
|
|
137
142
|
const navigate = useCallback((screen: string, props: Record<string, any> = {}) => {
|
|
143
|
+
console.log('OxyRouter: navigate called with screen:', screen, 'props:', props);
|
|
138
144
|
if (routes[screen]) {
|
|
145
|
+
console.log('OxyRouter: screen found in routes, navigating to:', screen);
|
|
139
146
|
setCurrentScreen(screen);
|
|
140
147
|
setScreenHistory(prev => [...prev, screen]);
|
|
141
148
|
setScreenPropsMap(prev => ({ ...prev, [screen]: props }));
|
|
142
149
|
} else {
|
|
150
|
+
console.error(`OxyRouter: Screen "${screen}" not found in routes:`, Object.keys(routes));
|
|
143
151
|
if (process.env.NODE_ENV !== 'production') {
|
|
144
152
|
console.error(`Screen "${screen}" not found`);
|
|
145
153
|
}
|
|
@@ -165,10 +173,12 @@ const OxyRouter: React.FC<OxyRouterProps> = ({
|
|
|
165
173
|
useEffect(() => {
|
|
166
174
|
if (navigationRef) {
|
|
167
175
|
navigationRef.current = navigate;
|
|
176
|
+
console.log('OxyRouter: navigationRef.current set to navigate function');
|
|
168
177
|
}
|
|
169
178
|
return () => {
|
|
170
179
|
if (navigationRef) {
|
|
171
180
|
navigationRef.current = null;
|
|
181
|
+
console.log('OxyRouter: navigationRef.current cleared');
|
|
172
182
|
}
|
|
173
183
|
};
|
|
174
184
|
}, [navigate, navigationRef]);
|
|
@@ -13,6 +13,9 @@ export interface BaseScreenProps {
|
|
|
13
13
|
onAuthenticated?: (user: User) => void;
|
|
14
14
|
theme: 'light' | 'dark';
|
|
15
15
|
containerWidth?: number;
|
|
16
|
+
initialStep?: number;
|
|
17
|
+
username?: string;
|
|
18
|
+
userProfile?: any;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
/**
|
|
@@ -42,9 +45,14 @@ export interface OxyRouterProps {
|
|
|
42
45
|
*/
|
|
43
46
|
export interface OxyProviderProps {
|
|
44
47
|
/**
|
|
45
|
-
* Instance of OxyServices
|
|
48
|
+
* Instance of OxyServices (optional if baseURL is provided)
|
|
46
49
|
*/
|
|
47
|
-
oxyServices
|
|
50
|
+
oxyServices?: OxyServices;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* API base URL for automatic service creation (optional if oxyServices is provided)
|
|
54
|
+
*/
|
|
55
|
+
baseURL?: string;
|
|
48
56
|
|
|
49
57
|
/**
|
|
50
58
|
* Initial screen to display
|
|
@@ -81,7 +81,7 @@ const AccountCenterScreen: React.FC<BaseScreenProps> = ({
|
|
|
81
81
|
<ProfileCard
|
|
82
82
|
user={user}
|
|
83
83
|
theme={theme}
|
|
84
|
-
onEditPress={() => navigate('
|
|
84
|
+
onEditPress={() => navigate('EditProfile', { activeTab: 'profile' })}
|
|
85
85
|
onClosePress={onClose}
|
|
86
86
|
showCloseButton={!!onClose}
|
|
87
87
|
/>
|
|
@@ -93,7 +93,7 @@ const AccountCenterScreen: React.FC<BaseScreenProps> = ({
|
|
|
93
93
|
<QuickActions
|
|
94
94
|
actions={[
|
|
95
95
|
{ id: 'overview', icon: 'person-circle', iconColor: '#007AFF', title: 'Overview', onPress: () => navigate('AccountOverview') },
|
|
96
|
-
{ id: 'settings', icon: 'settings', iconColor: '#5856D6', title: '
|
|
96
|
+
{ id: 'settings', icon: 'settings', iconColor: '#5856D6', title: 'Edit Profile', onPress: () => navigate('EditProfile') },
|
|
97
97
|
{ id: 'sessions', icon: 'shield-checkmark', iconColor: '#30D158', title: 'Sessions', onPress: () => navigate('SessionManagement') },
|
|
98
98
|
{ id: 'premium', icon: 'star', iconColor: '#FFD700', title: 'Premium', onPress: () => navigate('PremiumSubscription') },
|
|
99
99
|
...(user?.isPremium ? [{ id: 'billing', icon: 'card', iconColor: '#34C759', title: 'Billing', onPress: () => navigate('') }] : []),
|
|
@@ -119,9 +119,9 @@ const AccountCenterScreen: React.FC<BaseScreenProps> = ({
|
|
|
119
119
|
id: 'settings',
|
|
120
120
|
icon: 'settings',
|
|
121
121
|
iconColor: '#5856D6',
|
|
122
|
-
title: '
|
|
123
|
-
subtitle: 'Manage your preferences',
|
|
124
|
-
onPress: () => navigate('
|
|
122
|
+
title: 'Edit Profile',
|
|
123
|
+
subtitle: 'Manage your profile and preferences',
|
|
124
|
+
onPress: () => navigate('EditProfile'),
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
id: 'sessions',
|
|
@@ -30,7 +30,7 @@ const AccountManagementDemo: React.FC = () => {
|
|
|
30
30
|
'Multi-account switching',
|
|
31
31
|
'Session management access'
|
|
32
32
|
]}
|
|
33
|
-
navigatesTo={['AccountOverview', 'AccountSwitcher', '
|
|
33
|
+
navigatesTo={['AccountOverview', 'AccountSwitcher', 'EditProfile', 'SessionManagement']}
|
|
34
34
|
/>
|
|
35
35
|
|
|
36
36
|
<ScreenCard
|
|
@@ -42,11 +42,11 @@ const AccountManagementDemo: React.FC = () => {
|
|
|
42
42
|
'Subscription management',
|
|
43
43
|
'Privacy and security overview'
|
|
44
44
|
]}
|
|
45
|
-
navigatesTo={['
|
|
45
|
+
navigatesTo={['EditProfile', 'SessionManagement']}
|
|
46
46
|
/>
|
|
47
47
|
|
|
48
48
|
<ScreenCard
|
|
49
|
-
title="
|
|
49
|
+
title="EditProfileScreen"
|
|
50
50
|
description="Complete account configuration and preferences"
|
|
51
51
|
features={[
|
|
52
52
|
'Profile editing (username, email, name)',
|
|
@@ -90,22 +90,22 @@ const AccountManagementDemo: React.FC = () => {
|
|
|
90
90
|
<Text style={styles.flowDescription}>
|
|
91
91
|
The screens are designed with intuitive navigation patterns:
|
|
92
92
|
</Text>
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
<View style={styles.flowItem}>
|
|
95
95
|
<Text style={styles.flowStep}>1. Entry Point</Text>
|
|
96
96
|
<Text style={styles.flowText}>Users typically start at AccountCenterScreen</Text>
|
|
97
97
|
</View>
|
|
98
|
-
|
|
98
|
+
|
|
99
99
|
<View style={styles.flowItem}>
|
|
100
100
|
<Text style={styles.flowStep}>2. Explore</Text>
|
|
101
101
|
<Text style={styles.flowText}>Navigate to specific screens based on needs</Text>
|
|
102
102
|
</View>
|
|
103
|
-
|
|
103
|
+
|
|
104
104
|
<View style={styles.flowItem}>
|
|
105
105
|
<Text style={styles.flowStep}>3. Manage</Text>
|
|
106
106
|
<Text style={styles.flowText}>Perform account actions in specialized screens</Text>
|
|
107
107
|
</View>
|
|
108
|
-
|
|
108
|
+
|
|
109
109
|
<View style={styles.flowItem}>
|
|
110
110
|
<Text style={styles.flowStep}>4. Return</Text>
|
|
111
111
|
<Text style={styles.flowText}>Navigate back or to related screens seamlessly</Text>
|
|
@@ -142,12 +142,12 @@ const ScreenCard: React.FC<{
|
|
|
142
142
|
<View style={styles.screenCard}>
|
|
143
143
|
<Text style={styles.screenTitle}>{title}</Text>
|
|
144
144
|
<Text style={styles.screenDescription}>{description}</Text>
|
|
145
|
-
|
|
145
|
+
|
|
146
146
|
<Text style={styles.featuresTitle}>Features:</Text>
|
|
147
147
|
{features.map((feature, index) => (
|
|
148
148
|
<Text key={index} style={styles.feature}>• {feature}</Text>
|
|
149
149
|
))}
|
|
150
|
-
|
|
150
|
+
|
|
151
151
|
<Text style={styles.navigationTitle}>Navigates to:</Text>
|
|
152
152
|
{navigatesTo.map((nav, index) => (
|
|
153
153
|
<Text key={index} style={styles.navigationItem}>→ {nav}</Text>
|