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,390 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, StatusBar, Platform, TouchableOpacity, Image, FlatList } from 'react-native';
|
|
3
|
+
import moment from 'moment';
|
|
4
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
5
|
+
import { useRaffleDetails, useSetRaffleReminder, useRaffleReminder, useDeleteRaffleReminder } from '@services/mainServices';
|
|
6
|
+
import { ReminderCardItem, SetReminderModal } from '@components/common';
|
|
7
|
+
import { SetRaffleReminderScreenProps } from '@navigation';
|
|
8
|
+
import ToastManager from '@components/common/ToastManager';
|
|
9
|
+
import { moderateScale } from '@utils/scaling';
|
|
10
|
+
import { getApiErrorInfo } from '@services';
|
|
11
|
+
import { Fonts } from '@constants/Fonts';
|
|
12
|
+
import { theme } from '@constants';
|
|
13
|
+
import SVG from '@assets/icons';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export const SetRaffleReminderScreen: React.FC<SetRaffleReminderScreenProps> = ({ navigation, route }) => {
|
|
19
|
+
|
|
20
|
+
const { selectedClub, raffle: raffleDetails } = route?.params ?? {};
|
|
21
|
+
const raffleId = raffleDetails?.raffleId;
|
|
22
|
+
const clubId = selectedClub?.id;
|
|
23
|
+
const memberId = selectedClub?.selectedMember?.id;
|
|
24
|
+
const [isReminderModalOpen, setIsReminderModalOpen] = useState<boolean>(false);
|
|
25
|
+
|
|
26
|
+
const { data: raffleResponse, isLoading, error } = useRaffleDetails(raffleId);
|
|
27
|
+
const { data: reminderResponse, isLoading: isReminderLoading, refetch: refetchReminder } = useRaffleReminder(raffleId, clubId, memberId);
|
|
28
|
+
|
|
29
|
+
const setReminderMutation = useSetRaffleReminder();
|
|
30
|
+
const deleteReminderMutation = useDeleteRaffleReminder();
|
|
31
|
+
|
|
32
|
+
const raffleData = raffleResponse?.data?.data;
|
|
33
|
+
const details = useMemo(() => raffleData ?? raffleDetails ?? {}, [raffleData, raffleDetails]);
|
|
34
|
+
|
|
35
|
+
const reminderDataRaw = reminderResponse?.data?.data;
|
|
36
|
+
const reminderData = reminderDataRaw?.raffleReminders ?? [];
|
|
37
|
+
|
|
38
|
+
// Handle setting reminder
|
|
39
|
+
const handleSetReminder = async (reminderDateTime: Date) => {
|
|
40
|
+
if (!raffleId || !memberId || !clubId) {
|
|
41
|
+
ToastManager.error('Missing Information', 'Unable to set reminder. Missing required information.');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
// Format date using moment for API
|
|
47
|
+
const formattedDateTime = moment(reminderDateTime).format("YYYY-MM-DDTHH:mm:ssZ");
|
|
48
|
+
|
|
49
|
+
const response = await setReminderMutation.mutateAsync({
|
|
50
|
+
reminderDateTime: formattedDateTime,
|
|
51
|
+
raffleId: raffleId,
|
|
52
|
+
memberId: memberId,
|
|
53
|
+
clubId: clubId,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
ToastManager.success(response.data?.message);
|
|
58
|
+
|
|
59
|
+
// Close modal
|
|
60
|
+
setIsReminderModalOpen(false);
|
|
61
|
+
|
|
62
|
+
// Refetch the reminder data to update the UI
|
|
63
|
+
refetchReminder();
|
|
64
|
+
} catch (error: any) {
|
|
65
|
+
console.error('Failed to set reminder:', error);
|
|
66
|
+
const errorInfo = getApiErrorInfo(error);
|
|
67
|
+
ToastManager.error(errorInfo?.message || 'Failed to set reminder. Please try again.');
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Handle deleting reminder
|
|
72
|
+
const handleDeleteReminder = async (reminderId: number | string | undefined) => {
|
|
73
|
+
if (!raffleId) {
|
|
74
|
+
ToastManager.error('Unable to delete reminder. Missing raffle ID.');
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (!reminderId) {
|
|
79
|
+
ToastManager.error('Unable to delete reminder. Missing reminder ID.');
|
|
80
|
+
console.error('reminderId is undefined or null:', reminderId);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
try {
|
|
85
|
+
const reminderIdNumber = typeof reminderId === 'string' ? parseInt(reminderId, 10) : reminderId;
|
|
86
|
+
|
|
87
|
+
if (isNaN(reminderIdNumber)) {
|
|
88
|
+
ToastManager.error('Invalid reminder ID format.');
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
await deleteReminderMutation.mutateAsync({
|
|
93
|
+
raffleId: raffleId,
|
|
94
|
+
reminderId: reminderIdNumber,
|
|
95
|
+
clubId: clubId,
|
|
96
|
+
memberId: memberId,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
ToastManager.success('Reminder has been deleted successfully!');
|
|
100
|
+
|
|
101
|
+
// Refetch the reminder data to update the UI
|
|
102
|
+
refetchReminder();
|
|
103
|
+
} catch (error: any) {
|
|
104
|
+
console.error('Failed to delete reminder:', error);
|
|
105
|
+
ToastManager.error(error?.message || 'Failed to delete reminder. Please try again.');
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<View style={styles.container}>
|
|
116
|
+
<StatusBar
|
|
117
|
+
barStyle="light-content"
|
|
118
|
+
backgroundColor={theme.colors.blue}
|
|
119
|
+
translucent={Platform.OS === 'android' ? true : false}
|
|
120
|
+
/>
|
|
121
|
+
{Platform.OS === 'ios' && <View style={styles.statusBarBackground} />}
|
|
122
|
+
<SafeAreaView style={styles.safeArea}>
|
|
123
|
+
<View style={styles.header}>
|
|
124
|
+
<View style={styles.navRow}>
|
|
125
|
+
<TouchableOpacity onPress={() => navigation.goBack()} hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }}>
|
|
126
|
+
<SVG.arrowLeft_white width={moderateScale(25)} height={moderateScale(25)} />
|
|
127
|
+
</TouchableOpacity>
|
|
128
|
+
<View style={styles.clubInfoContainer}>
|
|
129
|
+
<View style={styles.userConSty}>
|
|
130
|
+
{selectedClub?.clubImage ? (
|
|
131
|
+
<Image
|
|
132
|
+
source={{ uri: selectedClub.clubImage }}
|
|
133
|
+
style={styles.userDetailsSty}
|
|
134
|
+
resizeMode="cover"
|
|
135
|
+
/>
|
|
136
|
+
) : (
|
|
137
|
+
<View style={styles.placeholderLogoHeader}>
|
|
138
|
+
<SVG.UsersIcon width={moderateScale(20)} height={moderateScale(20)} />
|
|
139
|
+
</View>
|
|
140
|
+
)}
|
|
141
|
+
</View>
|
|
142
|
+
<Text style={styles.userNameSty}>{selectedClub?.clubName ?? 'Unknown Club'}</Text>
|
|
143
|
+
</View>
|
|
144
|
+
</View>
|
|
145
|
+
<View style={styles.headerMain}>
|
|
146
|
+
<Text style={styles.headerTitle}>{details?.raffleTitle ?? 'Raffle'}</Text>
|
|
147
|
+
{details?.locationAddress && (
|
|
148
|
+
<View style={styles.opMetaRow}>
|
|
149
|
+
<SVG.locationWhite width={moderateScale(18)} height={moderateScale(18)} />
|
|
150
|
+
<Text style={styles.opMetaText}>{details.locationAddress}</Text>
|
|
151
|
+
</View>
|
|
152
|
+
)}
|
|
153
|
+
{details?.drawDate && (
|
|
154
|
+
<View style={styles.opMetaRow}>
|
|
155
|
+
<SVG.CalendarWhite width={moderateScale(18)} height={moderateScale(18)} />
|
|
156
|
+
<Text style={styles.opMetaText}>{details.drawDate}</Text>
|
|
157
|
+
</View>
|
|
158
|
+
)}
|
|
159
|
+
</View>
|
|
160
|
+
</View>
|
|
161
|
+
<View style={styles.content}>
|
|
162
|
+
<Text style={styles.sectionTitle}>
|
|
163
|
+
MY REMINDERS
|
|
164
|
+
</Text>
|
|
165
|
+
{isLoading ? (
|
|
166
|
+
<View style={styles.loadingContainer}>
|
|
167
|
+
<Text style={styles.emptyText}>Loading raffle details...</Text>
|
|
168
|
+
</View>
|
|
169
|
+
) : error ? (
|
|
170
|
+
<View style={styles.loadingContainer}>
|
|
171
|
+
<Text style={styles.errorText}>Error loading raffle details.</Text>
|
|
172
|
+
</View>
|
|
173
|
+
) : (
|
|
174
|
+
<FlatList
|
|
175
|
+
data={reminderData}
|
|
176
|
+
style={styles.reminderList}
|
|
177
|
+
keyExtractor={(item) => item?.reminderId?.toString() || item?.reminderDateTime.toString()}
|
|
178
|
+
ListFooterComponent={<></>}
|
|
179
|
+
ListFooterComponentStyle={styles.reminderListFooter}
|
|
180
|
+
showsVerticalScrollIndicator={false}
|
|
181
|
+
renderItem={({ item }) => {
|
|
182
|
+
console.log("ssss", item);
|
|
183
|
+
|
|
184
|
+
const reminderId = item?.reminderId;
|
|
185
|
+
return (
|
|
186
|
+
<ReminderCardItem
|
|
187
|
+
reminderData={item}
|
|
188
|
+
onDelete={() => {
|
|
189
|
+
if (reminderId) {
|
|
190
|
+
handleDeleteReminder(reminderId);
|
|
191
|
+
} else {
|
|
192
|
+
console.warn('Cannot delete: reminderId is missing', item);
|
|
193
|
+
ToastManager.error('Cannot delete reminder: ID is missing.');
|
|
194
|
+
}
|
|
195
|
+
}}
|
|
196
|
+
/>
|
|
197
|
+
);
|
|
198
|
+
}}
|
|
199
|
+
ListEmptyComponent={() => {
|
|
200
|
+
return (
|
|
201
|
+
<View style={styles.emptyState}>
|
|
202
|
+
<Text style={styles.emptyStateText}>
|
|
203
|
+
No reminders set yet
|
|
204
|
+
</Text>
|
|
205
|
+
</View>
|
|
206
|
+
);
|
|
207
|
+
}}
|
|
208
|
+
/>
|
|
209
|
+
)}
|
|
210
|
+
</View>
|
|
211
|
+
|
|
212
|
+
{/* Add Reminder Button */}
|
|
213
|
+
<TouchableOpacity
|
|
214
|
+
style={styles.addReminderButton}
|
|
215
|
+
onPress={() => setIsReminderModalOpen(true)}
|
|
216
|
+
activeOpacity={0.7}
|
|
217
|
+
>
|
|
218
|
+
<Text style={styles.addReminderButtonText}>+</Text>
|
|
219
|
+
</TouchableOpacity>
|
|
220
|
+
</SafeAreaView>
|
|
221
|
+
|
|
222
|
+
{/* Set Reminder Modal */}
|
|
223
|
+
<SetReminderModal
|
|
224
|
+
maxDate={reminderDataRaw?.raffleDrawDate}
|
|
225
|
+
visible={isReminderModalOpen}
|
|
226
|
+
onClose={() => setIsReminderModalOpen(false)}
|
|
227
|
+
onSave={(date) => {
|
|
228
|
+
setIsReminderModalOpen(false);
|
|
229
|
+
handleSetReminder(date);
|
|
230
|
+
}}
|
|
231
|
+
onSuccessClose={true}
|
|
232
|
+
/>
|
|
233
|
+
</View>
|
|
234
|
+
);
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const styles = StyleSheet.create({
|
|
238
|
+
container: {
|
|
239
|
+
flex: 1,
|
|
240
|
+
backgroundColor: theme.colors.blue,
|
|
241
|
+
},
|
|
242
|
+
statusBarBackground: {
|
|
243
|
+
position: 'absolute',
|
|
244
|
+
top: 0,
|
|
245
|
+
left: 0,
|
|
246
|
+
right: 0,
|
|
247
|
+
height: Platform.OS === 'ios' ? 44 : 0,
|
|
248
|
+
backgroundColor: theme.colors.blue,
|
|
249
|
+
zIndex: 1000,
|
|
250
|
+
},
|
|
251
|
+
safeArea: {
|
|
252
|
+
flex: 1,
|
|
253
|
+
backgroundColor: theme.colors.blue,
|
|
254
|
+
},
|
|
255
|
+
header: {
|
|
256
|
+
paddingBottom: theme.spacing.lg,
|
|
257
|
+
backgroundColor: theme.colors.blue,
|
|
258
|
+
},
|
|
259
|
+
reminderListFooter: {
|
|
260
|
+
marginBottom: moderateScale(50),
|
|
261
|
+
},
|
|
262
|
+
navRow: {
|
|
263
|
+
flexDirection: 'row',
|
|
264
|
+
alignItems: 'center',
|
|
265
|
+
paddingHorizontal: theme.spacing.lg,
|
|
266
|
+
},
|
|
267
|
+
clubInfoContainer: {
|
|
268
|
+
flexDirection: 'row',
|
|
269
|
+
alignItems: 'center',
|
|
270
|
+
},
|
|
271
|
+
userConSty: {
|
|
272
|
+
marginHorizontal: moderateScale(10),
|
|
273
|
+
width: moderateScale(30),
|
|
274
|
+
height: moderateScale(30),
|
|
275
|
+
borderRadius: moderateScale(15),
|
|
276
|
+
borderWidth: 1.5,
|
|
277
|
+
borderColor: theme.colors.imageBorder,
|
|
278
|
+
backgroundColor: theme.colors.background,
|
|
279
|
+
alignItems: 'center',
|
|
280
|
+
justifyContent: 'center',
|
|
281
|
+
},
|
|
282
|
+
placeholderLogoHeader: {
|
|
283
|
+
width: moderateScale(24),
|
|
284
|
+
height: moderateScale(24),
|
|
285
|
+
borderRadius: moderateScale(12),
|
|
286
|
+
alignItems: 'center',
|
|
287
|
+
justifyContent: 'center',
|
|
288
|
+
},
|
|
289
|
+
userDetailsSty: {
|
|
290
|
+
width: moderateScale(30),
|
|
291
|
+
height: moderateScale(30),
|
|
292
|
+
borderRadius: moderateScale(15),
|
|
293
|
+
resizeMode: 'cover',
|
|
294
|
+
},
|
|
295
|
+
userNameSty: {
|
|
296
|
+
color: theme.colors.white,
|
|
297
|
+
fontFamily: Fonts.outfitMedium,
|
|
298
|
+
fontSize: moderateScale(15),
|
|
299
|
+
},
|
|
300
|
+
headerMain: {
|
|
301
|
+
paddingHorizontal: theme.spacing.lg,
|
|
302
|
+
marginTop: theme.spacing.sm,
|
|
303
|
+
},
|
|
304
|
+
headerTitle: {
|
|
305
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
306
|
+
fontSize: moderateScale(24),
|
|
307
|
+
color: theme.colors.white,
|
|
308
|
+
marginBottom: theme.spacing.sm,
|
|
309
|
+
},
|
|
310
|
+
opMetaRow: {
|
|
311
|
+
flexDirection: 'row',
|
|
312
|
+
alignItems: 'center',
|
|
313
|
+
marginBottom: theme.spacing.xs,
|
|
314
|
+
},
|
|
315
|
+
opMetaText: {
|
|
316
|
+
marginLeft: theme.spacing.xs,
|
|
317
|
+
fontFamily: Fonts.outfitRegular,
|
|
318
|
+
fontSize: theme.typography.fontSize.xs,
|
|
319
|
+
color: 'rgba(255, 255, 255, 0.85)',
|
|
320
|
+
},
|
|
321
|
+
content: {
|
|
322
|
+
flex: 1,
|
|
323
|
+
backgroundColor: theme.colors.background,
|
|
324
|
+
borderTopLeftRadius: moderateScale(28),
|
|
325
|
+
borderTopRightRadius: moderateScale(28),
|
|
326
|
+
paddingTop: moderateScale(10),
|
|
327
|
+
paddingBottom: theme.spacing.md,
|
|
328
|
+
paddingHorizontal: theme.spacing.lg
|
|
329
|
+
},
|
|
330
|
+
reminderList: {
|
|
331
|
+
flex: 1,
|
|
332
|
+
},
|
|
333
|
+
sectionTitle: {
|
|
334
|
+
fontFamily: Fonts.outfitRegular,
|
|
335
|
+
fontSize: theme.typography.fontSize.sm,
|
|
336
|
+
color: theme.colors.blue,
|
|
337
|
+
marginBottom: theme.spacing.sm,
|
|
338
|
+
},
|
|
339
|
+
emptyState: {
|
|
340
|
+
paddingVertical: theme.spacing.lg,
|
|
341
|
+
alignItems: 'center',
|
|
342
|
+
justifyContent: 'center',
|
|
343
|
+
},
|
|
344
|
+
emptyStateText: {
|
|
345
|
+
fontFamily: Fonts.outfitMedium,
|
|
346
|
+
fontSize: theme.typography.fontSize.sm,
|
|
347
|
+
color: theme.colors.DarkGray,
|
|
348
|
+
},
|
|
349
|
+
loadingContainer: {
|
|
350
|
+
flex: 1,
|
|
351
|
+
justifyContent: 'center',
|
|
352
|
+
alignItems: 'center',
|
|
353
|
+
paddingHorizontal: theme.spacing.lg,
|
|
354
|
+
},
|
|
355
|
+
emptyText: {
|
|
356
|
+
fontFamily: Fonts.outfitMedium,
|
|
357
|
+
fontSize: theme.typography.fontSize.md,
|
|
358
|
+
color: theme.colors.DarkGray,
|
|
359
|
+
textAlign: 'center',
|
|
360
|
+
},
|
|
361
|
+
errorText: {
|
|
362
|
+
fontFamily: Fonts.outfitMedium,
|
|
363
|
+
fontSize: theme.typography.fontSize.md,
|
|
364
|
+
color: theme.colors.cancelButton,
|
|
365
|
+
marginTop: theme.spacing.md,
|
|
366
|
+
textAlign: 'center',
|
|
367
|
+
},
|
|
368
|
+
addReminderButton: {
|
|
369
|
+
position: 'absolute',
|
|
370
|
+
bottom: moderateScale(50),
|
|
371
|
+
right: moderateScale(25),
|
|
372
|
+
width: moderateScale(56),
|
|
373
|
+
height: moderateScale(56),
|
|
374
|
+
borderRadius: moderateScale(28),
|
|
375
|
+
backgroundColor: theme.colors.blue,
|
|
376
|
+
alignItems: 'center',
|
|
377
|
+
justifyContent: 'center',
|
|
378
|
+
shadowColor: theme.colors.black,
|
|
379
|
+
shadowOpacity: 0.3,
|
|
380
|
+
shadowRadius: 8,
|
|
381
|
+
shadowOffset: { width: 0, height: 4 },
|
|
382
|
+
elevation: 8,
|
|
383
|
+
},
|
|
384
|
+
addReminderButtonText: {
|
|
385
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
386
|
+
fontSize: moderateScale(32),
|
|
387
|
+
color: theme.colors.white,
|
|
388
|
+
marginBottom: moderateScale(2),
|
|
389
|
+
},
|
|
390
|
+
});
|