create-gufran-expo-app 2.0.0 → 2.0.1
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/createApp.js +7 -2
- package/package.json +1 -1
- package/template/App.tsx +118 -0
- package/template/ReactotronConfig.js +5 -0
- package/template/android/app/build.gradle +184 -0
- package/template/android/app/debug.keystore +0 -0
- package/template/android/app/google-services.json +29 -0
- package/template/android/app/proguard-rules.pro +14 -0
- package/template/android/app/src/debug/AndroidManifest.xml +7 -0
- package/template/android/app/src/debugOptimized/AndroidManifest.xml +7 -0
- package/template/android/app/src/main/AndroidManifest.xml +28 -0
- package/template/android/app/src/main/assets/fonts/Outfit-Bold.ttf +0 -0
- package/template/android/app/src/main/assets/fonts/Outfit-Light.ttf +0 -0
- package/template/android/app/src/main/assets/fonts/Outfit-Medium.ttf +0 -0
- package/template/android/app/src/main/assets/fonts/Outfit-Regular.ttf +0 -0
- package/template/android/app/src/main/assets/fonts/Outfit-SemiBold.ttf +0 -0
- package/template/android/app/src/main/java/com/club/yakka/MainActivity.kt +61 -0
- package/template/android/app/src/main/java/com/club/yakka/MainApplication.kt +60 -0
- package/template/android/app/src/main/res/drawable/ic_launcher_background.xml +6 -0
- package/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/template/android/app/src/main/res/drawable-hdpi/splashscreen_logo.png +0 -0
- package/template/android/app/src/main/res/drawable-mdpi/splashscreen_logo.png +0 -0
- package/template/android/app/src/main/res/drawable-xhdpi/splashscreen_logo.png +0 -0
- package/template/android/app/src/main/res/drawable-xxhdpi/splashscreen_logo.png +0 -0
- package/template/android/app/src/main/res/drawable-xxxhdpi/splashscreen_logo.png +0 -0
- package/template/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/template/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp +0 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/template/android/app/src/main/res/values/colors.xml +6 -0
- package/template/android/app/src/main/res/values/strings.xml +5 -0
- package/template/android/app/src/main/res/values/styles.xml +14 -0
- package/template/android/app/src/main/res/values-night/colors.xml +1 -0
- package/template/android/build.gradle +33 -0
- package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/template/android/gradle.properties +65 -0
- package/template/android/gradlew +251 -0
- package/template/android/gradlew.bat +94 -0
- package/template/android/settings.gradle +39 -0
- package/template/app.json +69 -0
- package/template/assets/adaptive-icon.png +0 -0
- package/template/assets/adaptive-icon1.png +0 -0
- package/template/assets/app_icon.png +0 -0
- package/template/assets/favicon.png +0 -0
- package/template/assets/icon.png +0 -0
- package/template/assets/splash-icon.png +0 -0
- package/template/babel-plugin-disable-font-scaling.js +41 -0
- package/template/babel.config.js +28 -0
- package/template/firebase.json +5 -0
- package/template/index.ts +24 -0
- package/template/ios/.xcode.env +11 -0
- package/template/ios/ClubYakka/AppDelegate.swift +74 -0
- package/template/ios/ClubYakka/ClubYakka-Bridging-Header.h +3 -0
- package/template/ios/ClubYakka/ClubYakka.entitlements +8 -0
- package/template/ios/ClubYakka/GoogleService-Info.plist +30 -0
- package/template/ios/ClubYakka/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png +0 -0
- package/template/ios/ClubYakka/Images.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/template/ios/ClubYakka/Images.xcassets/Contents.json +6 -0
- package/template/ios/ClubYakka/Images.xcassets/SplashScreenBackground.colorset/Contents.json +20 -0
- package/template/ios/ClubYakka/Images.xcassets/SplashScreenLegacy.imageset/Contents.json +23 -0
- package/template/ios/ClubYakka/Images.xcassets/SplashScreenLegacy.imageset/image.png +0 -0
- package/template/ios/ClubYakka/Images.xcassets/SplashScreenLegacy.imageset/image@2x.png +0 -0
- package/template/ios/ClubYakka/Images.xcassets/SplashScreenLegacy.imageset/image@3x.png +0 -0
- package/template/ios/ClubYakka/Info.plist +101 -0
- package/template/ios/ClubYakka/PrivacyInfo.xcprivacy +50 -0
- package/template/ios/ClubYakka/SplashScreen.storyboard +48 -0
- package/template/ios/ClubYakka/Supporting/Expo.plist +12 -0
- package/template/ios/ClubYakka.xcodeproj/project.pbxproj +669 -0
- package/template/ios/ClubYakka.xcodeproj/xcshareddata/xcschemes/ClubYakka.xcscheme +88 -0
- package/template/ios/ClubYakka.xcworkspace/contents.xcworkspacedata +10 -0
- package/template/ios/ClubYakka.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +5 -0
- package/template/ios/Podfile +84 -0
- package/template/ios/Podfile.lock +2698 -0
- package/template/ios/Podfile.properties.json +8 -0
- package/template/metro.config.js +17 -0
- package/template/package.json +70 -0
- package/template/patches/react-native-background-upload+6.6.0.patch +704 -0
- package/template/react-native.config.js +7 -0
- package/template/src/assets/fonts/Outfit-Bold.ttf +0 -0
- package/template/src/assets/fonts/Outfit-Light.ttf +0 -0
- package/template/src/assets/fonts/Outfit-Medium.ttf +0 -0
- package/template/src/assets/fonts/Outfit-Regular.ttf +0 -0
- package/template/src/assets/fonts/Outfit-SemiBold.ttf +0 -0
- package/template/src/assets/icons/BG.svg +33 -0
- package/template/src/assets/icons/Ic_Users.svg +6 -0
- package/template/src/assets/icons/arrow-left-white.svg +4 -0
- package/template/src/assets/icons/arrow-left.svg +4 -0
- package/template/src/assets/icons/bell.svg +4 -0
- package/template/src/assets/icons/bottomSheetIcone.svg +3 -0
- package/template/src/assets/icons/call.svg +4 -0
- package/template/src/assets/icons/camera.svg +0 -0
- package/template/src/assets/icons/chatAppleGreenBG.svg +22 -0
- package/template/src/assets/icons/check.svg +4 -0
- package/template/src/assets/icons/check_Radio.svg +4 -0
- package/template/src/assets/icons/chevron-right.svg +3 -0
- package/template/src/assets/icons/clubDefauldImage.png +0 -0
- package/template/src/assets/icons/curvBackgroundView.svg +3 -0
- package/template/src/assets/icons/defaultClub.png +0 -0
- package/template/src/assets/icons/email.svg +3 -0
- package/template/src/assets/icons/emptyUser.svg +5 -0
- package/template/src/assets/icons/eye-Hide.svg +8 -0
- package/template/src/assets/icons/eye.svg +4 -0
- package/template/src/assets/icons/gallery.svg +4 -0
- package/template/src/assets/icons/home.svg +4 -0
- package/template/src/assets/icons/ic_Calendar.svg +14 -0
- package/template/src/assets/icons/ic_Calendar_blue.svg +12 -0
- package/template/src/assets/icons/ic_Calendar_white.svg +12 -0
- package/template/src/assets/icons/ic_Chat.svg +14 -0
- package/template/src/assets/icons/ic_ChatAppleGreen.svg +21 -0
- package/template/src/assets/icons/ic_ChatAppleWhite.svg +21 -0
- package/template/src/assets/icons/ic_Download.svg +6 -0
- package/template/src/assets/icons/ic_Events.svg +6 -0
- package/template/src/assets/icons/ic_HeadCoachIcon.svg +3 -0
- package/template/src/assets/icons/ic_Membership.svg +10 -0
- package/template/src/assets/icons/ic_Notification.svg +6 -0
- package/template/src/assets/icons/ic_Raffles.svg +14 -0
- package/template/src/assets/icons/ic_Referral_Members.svg +12 -0
- package/template/src/assets/icons/ic_Shop.svg +13 -0
- package/template/src/assets/icons/ic_Teams.svg +8 -0
- package/template/src/assets/icons/ic_Volunteer.svg +9 -0
- package/template/src/assets/icons/ic_add.svg +3 -0
- package/template/src/assets/icons/ic_addCircle.svg +5 -0
- package/template/src/assets/icons/ic_chatSend.svg +4 -0
- package/template/src/assets/icons/ic_chat_blue_bg.svg +22 -0
- package/template/src/assets/icons/ic_clock_blue.svg +4 -0
- package/template/src/assets/icons/ic_delete.svg +8 -0
- package/template/src/assets/icons/ic_more.svg +5 -0
- package/template/src/assets/icons/ic_mute.svg +10 -0
- package/template/src/assets/icons/ic_pdf.svg +3 -0
- package/template/src/assets/icons/ic_pending_AppleGreen.svg +11 -0
- package/template/src/assets/icons/ic_right_appleGreen.svg +11 -0
- package/template/src/assets/icons/ic_unread_chat_blue_bg.svg +23 -0
- package/template/src/assets/icons/ic_volunteer_Member.svg +8 -0
- package/template/src/assets/icons/index.ts +144 -0
- package/template/src/assets/icons/location-blue.svg +4 -0
- package/template/src/assets/icons/location-white.svg +4 -0
- package/template/src/assets/icons/location.svg +4 -0
- package/template/src/assets/icons/lock.svg +5 -0
- package/template/src/assets/icons/log-out.svg +5 -0
- package/template/src/assets/icons/login_logo.svg +9 -0
- package/template/src/assets/icons/mail.svg +4 -0
- package/template/src/assets/icons/or_saprater.svg +5 -0
- package/template/src/assets/icons/password.svg +4 -0
- package/template/src/assets/icons/profile-appleGreen.svg +6 -0
- package/template/src/assets/icons/search.svg +3 -0
- package/template/src/assets/icons/settings.svg +4 -0
- package/template/src/assets/icons/success.svg +4 -0
- package/template/src/assets/icons/unCheck_Radio.svg +3 -0
- package/template/src/assets/icons/uncheck.svg +3 -0
- package/template/src/assets/icons/upload_Image.svg +6 -0
- package/template/src/assets/icons/upload_Image_Member.svg +6 -0
- package/template/src/assets/icons/user.svg +4 -0
- package/template/src/assets/icons/wifi.svg +1 -0
- package/template/src/assets/images/Splash.png +0 -0
- package/template/src/assets/images/SplashLogo.png +0 -0
- package/template/src/assets/images/background.png +0 -0
- package/template/src/assets/images/clubDefauldImage.png +0 -0
- package/template/src/assets/images/index.tsx +9 -0
- package/template/src/assets/index.ts +1 -0
- package/template/src/components/common/AddMemberModal.tsx +543 -0
- package/template/src/components/common/AppLoader.tsx +91 -0
- package/template/src/components/common/Button.tsx +173 -0
- package/template/src/components/common/ClubCard.tsx +248 -0
- package/template/src/components/common/Icon.tsx +93 -0
- package/template/src/components/common/IconAlt.tsx +65 -0
- package/template/src/components/common/IconButton.tsx +92 -0
- package/template/src/components/common/ImagePicker.tsx +451 -0
- package/template/src/components/common/LoadingSpinner.tsx +30 -0
- package/template/src/components/common/OTPInput.tsx +128 -0
- package/template/src/components/common/ReminderCalendar.tsx +129 -0
- package/template/src/components/common/ReminderCardItem.tsx +91 -0
- package/template/src/components/common/SafeAreaWrapper.tsx +27 -0
- package/template/src/components/common/SetReminderModal.tsx +308 -0
- package/template/src/components/common/SlowInternet.js +57 -0
- package/template/src/components/common/TeamCard.tsx +297 -0
- package/template/src/components/common/TextInput.tsx +227 -0
- package/template/src/components/common/ToastConfig.tsx +103 -0
- package/template/src/components/common/ToastManager.ts +86 -0
- package/template/src/components/common/UploadProgressModal.tsx +284 -0
- package/template/src/components/common/WrapperContainer.tsx +39 -0
- package/template/src/components/common/index.ts +19 -0
- package/template/src/constants/Constants.tsx +7 -0
- package/template/src/constants/Fonts.tsx +30 -0
- package/template/src/constants/index.ts +45 -0
- package/template/src/constants/strings.ts +211 -0
- package/template/src/constants/theme.ts +72 -0
- package/template/src/contexts/AuthContext.tsx +268 -0
- package/template/src/contexts/index.ts +2 -0
- package/template/src/hooks/index.ts +3 -0
- package/template/src/hooks/useImageUpload.ts +199 -0
- package/template/src/index.ts +8 -0
- package/template/src/navigation/AuthStack.tsx +67 -0
- package/template/src/navigation/MainStack.tsx +183 -0
- package/template/src/navigation/MiddleStack.tsx +35 -0
- package/template/src/navigation/RootNavigator.tsx +101 -0
- package/template/src/navigation/index.ts +5 -0
- package/template/src/navigation/navigationRef.ts +5 -0
- package/template/src/providers/QueryProvider.tsx +30 -0
- package/template/src/screens/DetailsScreen.tsx +271 -0
- package/template/src/screens/HomeScreen.tsx +736 -0
- package/template/src/screens/ProfileScreen.tsx +202 -0
- package/template/src/screens/SettingsScreen.tsx +253 -0
- package/template/src/screens/SportHubScreen.tsx +280 -0
- package/template/src/screens/auth/AddMamber.tsx +428 -0
- package/template/src/screens/auth/ForgotPasswordScreen.tsx +176 -0
- package/template/src/screens/auth/LoginScreen.tsx +286 -0
- package/template/src/screens/auth/OTPVerifyScreen.tsx +359 -0
- package/template/src/screens/auth/RegisterScreen.tsx +430 -0
- package/template/src/screens/auth/SuccessScreen.tsx +201 -0
- package/template/src/screens/auth/WalcomeScreen.tsx +274 -0
- package/template/src/screens/auth/index.ts +8 -0
- package/template/src/screens/chat/ChatScreen.tsx +1819 -0
- package/template/src/screens/chat/ChatThreadsScreen.tsx +360 -0
- package/template/src/screens/chat/ReportMessageScreen.tsx +238 -0
- package/template/src/screens/clubs/Announcements.tsx +426 -0
- package/template/src/screens/clubs/BuyRaffleTicketsScreen.tsx +568 -0
- package/template/src/screens/clubs/ClubDeteils.tsx +497 -0
- package/template/src/screens/clubs/JoinClub.tsx +841 -0
- package/template/src/screens/events/EventScreen.tsx +460 -0
- package/template/src/screens/index.ts +42 -0
- package/template/src/screens/raffles/MyReferralMembersScreen.tsx +758 -0
- package/template/src/screens/raffles/RaffleDetailsScreen.tsx +762 -0
- package/template/src/screens/raffles/RafflesScreen.tsx +495 -0
- package/template/src/screens/raffles/SetRaffleReminderScreen.tsx +390 -0
- package/template/src/screens/teams/JoinTeamScreen.tsx +464 -0
- package/template/src/screens/teams/MyTeamDetailsScreen.tsx +979 -0
- package/template/src/screens/teams/MyTeamScreen.tsx +568 -0
- package/template/src/screens/teams/PendingRequestsScreen.tsx +426 -0
- package/template/src/screens/volunteerOpportunities/SetReminderScreen.tsx +631 -0
- package/template/src/screens/volunteerOpportunities/VolunteerOpportunitiesDetailsScreen.tsx +1049 -0
- package/template/src/screens/volunteerOpportunities/VolunteerOpportunitiesScreen.tsx +608 -0
- package/template/src/services/api.ts +167 -0
- package/template/src/services/authService.ts +422 -0
- package/template/src/services/index.ts +5 -0
- package/template/src/services/mainServices.ts +1963 -0
- package/template/src/stores/authStore.ts +159 -0
- package/template/src/stores/index.ts +2 -0
- package/template/src/types/index.ts +85 -0
- package/template/src/types/navigation.ts +206 -0
- package/template/src/utils/AzureUploaderService.ts +371 -0
- package/template/src/utils/ClubSearchManager.ts +222 -0
- package/template/src/utils/NotificationManager.ts +503 -0
- package/template/src/utils/UploadDebugUtil.ts +107 -0
- package/template/src/utils/imagePicker.ts +321 -0
- package/template/src/utils/index.ts +111 -0
- package/template/src/utils/permissions.ts +277 -0
- package/template/src/utils/scaling.ts +14 -0
- package/template/src/utils/storage.ts +247 -0
- package/template/src/utils/usePermissions.ts +275 -0
- package/template/src/utils/validation.ts +340 -0
- package/template/tsconfig.json +50 -0
- package/template/types/svg.d.ts +6 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { create } from 'zustand';
|
|
2
|
+
import { StorageService } from '../utils/storage';
|
|
3
|
+
|
|
4
|
+
// Types for authentication
|
|
5
|
+
export interface User {
|
|
6
|
+
userId: number;
|
|
7
|
+
email: string;
|
|
8
|
+
Name: string;
|
|
9
|
+
profileImage?: string;
|
|
10
|
+
isProfileCompleted: boolean;
|
|
11
|
+
isAddMember: boolean;
|
|
12
|
+
userType: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface AuthState {
|
|
16
|
+
user: User | null;
|
|
17
|
+
accessToken: string | null;
|
|
18
|
+
authorizationToken: string | null;
|
|
19
|
+
isAddMember: boolean;
|
|
20
|
+
isAuthenticated: boolean;
|
|
21
|
+
isLoading: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface AuthActions {
|
|
25
|
+
setUser: (user: User | null) => void;
|
|
26
|
+
setAccessToken: (token: string | null) => void;
|
|
27
|
+
setAuthorizationToken: (token: string | null) => void;
|
|
28
|
+
setLoading: (loading: boolean) => void;
|
|
29
|
+
login: (user: User, accessToken: string, authorizationToken: string) => void;
|
|
30
|
+
registerVerify: (user: User, accessToken: string, authorizationToken: string) => void;
|
|
31
|
+
logout: () => void;
|
|
32
|
+
clearAuth: () => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type AuthStore = AuthState & AuthActions;
|
|
36
|
+
|
|
37
|
+
// Create the auth store
|
|
38
|
+
export const useAuthStore = create<AuthStore>()((set, get) => ({
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
// Initial state
|
|
42
|
+
user: null,
|
|
43
|
+
accessToken: null,
|
|
44
|
+
authorizationToken: null,
|
|
45
|
+
isAuthenticated: false,
|
|
46
|
+
isAddMember: false,
|
|
47
|
+
isLoading: false,
|
|
48
|
+
registerVerify: (user, accessToken, authorizationToken) => {
|
|
49
|
+
const data = {
|
|
50
|
+
user,
|
|
51
|
+
accessToken,
|
|
52
|
+
authorizationToken,
|
|
53
|
+
isAddMember: user.isAddMember,
|
|
54
|
+
isAuthenticated: true,
|
|
55
|
+
isLoading: false,
|
|
56
|
+
}
|
|
57
|
+
set(data);
|
|
58
|
+
|
|
59
|
+
// Store tokens in both individual methods and user object
|
|
60
|
+
StorageService.auth.setAccessToken(accessToken);
|
|
61
|
+
StorageService.auth.setAuthorizationToken(authorizationToken);
|
|
62
|
+
StorageService.auth.setUser(data);
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
// Actions
|
|
66
|
+
setUser: (user) => {
|
|
67
|
+
set({ user });
|
|
68
|
+
// persist user changes (e.g., isAddMember) to MMKV
|
|
69
|
+
const { accessToken, authorizationToken, isAuthenticated, isLoading } = get();
|
|
70
|
+
const updatedData = { user, accessToken, authorizationToken, isAuthenticated, isLoading, isAddMember: user?.isAddMember ?? false };
|
|
71
|
+
StorageService.auth.setUser(updatedData);
|
|
72
|
+
},
|
|
73
|
+
setAccessToken: (token) => {
|
|
74
|
+
set({ accessToken: token });
|
|
75
|
+
// Also store token in MMKV for API interceptor
|
|
76
|
+
if (token) {
|
|
77
|
+
StorageService.auth.setAccessToken(token);
|
|
78
|
+
} else {
|
|
79
|
+
StorageService.auth.removeAccessToken();
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
setAuthorizationToken: (token) => {
|
|
83
|
+
set({ authorizationToken: token });
|
|
84
|
+
// Also store token in MMKV for API interceptor
|
|
85
|
+
if (token) {
|
|
86
|
+
StorageService.auth.setAuthorizationToken(token);
|
|
87
|
+
} else {
|
|
88
|
+
StorageService.auth.removeAuthorizationToken();
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
setLoading: (isLoading) => set({ isLoading }),
|
|
92
|
+
|
|
93
|
+
login: (user, accessToken, authorizationToken) => {
|
|
94
|
+
const data = {
|
|
95
|
+
user,
|
|
96
|
+
accessToken,
|
|
97
|
+
authorizationToken,
|
|
98
|
+
isAddMember: user.isAddMember,
|
|
99
|
+
isAuthenticated: true,
|
|
100
|
+
isLoading: false,
|
|
101
|
+
}
|
|
102
|
+
set(data);
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
StorageService.auth.setAccessToken(accessToken);
|
|
106
|
+
StorageService.auth.setAuthorizationToken(authorizationToken);
|
|
107
|
+
StorageService.auth.setUser(data);
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error("❌ LOGIN - Error storing tokens:", error);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
logout: () => {
|
|
116
|
+
set({
|
|
117
|
+
user: null,
|
|
118
|
+
accessToken: null,
|
|
119
|
+
authorizationToken: null,
|
|
120
|
+
isAuthenticated: false,
|
|
121
|
+
isLoading: false,
|
|
122
|
+
});
|
|
123
|
+
// Clear all auth data from MMKV
|
|
124
|
+
StorageService.auth.removeUser();
|
|
125
|
+
StorageService.auth.clearAuthData();
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
clearAuth: () => {
|
|
129
|
+
set({
|
|
130
|
+
user: null,
|
|
131
|
+
accessToken: null,
|
|
132
|
+
authorizationToken: null,
|
|
133
|
+
isAuthenticated: false,
|
|
134
|
+
isLoading: false,
|
|
135
|
+
});
|
|
136
|
+
// Clear all auth data from MMKV
|
|
137
|
+
StorageService.auth.clearAuthData();
|
|
138
|
+
},
|
|
139
|
+
}));
|
|
140
|
+
|
|
141
|
+
// Selectors for better performance
|
|
142
|
+
export const useAuth = () => useAuthStore((state) => ({
|
|
143
|
+
user: state.user,
|
|
144
|
+
accessToken: state.accessToken,
|
|
145
|
+
authorizationToken: state.authorizationToken,
|
|
146
|
+
isAuthenticated: state.isAuthenticated,
|
|
147
|
+
isLoading: state.isLoading,
|
|
148
|
+
}));
|
|
149
|
+
|
|
150
|
+
export const useAuthActions = () => useAuthStore((state) => ({
|
|
151
|
+
setUser: state.setUser,
|
|
152
|
+
setAccessToken: state.setAccessToken,
|
|
153
|
+
setAuthorizationToken: state.setAuthorizationToken,
|
|
154
|
+
setLoading: state.setLoading,
|
|
155
|
+
login: state.login,
|
|
156
|
+
registerVerify: state.registerVerify,
|
|
157
|
+
logout: state.logout,
|
|
158
|
+
clearAuth: state.clearAuth,
|
|
159
|
+
}));
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Navigation types
|
|
2
|
+
export * from './navigation';
|
|
3
|
+
|
|
4
|
+
// Common types
|
|
5
|
+
export interface User {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
email: string;
|
|
9
|
+
avatar?: string;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface BaseResponse {
|
|
15
|
+
success: boolean;
|
|
16
|
+
message: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ApiResponse<T = any> extends BaseResponse {
|
|
20
|
+
data?: T;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Common component props
|
|
24
|
+
export interface BaseScreenProps {
|
|
25
|
+
testID?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Theme types
|
|
29
|
+
export interface ThemeColors {
|
|
30
|
+
primary: string;
|
|
31
|
+
secondary: string;
|
|
32
|
+
background: string;
|
|
33
|
+
surface: string;
|
|
34
|
+
text: string;
|
|
35
|
+
textSecondary: string;
|
|
36
|
+
border: string;
|
|
37
|
+
error: string;
|
|
38
|
+
success: string;
|
|
39
|
+
warning: string;
|
|
40
|
+
blue: string;
|
|
41
|
+
appleGreen: string;
|
|
42
|
+
DarkGray: string;
|
|
43
|
+
green: string;
|
|
44
|
+
white: string;
|
|
45
|
+
black: string;
|
|
46
|
+
lightLavenderGray: string;
|
|
47
|
+
imageBorder: string;
|
|
48
|
+
paraText: string;
|
|
49
|
+
cancelButton: string;
|
|
50
|
+
red: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface Theme {
|
|
54
|
+
colors: ThemeColors;
|
|
55
|
+
spacing: {
|
|
56
|
+
xs: number;
|
|
57
|
+
sm: number;
|
|
58
|
+
md: number;
|
|
59
|
+
lg: number;
|
|
60
|
+
xl: number;
|
|
61
|
+
};
|
|
62
|
+
borderRadius: {
|
|
63
|
+
sm: number;
|
|
64
|
+
md: number;
|
|
65
|
+
lg: number;
|
|
66
|
+
xl: number;
|
|
67
|
+
xxl: number;
|
|
68
|
+
};
|
|
69
|
+
typography: {
|
|
70
|
+
fontSize: {
|
|
71
|
+
xs: number;
|
|
72
|
+
sm: number;
|
|
73
|
+
md: number;
|
|
74
|
+
lg: number;
|
|
75
|
+
xl: number;
|
|
76
|
+
xxl: number;
|
|
77
|
+
};
|
|
78
|
+
fontWeight: {
|
|
79
|
+
normal: '400';
|
|
80
|
+
medium: '500';
|
|
81
|
+
semibold: '600';
|
|
82
|
+
bold: '700';
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
|
|
2
|
+
|
|
3
|
+
// Auth Stack Parameter List
|
|
4
|
+
export type AuthStackParamList = {
|
|
5
|
+
Welcome: undefined;
|
|
6
|
+
Login: undefined;
|
|
7
|
+
Register: undefined;
|
|
8
|
+
ForgotPassword: undefined;
|
|
9
|
+
OTPVerify: undefined;
|
|
10
|
+
Success: undefined;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Middle Stack Parameter List
|
|
14
|
+
export type MiddleStackParamList = {
|
|
15
|
+
AddMember: undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// Main App Stack Parameter List
|
|
19
|
+
export type MainStackParamList = {
|
|
20
|
+
Home: undefined;
|
|
21
|
+
Profile: { userId: string };
|
|
22
|
+
Settings: undefined;
|
|
23
|
+
Details: { itemId: string; title?: string };
|
|
24
|
+
JoinClub: undefined;
|
|
25
|
+
JoinTeam: {
|
|
26
|
+
selectedClub?: any;
|
|
27
|
+
selectedMember?: any;
|
|
28
|
+
};
|
|
29
|
+
MyTeam: {
|
|
30
|
+
selectedClub?: any;
|
|
31
|
+
selectedMember?: any;
|
|
32
|
+
};
|
|
33
|
+
MyTeamDetails: {
|
|
34
|
+
club?: any;
|
|
35
|
+
selectedClub?: any;
|
|
36
|
+
selectedMember?: any;
|
|
37
|
+
};
|
|
38
|
+
Announcements: {
|
|
39
|
+
selectedClub?: any;
|
|
40
|
+
selectedMember?: any;
|
|
41
|
+
};
|
|
42
|
+
PendingRequests: any;
|
|
43
|
+
ClubDetails: {
|
|
44
|
+
TeamDetails?: any;
|
|
45
|
+
clubName?: string;
|
|
46
|
+
totalMembers?: number;
|
|
47
|
+
clubCode?: string;
|
|
48
|
+
clubAddress?: string;
|
|
49
|
+
selectedMember?: any;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
};
|
|
52
|
+
SportHub: {
|
|
53
|
+
selectedClub?: any;
|
|
54
|
+
selectedMember?: any;
|
|
55
|
+
};
|
|
56
|
+
ChatThreads: {
|
|
57
|
+
team?: any;
|
|
58
|
+
selectedClub?: any;
|
|
59
|
+
selectedMember?: any;
|
|
60
|
+
};
|
|
61
|
+
ChatScreen: {
|
|
62
|
+
itemDetails?: any;
|
|
63
|
+
memberId?: string;
|
|
64
|
+
teamId?: string;
|
|
65
|
+
team?: any;
|
|
66
|
+
userType?: string;
|
|
67
|
+
};
|
|
68
|
+
ReportMessage: {
|
|
69
|
+
message: any;
|
|
70
|
+
memberId: string;
|
|
71
|
+
onReportSubmit?: (reason: string, message: any) => void;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
// Raffles
|
|
77
|
+
Raffles: {
|
|
78
|
+
selectedClub?: any;
|
|
79
|
+
selectedMember?: any;
|
|
80
|
+
};
|
|
81
|
+
RaffleDetails: {
|
|
82
|
+
selectedClub?: any;
|
|
83
|
+
selectedMember?: any;
|
|
84
|
+
raffleId: number;
|
|
85
|
+
};
|
|
86
|
+
BuyRaffleTickets: {
|
|
87
|
+
selectedClub?: any;
|
|
88
|
+
selectedMember?: any;
|
|
89
|
+
raffleId: number;
|
|
90
|
+
raffleTitle: string;
|
|
91
|
+
ticketOptions: Array<{
|
|
92
|
+
id: number;
|
|
93
|
+
raffleId: number;
|
|
94
|
+
ticketCount: number;
|
|
95
|
+
totalAmount: number;
|
|
96
|
+
perTicketAmount: number;
|
|
97
|
+
}>;
|
|
98
|
+
};
|
|
99
|
+
VolunteerOpportunitiesScreen:{
|
|
100
|
+
selectedClub?: any;
|
|
101
|
+
selectedMember?: any;
|
|
102
|
+
}
|
|
103
|
+
SetReminder:{
|
|
104
|
+
item?:any
|
|
105
|
+
selectedClub?: any;
|
|
106
|
+
selectedMember?: any;
|
|
107
|
+
}
|
|
108
|
+
VolunteerOpportunitiesDetailsScreen:{
|
|
109
|
+
item?:any
|
|
110
|
+
selectedClub?: any;
|
|
111
|
+
selectedMember?: any;
|
|
112
|
+
},
|
|
113
|
+
MyReferralMembers:{
|
|
114
|
+
selectedClub?: any;
|
|
115
|
+
selectedMember?: any;
|
|
116
|
+
raffleId?: number;
|
|
117
|
+
raffleTitle?: string;
|
|
118
|
+
},
|
|
119
|
+
SetRaffleReminder:{
|
|
120
|
+
selectedClub?: any;
|
|
121
|
+
selectedMember?: any;
|
|
122
|
+
raffle?: any;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
//Events
|
|
126
|
+
EventScreen:{
|
|
127
|
+
selectedClub?: any;
|
|
128
|
+
selectedMember?: any;
|
|
129
|
+
raffle?: any;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// Root Stack Parameter List (combines Auth, Middle and Main)
|
|
134
|
+
export type RootStackParamList = AuthStackParamList & MiddleStackParamList & MainStackParamList;
|
|
135
|
+
|
|
136
|
+
// Auth Stack Navigation Props
|
|
137
|
+
export type WelcomeScreenProps = NativeStackScreenProps<AuthStackParamList, 'Welcome'>;
|
|
138
|
+
export type LoginScreenProps = NativeStackScreenProps<AuthStackParamList, 'Login'>;
|
|
139
|
+
export type RegisterScreenProps = NativeStackScreenProps<AuthStackParamList, 'Register'>;
|
|
140
|
+
export type ForgotPasswordScreenProps = NativeStackScreenProps<AuthStackParamList, 'ForgotPassword'>;
|
|
141
|
+
export type OTPVerifyScreenProps = NativeStackScreenProps<AuthStackParamList, 'OTPVerify'>;
|
|
142
|
+
export type SuccessScreenProps = NativeStackScreenProps<AuthStackParamList, 'Success'>;
|
|
143
|
+
|
|
144
|
+
// Middle Stack Navigation Props
|
|
145
|
+
export type AddMemberScreenProps = NativeStackScreenProps<MiddleStackParamList, 'AddMember'>;
|
|
146
|
+
|
|
147
|
+
// Main Stack Navigation Props
|
|
148
|
+
export type HomeScreenProps = NativeStackScreenProps<MainStackParamList, 'Home'>;
|
|
149
|
+
export type ProfileScreenProps = NativeStackScreenProps<MainStackParamList, 'Profile'>;
|
|
150
|
+
export type SettingsScreenProps = NativeStackScreenProps<MainStackParamList, 'Settings'>;
|
|
151
|
+
export type DetailsScreenProps = NativeStackScreenProps<MainStackParamList, 'Details'>;
|
|
152
|
+
export type JoinClubScreenProps = NativeStackScreenProps<MainStackParamList, 'JoinClub'>;
|
|
153
|
+
export type ClubDetailsScreenProps = NativeStackScreenProps<MainStackParamList, 'ClubDetails'>;
|
|
154
|
+
export type SportHubScreenProps = NativeStackScreenProps<MainStackParamList, 'SportHub'>;
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
export type MyTeamScreen = NativeStackScreenProps<MainStackParamList, 'MyTeam'>;
|
|
159
|
+
export type MyTeamDetailsScreenProps = NativeStackScreenProps<MainStackParamList, 'MyTeamDetails'>;
|
|
160
|
+
export type PendingRequestsScreenProps = NativeStackScreenProps<MainStackParamList, 'PendingRequests'>;
|
|
161
|
+
export type JoinTeamProps = NativeStackScreenProps<MainStackParamList, 'JoinTeam'>;
|
|
162
|
+
export type AnnouncementsScreenProps = NativeStackScreenProps<MainStackParamList, 'Announcements'>;
|
|
163
|
+
|
|
164
|
+
//Chat
|
|
165
|
+
export type ChatThreadsScreenProps = NativeStackScreenProps<MainStackParamList, 'ChatThreads'>;
|
|
166
|
+
export type ChatScreenProps = NativeStackScreenProps<MainStackParamList, 'ChatScreen'>;
|
|
167
|
+
|
|
168
|
+
// VolunteerOpportunitiesScreen
|
|
169
|
+
export type VolunteerOpportunitiesScreenProps = NativeStackScreenProps<MainStackParamList, 'VolunteerOpportunitiesScreen'>;
|
|
170
|
+
export type VolunteerOpportunitiesDetailsScreenProps = NativeStackScreenProps<MainStackParamList, 'VolunteerOpportunitiesDetailsScreen'>;
|
|
171
|
+
export type SetReminderScreenProps = NativeStackScreenProps<MainStackParamList, 'SetReminder'>;
|
|
172
|
+
|
|
173
|
+
//Raffles
|
|
174
|
+
export type RafflesScreenProps = NativeStackScreenProps<MainStackParamList, 'Raffles'>;
|
|
175
|
+
export type MyReferralMembersScreenProps = NativeStackScreenProps<MainStackParamList, 'MyReferralMembers'>;
|
|
176
|
+
export type SetRaffleReminderScreenProps = NativeStackScreenProps<MainStackParamList, 'SetRaffleReminder'>;
|
|
177
|
+
|
|
178
|
+
//Event Screens
|
|
179
|
+
export type EventScreenProps = NativeStackScreenProps<MainStackParamList, 'EventScreen'>;
|
|
180
|
+
|
|
181
|
+
// Generic navigation prop types
|
|
182
|
+
export type AuthStackScreenProps<T extends keyof AuthStackParamList> = NativeStackScreenProps<
|
|
183
|
+
AuthStackParamList,
|
|
184
|
+
T
|
|
185
|
+
>;
|
|
186
|
+
|
|
187
|
+
export type MiddleStackScreenProps<T extends keyof MiddleStackParamList> = NativeStackScreenProps<
|
|
188
|
+
MiddleStackParamList,
|
|
189
|
+
T
|
|
190
|
+
>;
|
|
191
|
+
|
|
192
|
+
export type MainStackScreenProps<T extends keyof MainStackParamList> = NativeStackScreenProps<
|
|
193
|
+
MainStackParamList,
|
|
194
|
+
T
|
|
195
|
+
>;
|
|
196
|
+
|
|
197
|
+
export type RootStackScreenProps<T extends keyof RootStackParamList> = NativeStackScreenProps<
|
|
198
|
+
RootStackParamList,
|
|
199
|
+
T
|
|
200
|
+
>;
|
|
201
|
+
|
|
202
|
+
declare global {
|
|
203
|
+
namespace ReactNavigation {
|
|
204
|
+
interface RootParamList extends RootStackParamList {}
|
|
205
|
+
}
|
|
206
|
+
}
|