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,426 @@
|
|
|
1
|
+
import React, { useState, useEffect, useCallback, useMemo } from "react";
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
FlatList,
|
|
7
|
+
StatusBar,
|
|
8
|
+
Platform,
|
|
9
|
+
TouchableOpacity,
|
|
10
|
+
Image,
|
|
11
|
+
ScrollView,
|
|
12
|
+
RefreshControl,
|
|
13
|
+
ActivityIndicator,
|
|
14
|
+
Keyboard,
|
|
15
|
+
} from "react-native";
|
|
16
|
+
import { PendingRequestsScreenProps } from "../../types/navigation";
|
|
17
|
+
import { Strings, theme } from "../../constants";
|
|
18
|
+
import { moderateScale } from "../../utils/scaling";
|
|
19
|
+
import { Fonts } from "../../constants/Fonts";
|
|
20
|
+
import SVG from "../../assets/icons";
|
|
21
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
22
|
+
import { TeamCard } from "../../components/common";
|
|
23
|
+
import ToastManager from "../../components/common/ToastManager";
|
|
24
|
+
import { getApiErrorInfo, useGetImageUrl } from "../../services/authService";
|
|
25
|
+
import { useInfinitePendingTeamRequests, PendingTeamRequest, useCancelRequestTeam } from "../../services/mainServices";
|
|
26
|
+
import { useFocusEffect } from "@react-navigation/native";
|
|
27
|
+
|
|
28
|
+
export const PendingRequestsScreen: React.FC<PendingRequestsScreenProps> = ({
|
|
29
|
+
navigation,
|
|
30
|
+
route,
|
|
31
|
+
}) => {
|
|
32
|
+
const { selectedClub } = route?.params ?? {};
|
|
33
|
+
console.log("Selected member details in Pending screen--->", route?.params);
|
|
34
|
+
const cancelRequestTeamMutation = useCancelRequestTeam();
|
|
35
|
+
const [clubImage, setClubImage] = useState<string | null>(null);
|
|
36
|
+
|
|
37
|
+
// Get member ID from route params or auth store
|
|
38
|
+
const memberId = selectedClub?.selectedMember?.id || 0; // Replace with actual member ID from auth context
|
|
39
|
+
const pageSize = 10;
|
|
40
|
+
|
|
41
|
+
// Use infinite query for pending team requests
|
|
42
|
+
const {
|
|
43
|
+
data: pendingRequestsData,
|
|
44
|
+
isLoading,
|
|
45
|
+
isError,
|
|
46
|
+
error,
|
|
47
|
+
fetchNextPage,
|
|
48
|
+
hasNextPage,
|
|
49
|
+
isFetchingNextPage,
|
|
50
|
+
refetch,
|
|
51
|
+
} = useInfinitePendingTeamRequests(memberId, pageSize);
|
|
52
|
+
|
|
53
|
+
// Flatten the paginated data into a single array
|
|
54
|
+
const allPendingRequests = useMemo(() => {
|
|
55
|
+
if (!pendingRequestsData?.pages) return [];
|
|
56
|
+
|
|
57
|
+
return pendingRequestsData.pages.flatMap(page => page.data?.data || []);
|
|
58
|
+
}, [pendingRequestsData]);
|
|
59
|
+
|
|
60
|
+
// Handle API errors
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (isError && error) {
|
|
63
|
+
ToastManager.show({
|
|
64
|
+
title: "Error",
|
|
65
|
+
message: "Failed to load pending requests. Please try again.",
|
|
66
|
+
type: "error",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}, [isError, error]);
|
|
70
|
+
|
|
71
|
+
useFocusEffect(useCallback(() => {
|
|
72
|
+
refetch();
|
|
73
|
+
}, [refetch]));
|
|
74
|
+
|
|
75
|
+
// Load more data when reaching end of list
|
|
76
|
+
const loadMoreData = useCallback(() => {
|
|
77
|
+
if (hasNextPage && !isFetchingNextPage) {
|
|
78
|
+
fetchNextPage();
|
|
79
|
+
}
|
|
80
|
+
}, [hasNextPage, isFetchingNextPage, fetchNextPage]);
|
|
81
|
+
|
|
82
|
+
// Refresh data
|
|
83
|
+
const onRefresh = useCallback(() => {
|
|
84
|
+
refetch();
|
|
85
|
+
}, [refetch]);
|
|
86
|
+
|
|
87
|
+
const handleCancelRequest = (item:any) => {
|
|
88
|
+
|
|
89
|
+
console.log("Cancel request for team:", item);
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
const body = {
|
|
94
|
+
clubId: item?.clubId,
|
|
95
|
+
memberId: item?.memberId,
|
|
96
|
+
teamId: item?.teamId
|
|
97
|
+
}
|
|
98
|
+
cancelRequestTeamMutation.mutate(body, {
|
|
99
|
+
onSuccess: (response) => {
|
|
100
|
+
ToastManager.success(response.data.message || 'Join club successful');
|
|
101
|
+
navigation.goBack();
|
|
102
|
+
},
|
|
103
|
+
onError: (error) => {
|
|
104
|
+
const errorInfo = getApiErrorInfo(error);
|
|
105
|
+
ToastManager.error(errorInfo?.message);
|
|
106
|
+
|
|
107
|
+
console.error('Join club failed:', error);
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
// // TODO: Implement actual cancel request API call
|
|
114
|
+
// // For now, just show success message
|
|
115
|
+
// ToastManager.show({
|
|
116
|
+
// title: "Success",
|
|
117
|
+
// message: "Request cancelled successfully",
|
|
118
|
+
// type: "success",
|
|
119
|
+
// });
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const renderClubCard = ({ item }: { item: PendingTeamRequest }) => {
|
|
123
|
+
// Transform the data to match TeamCard props
|
|
124
|
+
const teamData = {
|
|
125
|
+
id: item.id,
|
|
126
|
+
clubName: item.teamName,
|
|
127
|
+
clubImageUrl: item.teamImageUrl || "",
|
|
128
|
+
totalMembers: 0, // API doesn't provide member count for pending requests
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<TeamCard
|
|
133
|
+
team={item}
|
|
134
|
+
onCancel={true}
|
|
135
|
+
onCancelPress={() => handleCancelRequest(item)}
|
|
136
|
+
/>
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const renderFooter = () => {
|
|
141
|
+
if (!isFetchingNextPage) return null;
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<View style={styles.footerLoader}>
|
|
145
|
+
<ActivityIndicator size="small" color={theme.colors.blue} />
|
|
146
|
+
<Text style={styles.footerLoaderText}>Loading more...</Text>
|
|
147
|
+
</View>
|
|
148
|
+
);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const renderEmptyComponent = () => {
|
|
152
|
+
if (isLoading && !pendingRequestsData) {
|
|
153
|
+
return (
|
|
154
|
+
<View style={styles.loadingContainer}>
|
|
155
|
+
<ActivityIndicator size="large" color={theme.colors.blue} />
|
|
156
|
+
<Text style={styles.loadingText}>Loading pending requests...</Text>
|
|
157
|
+
</View>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<View style={styles.emptyContainer}>
|
|
163
|
+
<Text style={styles.emptyText}>No pending requests</Text>
|
|
164
|
+
</View>
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
const handleScroll = useCallback(() => {
|
|
170
|
+
Keyboard.dismiss();
|
|
171
|
+
}, []);
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
console.log("selectedClub--->", selectedClub),
|
|
175
|
+
|
|
176
|
+
<View style={styles.container}>
|
|
177
|
+
<StatusBar backgroundColor={theme.colors.blue} barStyle="light-content" />
|
|
178
|
+
{Platform.OS === "android" && <View style={styles.statusBarBackground} />}
|
|
179
|
+
|
|
180
|
+
<SafeAreaView style={styles.header}>
|
|
181
|
+
<View style={styles.headerTopRow}>
|
|
182
|
+
<TouchableOpacity onPress={() => navigation.goBack()}>
|
|
183
|
+
<SVG.arrowLeft_white
|
|
184
|
+
width={moderateScale(25)}
|
|
185
|
+
height={moderateScale(25)}
|
|
186
|
+
/>
|
|
187
|
+
</TouchableOpacity>
|
|
188
|
+
<View style={{ flexDirection: "row" }}>
|
|
189
|
+
<View style={styles.userConSty}>
|
|
190
|
+
{!!selectedClub?.clubImage? (
|
|
191
|
+
<Image
|
|
192
|
+
// onLoadEnd={() => setIsLoading(false)}
|
|
193
|
+
// onLoad={() => setIsLoading(true)}
|
|
194
|
+
// onLoadStart={() => setIsLoading(true)}
|
|
195
|
+
source={{ uri: selectedClub?.clubImage }}
|
|
196
|
+
style={styles.userDetailsSty}
|
|
197
|
+
/>
|
|
198
|
+
) : (
|
|
199
|
+
<View style={styles.placeholderLogoHeader}>
|
|
200
|
+
<SVG.UsersIcon
|
|
201
|
+
width={moderateScale(20)}
|
|
202
|
+
height={moderateScale(20)}
|
|
203
|
+
/>
|
|
204
|
+
</View>
|
|
205
|
+
)}
|
|
206
|
+
</View>
|
|
207
|
+
<View style={styles.clubInfoContainer}>
|
|
208
|
+
<Text style={styles.userNameSty}>
|
|
209
|
+
{selectedClub?.clubName || "Unknown Member"}
|
|
210
|
+
</Text>
|
|
211
|
+
<Text style={styles.totalMembersSty}>
|
|
212
|
+
{selectedClub?.totalMembers || 0}{" "}
|
|
213
|
+
{(selectedClub?.totalMembers || 0) === 1 ? "member" : "members"}
|
|
214
|
+
</Text>
|
|
215
|
+
</View>
|
|
216
|
+
</View>
|
|
217
|
+
</View>
|
|
218
|
+
|
|
219
|
+
</SafeAreaView>
|
|
220
|
+
<View style={styles.contentList}>
|
|
221
|
+
<Text style={styles.sectionHeading}>Pending Requests</Text>
|
|
222
|
+
<FlatList
|
|
223
|
+
data={allPendingRequests}
|
|
224
|
+
renderItem={renderClubCard}
|
|
225
|
+
keyExtractor={(item) => item.id.toString()}
|
|
226
|
+
style={styles.clubsList}
|
|
227
|
+
showsVerticalScrollIndicator={false}
|
|
228
|
+
contentContainerStyle={styles.flatListContent}
|
|
229
|
+
removeClippedSubviews={false}
|
|
230
|
+
initialNumToRender={10}
|
|
231
|
+
onEndReached={loadMoreData}
|
|
232
|
+
onEndReachedThreshold={0.5}
|
|
233
|
+
ListFooterComponent={renderFooter}
|
|
234
|
+
ListEmptyComponent={renderEmptyComponent}
|
|
235
|
+
onScroll={handleScroll}
|
|
236
|
+
scrollEventThrottle={16}
|
|
237
|
+
refreshControl={
|
|
238
|
+
<RefreshControl
|
|
239
|
+
refreshing={isLoading && !pendingRequestsData}
|
|
240
|
+
onRefresh={onRefresh}
|
|
241
|
+
colors={[theme.colors.primary]}
|
|
242
|
+
tintColor={theme.colors.primary}
|
|
243
|
+
/>
|
|
244
|
+
}
|
|
245
|
+
/>
|
|
246
|
+
</View>
|
|
247
|
+
</View>
|
|
248
|
+
);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const styles = StyleSheet.create({
|
|
252
|
+
container: {
|
|
253
|
+
flex: 1,
|
|
254
|
+
backgroundColor: theme.colors.blue,
|
|
255
|
+
},
|
|
256
|
+
statusBarBackground: {
|
|
257
|
+
position: "absolute",
|
|
258
|
+
top: 0,
|
|
259
|
+
left: 0,
|
|
260
|
+
right: 0,
|
|
261
|
+
height: Platform.OS === "ios" ? 44 : 0,
|
|
262
|
+
backgroundColor: theme.colors.blue,
|
|
263
|
+
zIndex: 1000,
|
|
264
|
+
},
|
|
265
|
+
header: {
|
|
266
|
+
backgroundColor: theme.colors.blue,
|
|
267
|
+
paddingTop: Platform.OS === "android" ? theme.spacing.lg : theme.spacing.xs,
|
|
268
|
+
},
|
|
269
|
+
headerTopRow: {
|
|
270
|
+
flexDirection: "row",
|
|
271
|
+
alignItems: "center",
|
|
272
|
+
paddingHorizontal: theme.spacing.lg,
|
|
273
|
+
paddingBottom: theme.spacing.sm,
|
|
274
|
+
},
|
|
275
|
+
headerTitle: {
|
|
276
|
+
fontFamily: Fonts.outfitMedium,
|
|
277
|
+
fontSize: moderateScale(22),
|
|
278
|
+
color: theme.colors.white,
|
|
279
|
+
},
|
|
280
|
+
clubInfoContainer: {
|
|
281
|
+
marginLeft: moderateScale(4),
|
|
282
|
+
justifyContent: 'center',
|
|
283
|
+
},
|
|
284
|
+
userNameSty: {
|
|
285
|
+
color: theme.colors.white,
|
|
286
|
+
fontFamily: Fonts.outfitRegular,
|
|
287
|
+
fontSize: moderateScale(16),
|
|
288
|
+
},
|
|
289
|
+
totalMembersSty: {
|
|
290
|
+
fontFamily: Fonts.outfitRegular,
|
|
291
|
+
fontSize: moderateScale(11),
|
|
292
|
+
color: theme.colors.appleGreen,
|
|
293
|
+
},
|
|
294
|
+
userDetailsSty: {
|
|
295
|
+
width: moderateScale(36),
|
|
296
|
+
height: moderateScale(36),
|
|
297
|
+
borderRadius: moderateScale(18),
|
|
298
|
+
},
|
|
299
|
+
userConSty: {
|
|
300
|
+
marginLeft: moderateScale(12),
|
|
301
|
+
marginRight: theme.spacing.xs,
|
|
302
|
+
width: moderateScale(36),
|
|
303
|
+
height: moderateScale(36),
|
|
304
|
+
borderRadius: moderateScale(20),
|
|
305
|
+
borderWidth: 1.5,
|
|
306
|
+
borderColor: theme.colors.imageBorder,
|
|
307
|
+
backgroundColor: theme.colors.imageBorder,
|
|
308
|
+
alignItems: "center",
|
|
309
|
+
justifyContent: "center",
|
|
310
|
+
},
|
|
311
|
+
teamImage: {
|
|
312
|
+
width: moderateScale(120),
|
|
313
|
+
height: moderateScale(120),
|
|
314
|
+
borderRadius: moderateScale(60),
|
|
315
|
+
backgroundColor: theme.colors.background,
|
|
316
|
+
},
|
|
317
|
+
placeholderImage: {
|
|
318
|
+
width: moderateScale(120),
|
|
319
|
+
height: moderateScale(120),
|
|
320
|
+
borderRadius: moderateScale(60),
|
|
321
|
+
backgroundColor: theme.colors.border,
|
|
322
|
+
justifyContent: "center",
|
|
323
|
+
alignItems: "center",
|
|
324
|
+
},
|
|
325
|
+
userDefaultIcone: {
|
|
326
|
+
width: moderateScale(30),
|
|
327
|
+
height: moderateScale(30),
|
|
328
|
+
borderRadius: moderateScale(10),
|
|
329
|
+
},
|
|
330
|
+
placeholderLogoHeader: {
|
|
331
|
+
width: moderateScale(20),
|
|
332
|
+
height: moderateScale(20),
|
|
333
|
+
borderRadius: moderateScale(10),
|
|
334
|
+
alignItems: "center",
|
|
335
|
+
justifyContent: "center",
|
|
336
|
+
},
|
|
337
|
+
memberCount: {
|
|
338
|
+
fontFamily: Fonts.outfitRegular,
|
|
339
|
+
fontSize: moderateScale(11),
|
|
340
|
+
color: theme.colors.appleGreen,
|
|
341
|
+
marginLeft: theme.spacing.xs,
|
|
342
|
+
},
|
|
343
|
+
content: {
|
|
344
|
+
flex: 1,
|
|
345
|
+
backgroundColor: theme.colors.background,
|
|
346
|
+
borderTopLeftRadius: moderateScale(30),
|
|
347
|
+
borderTopRightRadius: moderateScale(30),
|
|
348
|
+
marginTop: -theme.spacing.xl,
|
|
349
|
+
},
|
|
350
|
+
sectionContainer: {
|
|
351
|
+
paddingHorizontal: theme.spacing.lg,
|
|
352
|
+
paddingTop: theme.spacing.lg,
|
|
353
|
+
},
|
|
354
|
+
sectionHeading: {
|
|
355
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
356
|
+
fontSize: moderateScale(18),
|
|
357
|
+
color: theme.colors.black,
|
|
358
|
+
marginBottom: theme.spacing.md,
|
|
359
|
+
},
|
|
360
|
+
clubCardWrapper: {
|
|
361
|
+
flex: 1,
|
|
362
|
+
marginRight: theme.spacing.sm,
|
|
363
|
+
},
|
|
364
|
+
cancelButton: {
|
|
365
|
+
backgroundColor: "#FF4444",
|
|
366
|
+
borderRadius: theme.borderRadius.md,
|
|
367
|
+
paddingHorizontal: theme.spacing.md,
|
|
368
|
+
paddingVertical: theme.spacing.sm,
|
|
369
|
+
},
|
|
370
|
+
cancelButtonText: {
|
|
371
|
+
fontFamily: Fonts.outfitMedium,
|
|
372
|
+
fontSize: moderateScale(12),
|
|
373
|
+
color: theme.colors.white,
|
|
374
|
+
},
|
|
375
|
+
emptyContainer: {
|
|
376
|
+
alignItems: "center",
|
|
377
|
+
paddingVertical: theme.spacing.xl,
|
|
378
|
+
},
|
|
379
|
+
emptyText: {
|
|
380
|
+
fontFamily: Fonts.outfitRegular,
|
|
381
|
+
fontSize: moderateScale(14),
|
|
382
|
+
color: theme.colors.textSecondary,
|
|
383
|
+
},
|
|
384
|
+
footerLoader: {
|
|
385
|
+
paddingVertical: theme.spacing.md,
|
|
386
|
+
alignItems: "center",
|
|
387
|
+
},
|
|
388
|
+
footerLoaderText: {
|
|
389
|
+
fontFamily: Fonts.outfitRegular,
|
|
390
|
+
fontSize: moderateScale(12),
|
|
391
|
+
color: theme.colors.textSecondary,
|
|
392
|
+
marginTop: theme.spacing.xs,
|
|
393
|
+
},
|
|
394
|
+
loadingContainer: {
|
|
395
|
+
alignItems: "center",
|
|
396
|
+
paddingVertical: theme.spacing.xl,
|
|
397
|
+
},
|
|
398
|
+
loadingText: {
|
|
399
|
+
fontFamily: Fonts.outfitRegular,
|
|
400
|
+
fontSize: moderateScale(14),
|
|
401
|
+
color: theme.colors.textSecondary,
|
|
402
|
+
marginTop: theme.spacing.md,
|
|
403
|
+
},
|
|
404
|
+
sectionTitle: {
|
|
405
|
+
fontFamily: Fonts.outfitMedium,
|
|
406
|
+
fontSize: theme.typography.fontSize.xs,
|
|
407
|
+
color: theme.colors.blue,
|
|
408
|
+
marginBottom: theme.spacing.md,
|
|
409
|
+
letterSpacing: 0.5,
|
|
410
|
+
},
|
|
411
|
+
clubsList: {
|
|
412
|
+
flex: 1,
|
|
413
|
+
},
|
|
414
|
+
flatListContent: {
|
|
415
|
+
paddingBottom: theme.spacing.xl,
|
|
416
|
+
},
|
|
417
|
+
contentList: {
|
|
418
|
+
flex: 1,
|
|
419
|
+
backgroundColor: theme.colors.background,
|
|
420
|
+
borderTopLeftRadius: moderateScale(30),
|
|
421
|
+
borderTopRightRadius: moderateScale(30),
|
|
422
|
+
marginTop: -theme.spacing.xl,
|
|
423
|
+
paddingHorizontal: theme.spacing.lg,
|
|
424
|
+
paddingTop: theme.spacing.lg,
|
|
425
|
+
},
|
|
426
|
+
});
|