@oxyhq/services 5.11.9 → 5.11.11
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/ui/components/AnimationExample.js +213 -0
- package/lib/commonjs/ui/components/AnimationExample.js.map +1 -0
- package/lib/commonjs/ui/components/FollowButton.js +58 -47
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +2 -1
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +3 -0
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +26 -12
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +69 -33
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +5 -1
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.README.md +337 -0
- package/lib/commonjs/ui/components/StepBasedScreen.js +361 -0
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -0
- package/lib/commonjs/ui/components/icon/OxyIcon.js +3 -3
- package/lib/commonjs/ui/components/icon/OxyIcon.js.map +1 -1
- package/lib/commonjs/ui/components/index.js +0 -7
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.js +8 -4
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js +161 -0
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +103 -44
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollow.types.js +2 -0
- package/lib/commonjs/ui/hooks/useFollow.types.js.map +1 -0
- package/lib/commonjs/ui/navigation/OxyRouter.js +10 -0
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +26 -14
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +3 -3
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +64 -15
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +4 -4
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +72 -75
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +286 -126
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +322 -0
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/ProfileScreen.js +56 -56
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +87 -219
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +176 -174
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +138 -244
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +143 -744
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +386 -0
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +25 -15
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +16 -9
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js +110 -0
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js.map +1 -0
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js +138 -0
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js.map +1 -0
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js +141 -0
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js.map +1 -0
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js +165 -0
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js.map +1 -0
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js +150 -0
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js.map +1 -0
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js +171 -0
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js.map +1 -0
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js +163 -0
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js.map +1 -0
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js +170 -0
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js.map +1 -0
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js +72 -0
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js.map +1 -0
- package/lib/commonjs/ui/styles/authStyles.js +1 -1
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/components/AnimationExample.js +209 -0
- package/lib/module/ui/components/AnimationExample.js.map +1 -0
- package/lib/module/ui/components/FollowButton.js +58 -47
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +2 -1
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +3 -0
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/Header.js +26 -12
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +70 -34
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +5 -1
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/Section.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.README.md +337 -0
- package/lib/module/ui/components/StepBasedScreen.js +356 -0
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -0
- package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -1
- package/lib/module/ui/components/icon/OxyIcon.js +3 -3
- package/lib/module/ui/components/icon/OxyIcon.js.map +1 -1
- package/lib/module/ui/components/index.js +0 -1
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +1 -1
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.js +8 -4
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js +156 -0
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +103 -45
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useFollow.types.js +2 -0
- package/lib/module/ui/hooks/useFollow.types.js.map +1 -0
- package/lib/module/ui/navigation/OxyRouter.js +10 -0
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +12 -1
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +3 -3
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +64 -15
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +4 -4
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +72 -75
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +285 -125
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +319 -0
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -0
- package/lib/module/ui/screens/ProfileScreen.js +56 -56
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +91 -222
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +177 -175
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +140 -246
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +145 -745
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +382 -0
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -0
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +23 -14
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +15 -9
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverRequestStep.js +105 -0
- package/lib/module/ui/screens/steps/RecoverRequestStep.js.map +1 -0
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js +133 -0
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js.map +1 -0
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js +136 -0
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js.map +1 -0
- package/lib/module/ui/screens/steps/SignInPasswordStep.js +160 -0
- package/lib/module/ui/screens/steps/SignInPasswordStep.js.map +1 -0
- package/lib/module/ui/screens/steps/SignInUsernameStep.js +145 -0
- package/lib/module/ui/screens/steps/SignInUsernameStep.js.map +1 -0
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js +166 -0
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js.map +1 -0
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js +158 -0
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js.map +1 -0
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js +165 -0
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js.map +1 -0
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js +67 -0
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js.map +1 -0
- package/lib/module/ui/styles/authStyles.js +1 -1
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +5 -8
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/models/session.d.ts +1 -4
- package/lib/typescript/models/session.d.ts.map +1 -1
- package/lib/typescript/ui/components/AnimationExample.d.ts +4 -0
- package/lib/typescript/ui/components/AnimationExample.d.ts.map +1 -0
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/Header.d.ts +9 -0
- package/lib/typescript/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyPayButton.d.ts +2 -2
- package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/ProfileCard.d.ts +1 -3
- package/lib/typescript/ui/components/ProfileCard.d.ts.map +1 -1
- package/lib/typescript/ui/components/Section.d.ts +2 -1
- package/lib/typescript/ui/components/Section.d.ts.map +1 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts +2 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts.map +1 -1
- package/lib/typescript/ui/components/StepBasedScreen.d.ts +24 -0
- package/lib/typescript/ui/components/StepBasedScreen.d.ts.map +1 -0
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +2 -1
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts.map +1 -1
- package/lib/typescript/ui/components/icon/OxyIcon.d.ts +1 -1
- package/lib/typescript/ui/components/icon/OxyIcon.d.ts.map +1 -1
- package/lib/typescript/ui/components/index.d.ts +0 -1
- package/lib/typescript/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/PinInput.d.ts +9 -1
- package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/components/photogrid/JustifiedPhotoGrid.d.ts +27 -0
- package/lib/typescript/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -0
- package/lib/typescript/ui/context/OxyContext.d.ts +8 -3
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useFollow.types.d.ts +33 -0
- package/lib/typescript/ui/hooks/useFollow.types.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +5 -0
- 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/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts +18 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts +7 -0
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +2 -2
- 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 +2 -9
- 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/SignUpScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts +13 -0
- package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +5 -5
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +4 -4
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts +21 -0
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts +18 -0
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts +24 -0
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts +27 -0
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts +27 -0
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts +25 -0
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts +26 -0
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts +16 -0
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts +13 -0
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts.map +1 -0
- package/lib/typescript/ui/styles/authStyles.d.ts +1 -1
- package/package.json +10 -3
- package/src/models/interfaces.ts +7 -8
- package/src/models/session.ts +1 -4
- package/src/ui/components/AnimationExample.tsx +195 -0
- package/src/ui/components/FollowButton.tsx +65 -45
- package/src/ui/components/GroupedItem.tsx +1 -0
- package/src/ui/components/GroupedSection.tsx +1 -1
- package/src/ui/components/Header.tsx +37 -13
- package/src/ui/components/OxyPayButton.tsx +2 -2
- package/src/ui/components/OxyProvider.tsx +67 -33
- package/src/ui/components/ProfileCard.tsx +6 -8
- package/src/ui/components/Section.tsx +7 -7
- package/src/ui/components/SectionTitle.tsx +2 -2
- package/src/ui/components/StepBasedScreen.README.md +337 -0
- package/src/ui/components/StepBasedScreen.tsx +417 -0
- package/src/ui/components/icon/FAIRWalletIcon.tsx +2 -2
- package/src/ui/components/icon/OxyIcon.tsx +10 -11
- package/src/ui/components/index.ts +0 -1
- package/src/ui/components/internal/PinInput.tsx +13 -4
- package/src/ui/components/internal/TextField.tsx +12 -6
- package/src/ui/components/photogrid/JustifiedPhotoGrid.tsx +158 -0
- package/src/ui/context/OxyContext.tsx +90 -59
- package/src/ui/hooks/useFollow.types.ts +33 -0
- package/src/ui/navigation/OxyRouter.tsx +10 -0
- package/src/ui/navigation/types.ts +6 -0
- package/src/ui/screens/AccountCenterScreen.tsx +13 -7
- package/src/ui/screens/AccountOverviewScreen.tsx +3 -3
- package/src/ui/screens/AccountSettingsScreen.tsx +65 -13
- package/src/ui/screens/AccountSwitcherScreen.tsx +4 -4
- package/src/ui/screens/FeedbackScreen.tsx +57 -80
- package/src/ui/screens/FileManagementScreen.tsx +278 -175
- package/src/ui/screens/LanguageSelectorScreen.tsx +322 -0
- package/src/ui/screens/PaymentGatewayScreen.tsx +2 -2
- package/src/ui/screens/ProfileScreen.tsx +60 -55
- package/src/ui/screens/RecoverAccountScreen.tsx +98 -211
- package/src/ui/screens/SessionManagementScreen.tsx +148 -151
- package/src/ui/screens/SignInScreen.tsx +148 -290
- package/src/ui/screens/SignUpScreen.tsx +147 -751
- package/src/ui/screens/WelcomeNewUserScreen.tsx +272 -0
- package/src/ui/screens/internal/SignInPasswordStep.tsx +28 -13
- package/src/ui/screens/internal/SignInUsernameStep.tsx +21 -11
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +1 -1
- package/src/ui/screens/steps/RecoverRequestStep.tsx +130 -0
- package/src/ui/screens/steps/RecoverSuccessStep.tsx +131 -0
- package/src/ui/screens/steps/RecoverVerifyStep.tsx +153 -0
- package/src/ui/screens/steps/SignInPasswordStep.tsx +172 -0
- package/src/ui/screens/steps/SignInUsernameStep.tsx +176 -0
- package/src/ui/screens/steps/SignUpIdentityStep.tsx +204 -0
- package/src/ui/screens/steps/SignUpSecurityStep.tsx +191 -0
- package/src/ui/screens/steps/SignUpSummaryStep.tsx +130 -0
- package/src/ui/screens/steps/SignUpWelcomeStep.tsx +65 -0
- package/src/ui/styles/authStyles.ts +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface SignUpSecurityStepProps {
|
|
3
|
+
colors: any;
|
|
4
|
+
styles: any;
|
|
5
|
+
theme: string;
|
|
6
|
+
navigate: (screen: string, props?: Record<string, any>) => void;
|
|
7
|
+
nextStep: () => void;
|
|
8
|
+
prevStep: () => void;
|
|
9
|
+
currentStep: number;
|
|
10
|
+
totalSteps: number;
|
|
11
|
+
stepData?: any;
|
|
12
|
+
updateStepData: (data: any) => void;
|
|
13
|
+
password: string;
|
|
14
|
+
confirmPassword: string;
|
|
15
|
+
setPassword: (password: string) => void;
|
|
16
|
+
setConfirmPassword: (confirmPassword: string) => void;
|
|
17
|
+
showPassword: boolean;
|
|
18
|
+
showConfirmPassword: boolean;
|
|
19
|
+
setShowPassword: (show: boolean) => void;
|
|
20
|
+
setShowConfirmPassword: (show: boolean) => void;
|
|
21
|
+
setErrorMessage: (message: string) => void;
|
|
22
|
+
validatePassword: (password: string) => boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const SignUpSecurityStep: React.FC<SignUpSecurityStepProps>;
|
|
25
|
+
export default SignUpSecurityStep;
|
|
26
|
+
//# sourceMappingURL=SignUpSecurityStep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignUpSecurityStep.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/steps/SignUpSecurityStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,UAAU,uBAAuB;IAE7B,MAAM,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAGhE,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAGnB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,cAAc,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAGpC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,kBAAkB,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,sBAAsB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAG3C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACnD;AAED,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAqJzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface SignUpSummaryStepProps {
|
|
3
|
+
colors: any;
|
|
4
|
+
styles: any;
|
|
5
|
+
theme: string;
|
|
6
|
+
navigate: (screen: string, props?: Record<string, any>) => void;
|
|
7
|
+
nextStep: () => void;
|
|
8
|
+
prevStep: () => void;
|
|
9
|
+
currentStep: number;
|
|
10
|
+
totalSteps: number;
|
|
11
|
+
allStepData: any[];
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const SignUpSummaryStep: React.FC<SignUpSummaryStepProps>;
|
|
15
|
+
export default SignUpSummaryStep;
|
|
16
|
+
//# sourceMappingURL=SignUpSummaryStep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignUpSummaryStep.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/steps/SignUpSummaryStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,sBAAsB;IAE5B,MAAM,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAGhE,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAGnB,WAAW,EAAE,GAAG,EAAE,CAAC;IAGnB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAsGvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface SignUpWelcomeStepProps {
|
|
3
|
+
colors: any;
|
|
4
|
+
styles: any;
|
|
5
|
+
theme: string;
|
|
6
|
+
navigate: (screen: string, props?: Record<string, any>) => void;
|
|
7
|
+
nextStep: () => void;
|
|
8
|
+
currentStep: number;
|
|
9
|
+
totalSteps: number;
|
|
10
|
+
}
|
|
11
|
+
declare const SignUpWelcomeStep: React.FC<SignUpWelcomeStepProps>;
|
|
12
|
+
export default SignUpWelcomeStep;
|
|
13
|
+
//# sourceMappingURL=SignUpWelcomeStep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignUpWelcomeStep.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/steps/SignUpWelcomeStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,UAAU,sBAAsB;IAE5B,MAAM,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAGhE,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA4CvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -241,7 +241,7 @@ export declare const createAuthStyles: (colors: AuthThemeColors, theme: string)
|
|
|
241
241
|
fontWeight: "bold" | undefined;
|
|
242
242
|
fontSize: number;
|
|
243
243
|
marginBottom: number;
|
|
244
|
-
textAlign: "
|
|
244
|
+
textAlign: "left";
|
|
245
245
|
letterSpacing: number;
|
|
246
246
|
};
|
|
247
247
|
modernUsernameSubtext: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "5.11.
|
|
3
|
+
"version": "5.11.11",
|
|
4
4
|
"description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -47,6 +47,10 @@
|
|
|
47
47
|
"repository": "https://github.com/oxyhq/oxyhqservices",
|
|
48
48
|
"author": "OxyHQ",
|
|
49
49
|
"license": "MIT",
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=18.0.0",
|
|
52
|
+
"npm": ">=9.0.0"
|
|
53
|
+
},
|
|
50
54
|
"bugs": {
|
|
51
55
|
"url": "https://github.com/oxyhq/oxyhqservices/issues"
|
|
52
56
|
},
|
|
@@ -84,7 +88,10 @@
|
|
|
84
88
|
"sonner-native": "^0.20.0",
|
|
85
89
|
"tailwindcss": "^4.1.11",
|
|
86
90
|
"zod": "^3.25.64",
|
|
87
|
-
"zustand": "^5.0.6"
|
|
91
|
+
"zustand": "^5.0.6",
|
|
92
|
+
"@tanstack/react-query": "^5.59.0",
|
|
93
|
+
"@amir-hossein-karimi/bottom-sheet": "^9.1.2",
|
|
94
|
+
"@gorhom/bottom-sheet": "^5.1.6"
|
|
88
95
|
},
|
|
89
96
|
"devDependencies": {
|
|
90
97
|
"@biomejs/biome": "^1.9.4",
|
|
@@ -121,7 +128,7 @@
|
|
|
121
128
|
"axios": "^1.9.0",
|
|
122
129
|
"invariant": "^2.2.4",
|
|
123
130
|
"jwt-decode": "^4.0.0",
|
|
124
|
-
"react": ">=18.
|
|
131
|
+
"react": ">=18.0.0",
|
|
125
132
|
"react-native": ">=0.76.0",
|
|
126
133
|
"react-native-gesture-handler": ">=2.16.1",
|
|
127
134
|
"react-native-reanimated": ">=3.16.0",
|
package/src/models/interfaces.ts
CHANGED
|
@@ -6,11 +6,8 @@ export interface User {
|
|
|
6
6
|
id: string;
|
|
7
7
|
username: string;
|
|
8
8
|
email?: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
url?: string;
|
|
12
|
-
[key: string]: unknown;
|
|
13
|
-
};
|
|
9
|
+
// Avatar file id (asset id)
|
|
10
|
+
avatar?: string;
|
|
14
11
|
name?: {
|
|
15
12
|
first?: string;
|
|
16
13
|
last?: string;
|
|
@@ -221,6 +218,8 @@ export interface AssetLink {
|
|
|
221
218
|
createdAt: string;
|
|
222
219
|
}
|
|
223
220
|
|
|
221
|
+
export type AssetMetadata = Record<string, string | number | boolean | null | undefined>;
|
|
222
|
+
|
|
224
223
|
export interface AssetVariant {
|
|
225
224
|
type: string;
|
|
226
225
|
key: string;
|
|
@@ -228,7 +227,7 @@ export interface AssetVariant {
|
|
|
228
227
|
height?: number;
|
|
229
228
|
readyAt?: string;
|
|
230
229
|
size?: number;
|
|
231
|
-
metadata?:
|
|
230
|
+
metadata?: AssetMetadata;
|
|
232
231
|
}
|
|
233
232
|
|
|
234
233
|
export interface Asset {
|
|
@@ -245,7 +244,7 @@ export interface Asset {
|
|
|
245
244
|
updatedAt: string;
|
|
246
245
|
links: AssetLink[];
|
|
247
246
|
variants: AssetVariant[];
|
|
248
|
-
metadata?:
|
|
247
|
+
metadata?: AssetMetadata;
|
|
249
248
|
}
|
|
250
249
|
|
|
251
250
|
export interface AssetInitRequest {
|
|
@@ -265,7 +264,7 @@ export interface AssetCompleteRequest {
|
|
|
265
264
|
originalName: string;
|
|
266
265
|
size: number;
|
|
267
266
|
mime: string;
|
|
268
|
-
metadata?:
|
|
267
|
+
metadata?: AssetMetadata;
|
|
269
268
|
}
|
|
270
269
|
|
|
271
270
|
export interface AssetLinkRequest {
|
package/src/models/session.ts
CHANGED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
|
|
4
|
+
import Animated, {
|
|
5
|
+
useSharedValue,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
withTiming,
|
|
8
|
+
withSpring,
|
|
9
|
+
withSequence,
|
|
10
|
+
withDelay,
|
|
11
|
+
interpolateColor,
|
|
12
|
+
runOnJS,
|
|
13
|
+
Easing,
|
|
14
|
+
} from 'react-native-reanimated';
|
|
15
|
+
|
|
16
|
+
// Example component showcasing improved Reanimated usage
|
|
17
|
+
const AnimationExample: React.FC = () => {
|
|
18
|
+
const [currentStep, setCurrentStep] = useState(0);
|
|
19
|
+
|
|
20
|
+
// Shared values for better performance
|
|
21
|
+
const opacity = useSharedValue(1);
|
|
22
|
+
const scale = useSharedValue(1);
|
|
23
|
+
const translateX = useSharedValue(0);
|
|
24
|
+
const rotation = useSharedValue(0);
|
|
25
|
+
const progress = useSharedValue(0);
|
|
26
|
+
const colorProgress = useSharedValue(0);
|
|
27
|
+
|
|
28
|
+
// Animated styles with proper interpolation
|
|
29
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
30
|
+
return {
|
|
31
|
+
opacity: opacity.value,
|
|
32
|
+
transform: [
|
|
33
|
+
{ scale: scale.value },
|
|
34
|
+
{ translateX: translateX.value },
|
|
35
|
+
{ rotate: `${rotation.value}deg` },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const progressStyle = useAnimatedStyle(() => {
|
|
41
|
+
return {
|
|
42
|
+
width: `${progress.value * 100}%`,
|
|
43
|
+
backgroundColor: interpolateColor(
|
|
44
|
+
colorProgress.value,
|
|
45
|
+
[0, 1],
|
|
46
|
+
['#3498db', '#e74c3c']
|
|
47
|
+
),
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const backgroundStyle = useAnimatedStyle(() => {
|
|
52
|
+
return {
|
|
53
|
+
backgroundColor: interpolateColor(
|
|
54
|
+
colorProgress.value,
|
|
55
|
+
[0, 1],
|
|
56
|
+
['#ecf0f1', '#f39c12']
|
|
57
|
+
),
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// Complex animation sequence
|
|
62
|
+
const animateSequence = () => {
|
|
63
|
+
'worklet';
|
|
64
|
+
|
|
65
|
+
// Staggered animations for smooth transitions
|
|
66
|
+
opacity.value = withTiming(0.5, { duration: 200 });
|
|
67
|
+
scale.value = withSpring(0.8, { damping: 15, stiffness: 150 });
|
|
68
|
+
|
|
69
|
+
// Delayed follow-up animations
|
|
70
|
+
translateX.value = withDelay(
|
|
71
|
+
100,
|
|
72
|
+
withSpring(50, { damping: 20, stiffness: 100 }, (finished) => {
|
|
73
|
+
if (finished) {
|
|
74
|
+
translateX.value = withSpring(0, { damping: 15, stiffness: 150 });
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// Sequential animations
|
|
80
|
+
rotation.value = withSequence(
|
|
81
|
+
withTiming(10, { duration: 150 }),
|
|
82
|
+
withTiming(-10, { duration: 150 }),
|
|
83
|
+
withTiming(0, { duration: 150 })
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
// Progress animation with easing
|
|
87
|
+
progress.value = withTiming(1, {
|
|
88
|
+
duration: 1000,
|
|
89
|
+
easing: Easing.out(Easing.exp)
|
|
90
|
+
}, (finished) => {
|
|
91
|
+
if (finished) {
|
|
92
|
+
runOnJS(setCurrentStep)(currentStep + 1);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// Color transition
|
|
97
|
+
colorProgress.value = withTiming(1, { duration: 800 });
|
|
98
|
+
|
|
99
|
+
// Reset animations
|
|
100
|
+
setTimeout(() => {
|
|
101
|
+
opacity.value = withSpring(1);
|
|
102
|
+
scale.value = withSpring(1);
|
|
103
|
+
progress.value = withTiming(0, { duration: 500 });
|
|
104
|
+
colorProgress.value = withTiming(0, { duration: 500 });
|
|
105
|
+
}, 1500);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<Animated.View style={[styles.container, backgroundStyle]}>
|
|
110
|
+
<Text style={styles.title}>Advanced Reanimated Example</Text>
|
|
111
|
+
<Text style={styles.subtitle}>Step: {currentStep}</Text>
|
|
112
|
+
|
|
113
|
+
<Animated.View style={[styles.box, animatedStyle]}>
|
|
114
|
+
<Text style={styles.boxText}>Animated Box</Text>
|
|
115
|
+
</Animated.View>
|
|
116
|
+
|
|
117
|
+
<View style={styles.progressContainer}>
|
|
118
|
+
<Animated.View style={[styles.progressBar, progressStyle]} />
|
|
119
|
+
</View>
|
|
120
|
+
|
|
121
|
+
<TouchableOpacity style={styles.button} onPress={animateSequence}>
|
|
122
|
+
<Text style={styles.buttonText}>Animate Sequence</Text>
|
|
123
|
+
</TouchableOpacity>
|
|
124
|
+
</Animated.View>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const styles = StyleSheet.create({
|
|
129
|
+
container: {
|
|
130
|
+
flex: 1,
|
|
131
|
+
justifyContent: 'center',
|
|
132
|
+
alignItems: 'center',
|
|
133
|
+
padding: 20,
|
|
134
|
+
},
|
|
135
|
+
title: {
|
|
136
|
+
fontSize: 24,
|
|
137
|
+
fontWeight: 'bold',
|
|
138
|
+
marginBottom: 10,
|
|
139
|
+
color: '#2c3e50',
|
|
140
|
+
},
|
|
141
|
+
subtitle: {
|
|
142
|
+
fontSize: 16,
|
|
143
|
+
marginBottom: 30,
|
|
144
|
+
color: '#7f8c8d',
|
|
145
|
+
},
|
|
146
|
+
box: {
|
|
147
|
+
width: 150,
|
|
148
|
+
height: 150,
|
|
149
|
+
backgroundColor: '#3498db',
|
|
150
|
+
borderRadius: 20,
|
|
151
|
+
justifyContent: 'center',
|
|
152
|
+
alignItems: 'center',
|
|
153
|
+
marginBottom: 30,
|
|
154
|
+
shadowColor: '#000',
|
|
155
|
+
shadowOffset: { width: 0, height: 4 },
|
|
156
|
+
shadowOpacity: 0.3,
|
|
157
|
+
shadowRadius: 8,
|
|
158
|
+
elevation: 8,
|
|
159
|
+
},
|
|
160
|
+
boxText: {
|
|
161
|
+
color: 'white',
|
|
162
|
+
fontSize: 16,
|
|
163
|
+
fontWeight: 'bold',
|
|
164
|
+
},
|
|
165
|
+
progressContainer: {
|
|
166
|
+
width: '100%',
|
|
167
|
+
height: 10,
|
|
168
|
+
backgroundColor: '#ecf0f1',
|
|
169
|
+
borderRadius: 5,
|
|
170
|
+
marginBottom: 30,
|
|
171
|
+
overflow: 'hidden',
|
|
172
|
+
},
|
|
173
|
+
progressBar: {
|
|
174
|
+
height: '100%',
|
|
175
|
+
borderRadius: 5,
|
|
176
|
+
},
|
|
177
|
+
button: {
|
|
178
|
+
backgroundColor: '#e74c3c',
|
|
179
|
+
paddingHorizontal: 30,
|
|
180
|
+
paddingVertical: 15,
|
|
181
|
+
borderRadius: 25,
|
|
182
|
+
shadowColor: '#000',
|
|
183
|
+
shadowOffset: { width: 0, height: 2 },
|
|
184
|
+
shadowOpacity: 0.2,
|
|
185
|
+
shadowRadius: 4,
|
|
186
|
+
elevation: 4,
|
|
187
|
+
},
|
|
188
|
+
buttonText: {
|
|
189
|
+
color: 'white',
|
|
190
|
+
fontSize: 16,
|
|
191
|
+
fontWeight: 'bold',
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
export default AnimationExample;
|
|
@@ -24,6 +24,10 @@ import { toast } from '../../lib/sonner';
|
|
|
24
24
|
import { useFollow } from '../hooks/useFollow';
|
|
25
25
|
import { useThemeColors } from '../styles/theme';
|
|
26
26
|
|
|
27
|
+
// Create animated TouchableOpacity
|
|
28
|
+
const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity);
|
|
29
|
+
const AnimatedText = Animated.createAnimatedComponent(Text);
|
|
30
|
+
|
|
27
31
|
export interface FollowButtonProps {
|
|
28
32
|
userId: string;
|
|
29
33
|
initiallyFollowing?: boolean;
|
|
@@ -65,6 +69,30 @@ const FollowButton: React.FC<FollowButtonProps> = ({
|
|
|
65
69
|
const animationProgress = useSharedValue(isFollowing ? 1 : 0);
|
|
66
70
|
const scale = useSharedValue(1);
|
|
67
71
|
|
|
72
|
+
// Button press handler with animation
|
|
73
|
+
const handlePress = useCallback(async (event?: { preventDefault?: () => void; stopPropagation?: () => void }) => {
|
|
74
|
+
if (preventParentActions && event && event.preventDefault) {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
event.stopPropagation?.();
|
|
77
|
+
}
|
|
78
|
+
if (disabled || isLoading) return;
|
|
79
|
+
|
|
80
|
+
// Press animation
|
|
81
|
+
scale.value = withTiming(0.95, { duration: 100 }, (finished) => {
|
|
82
|
+
if (finished) {
|
|
83
|
+
scale.value = withSpring(1, { damping: 15, stiffness: 200 });
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
await toggleFollow?.();
|
|
89
|
+
if (onFollowChange) onFollowChange(!isFollowing);
|
|
90
|
+
} catch (err: unknown) {
|
|
91
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
92
|
+
toast.error(error.message || 'Failed to update follow status');
|
|
93
|
+
}
|
|
94
|
+
}, [disabled, isLoading, toggleFollow, onFollowChange, isFollowing, preventParentActions, scale]);
|
|
95
|
+
|
|
68
96
|
// Initialize Zustand state with initial value if not already set
|
|
69
97
|
useEffect(() => {
|
|
70
98
|
if (userId && !isFollowing && initiallyFollowing) {
|
|
@@ -86,24 +114,35 @@ const FollowButton: React.FC<FollowButtonProps> = ({
|
|
|
86
114
|
animationProgress.value = withTiming(isFollowing ? 1 : 0, { duration: 300, easing: Easing.inOut(Easing.ease) });
|
|
87
115
|
}, [isFollowing, animationProgress]);
|
|
88
116
|
|
|
89
|
-
//
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
117
|
+
// Animated styles for better performance
|
|
118
|
+
const animatedButtonStyle = useAnimatedStyle(() => {
|
|
119
|
+
return {
|
|
120
|
+
transform: [{ scale: scale.value }],
|
|
121
|
+
backgroundColor: interpolateColor(
|
|
122
|
+
animationProgress.value,
|
|
123
|
+
[0, 1],
|
|
124
|
+
[colors.background, colors.primary]
|
|
125
|
+
),
|
|
126
|
+
borderColor: interpolateColor(
|
|
127
|
+
animationProgress.value,
|
|
128
|
+
[0, 1],
|
|
129
|
+
[colors.border, colors.primary]
|
|
130
|
+
),
|
|
131
|
+
};
|
|
132
|
+
}, [colors]);
|
|
133
|
+
|
|
134
|
+
const animatedTextStyle = useAnimatedStyle(() => {
|
|
135
|
+
return {
|
|
136
|
+
color: interpolateColor(
|
|
137
|
+
animationProgress.value,
|
|
138
|
+
[0, 1],
|
|
139
|
+
[colors.text, '#FFFFFF']
|
|
140
|
+
),
|
|
141
|
+
};
|
|
142
|
+
}, [colors]);
|
|
104
143
|
|
|
105
|
-
// Get button style
|
|
106
|
-
const
|
|
144
|
+
// Get base button style (without state-specific colors since they're animated)
|
|
145
|
+
const getBaseButtonStyle = (): StyleProp<ViewStyle> => {
|
|
107
146
|
const baseStyle = {
|
|
108
147
|
flexDirection: 'row' as const,
|
|
109
148
|
alignItems: 'center' as const,
|
|
@@ -148,27 +187,11 @@ const FollowButton: React.FC<FollowButtonProps> = ({
|
|
|
148
187
|
};
|
|
149
188
|
}
|
|
150
189
|
|
|
151
|
-
|
|
152
|
-
let stateStyle = {};
|
|
153
|
-
if (isFollowing) {
|
|
154
|
-
stateStyle = {
|
|
155
|
-
backgroundColor: colors.primary,
|
|
156
|
-
borderColor: colors.primary,
|
|
157
|
-
shadowColor: colors.primary,
|
|
158
|
-
};
|
|
159
|
-
} else {
|
|
160
|
-
stateStyle = {
|
|
161
|
-
backgroundColor: colors.background,
|
|
162
|
-
borderColor: colors.border,
|
|
163
|
-
shadowColor: colors.border,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return [baseStyle, sizeStyle, stateStyle, style];
|
|
190
|
+
return [baseStyle, sizeStyle, style];
|
|
168
191
|
};
|
|
169
192
|
|
|
170
|
-
// Get text style
|
|
171
|
-
const
|
|
193
|
+
// Get base text style (without state-specific colors since they're animated)
|
|
194
|
+
const getBaseTextStyle = (): StyleProp<TextStyle> => {
|
|
172
195
|
const baseTextStyle = {
|
|
173
196
|
fontFamily: fontFamilies.phuduSemiBold,
|
|
174
197
|
fontWeight: '600' as const,
|
|
@@ -185,15 +208,12 @@ const FollowButton: React.FC<FollowButtonProps> = ({
|
|
|
185
208
|
sizeTextStyle = { fontSize: 15 };
|
|
186
209
|
}
|
|
187
210
|
|
|
188
|
-
|
|
189
|
-
const textColor = isFollowing ? '#FFFFFF' : colors.text;
|
|
190
|
-
|
|
191
|
-
return [baseTextStyle, sizeTextStyle, { color: textColor }, textStyle];
|
|
211
|
+
return [baseTextStyle, sizeTextStyle, textStyle];
|
|
192
212
|
};
|
|
193
213
|
|
|
194
214
|
return (
|
|
195
|
-
<
|
|
196
|
-
style={
|
|
215
|
+
<AnimatedTouchableOpacity
|
|
216
|
+
style={[getBaseButtonStyle(), animatedButtonStyle]}
|
|
197
217
|
onPress={handlePress}
|
|
198
218
|
disabled={disabled || isLoading}
|
|
199
219
|
activeOpacity={0.8}
|
|
@@ -204,11 +224,11 @@ const FollowButton: React.FC<FollowButtonProps> = ({
|
|
|
204
224
|
color={isFollowing ? '#FFFFFF' : colors.primary}
|
|
205
225
|
/>
|
|
206
226
|
) : (
|
|
207
|
-
<
|
|
227
|
+
<AnimatedText style={[getBaseTextStyle(), animatedTextStyle]}>
|
|
208
228
|
{isFollowing ? 'Following' : 'Follow'}
|
|
209
|
-
</
|
|
229
|
+
</AnimatedText>
|
|
210
230
|
)}
|
|
211
|
-
</
|
|
231
|
+
</AnimatedTouchableOpacity>
|
|
212
232
|
);
|
|
213
233
|
};
|
|
214
234
|
|
|
@@ -22,7 +22,16 @@ export interface HeaderProps {
|
|
|
22
22
|
loading?: boolean;
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
text?: string;
|
|
25
|
+
key?: string;
|
|
25
26
|
};
|
|
27
|
+
rightActions?: Array<{
|
|
28
|
+
icon?: string;
|
|
29
|
+
onPress: () => void;
|
|
30
|
+
loading?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
text?: string;
|
|
33
|
+
key?: string; // optional identifier
|
|
34
|
+
}>;
|
|
26
35
|
theme: 'light' | 'dark';
|
|
27
36
|
showBackButton?: boolean;
|
|
28
37
|
showCloseButton?: boolean;
|
|
@@ -38,6 +47,7 @@ const Header: React.FC<HeaderProps> = ({
|
|
|
38
47
|
onBack,
|
|
39
48
|
onClose,
|
|
40
49
|
rightAction,
|
|
50
|
+
rightActions,
|
|
41
51
|
theme,
|
|
42
52
|
showBackButton = true,
|
|
43
53
|
showCloseButton = false,
|
|
@@ -100,26 +110,24 @@ const Header: React.FC<HeaderProps> = ({
|
|
|
100
110
|
);
|
|
101
111
|
};
|
|
102
112
|
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const isTextAction = rightAction.text;
|
|
107
|
-
|
|
113
|
+
const renderRightActionButton = (action: NonNullable<HeaderProps['rightAction']>, idx: number) => {
|
|
114
|
+
const isTextAction = action.text;
|
|
108
115
|
return (
|
|
109
116
|
<TouchableOpacity
|
|
117
|
+
key={action.key || idx}
|
|
110
118
|
style={[
|
|
111
119
|
styles.rightActionButton,
|
|
112
120
|
isTextAction ? styles.textActionButton : styles.iconActionButton,
|
|
113
121
|
{
|
|
114
122
|
backgroundColor: isTextAction ? colors.primary : colors.surface,
|
|
115
|
-
opacity:
|
|
123
|
+
opacity: action.disabled ? 0.5 : 1
|
|
116
124
|
}
|
|
117
125
|
]}
|
|
118
|
-
onPress={
|
|
119
|
-
disabled={
|
|
126
|
+
onPress={action.onPress}
|
|
127
|
+
disabled={action.disabled || action.loading}
|
|
120
128
|
activeOpacity={0.7}
|
|
121
129
|
>
|
|
122
|
-
{
|
|
130
|
+
{action.loading ? (
|
|
123
131
|
<View style={styles.loadingContainer}>
|
|
124
132
|
<View style={[styles.loadingDot, { backgroundColor: isTextAction ? '#FFFFFF' : colors.primary }]} />
|
|
125
133
|
<View style={[styles.loadingDot, { backgroundColor: isTextAction ? '#FFFFFF' : colors.primary }]} />
|
|
@@ -127,15 +135,27 @@ const Header: React.FC<HeaderProps> = ({
|
|
|
127
135
|
</View>
|
|
128
136
|
) : isTextAction ? (
|
|
129
137
|
<Text style={[styles.actionText, { color: '#FFFFFF' }]}>
|
|
130
|
-
{
|
|
138
|
+
{action.text}
|
|
131
139
|
</Text>
|
|
132
140
|
) : (
|
|
133
|
-
<Ionicons name={
|
|
141
|
+
<Ionicons name={action.icon as any} size={18} color={colors.primary} />
|
|
134
142
|
)}
|
|
135
143
|
</TouchableOpacity>
|
|
136
144
|
);
|
|
137
145
|
};
|
|
138
146
|
|
|
147
|
+
const renderRightActions = () => {
|
|
148
|
+
if (rightActions?.length) {
|
|
149
|
+
return (
|
|
150
|
+
<View style={styles.rightActionsRow}>
|
|
151
|
+
{rightActions.map((a, i) => renderRightActionButton(a, i))}
|
|
152
|
+
</View>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
if (rightAction) return renderRightActionButton(rightAction, 0);
|
|
156
|
+
return null;
|
|
157
|
+
};
|
|
158
|
+
|
|
139
159
|
const renderTitle = () => {
|
|
140
160
|
const titleStyle = variant === 'large' ? styles.titleLarge :
|
|
141
161
|
variant === 'minimal' ? styles.titleMinimal :
|
|
@@ -245,7 +265,7 @@ const Header: React.FC<HeaderProps> = ({
|
|
|
245
265
|
]}>
|
|
246
266
|
{renderBackButton()}
|
|
247
267
|
{renderTitle()}
|
|
248
|
-
{
|
|
268
|
+
{renderRightActions()}
|
|
249
269
|
{renderCloseButton()}
|
|
250
270
|
</View>
|
|
251
271
|
</View>
|
|
@@ -263,7 +283,7 @@ const styles = StyleSheet.create({
|
|
|
263
283
|
zIndex: 1000,
|
|
264
284
|
...Platform.select({
|
|
265
285
|
web: {
|
|
266
|
-
position: '
|
|
286
|
+
position: 'absolute' as const,
|
|
267
287
|
},
|
|
268
288
|
default: {},
|
|
269
289
|
}),
|
|
@@ -400,6 +420,10 @@ const styles = StyleSheet.create({
|
|
|
400
420
|
borderRadius: 2,
|
|
401
421
|
opacity: 0.6,
|
|
402
422
|
},
|
|
423
|
+
rightActionsRow: {
|
|
424
|
+
flexDirection: 'row',
|
|
425
|
+
alignItems: 'center',
|
|
426
|
+
},
|
|
403
427
|
});
|
|
404
428
|
|
|
405
429
|
export default Header;
|