create-gufran-expo-app 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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,495 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
StatusBar,
|
|
7
|
+
Platform,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
Image,
|
|
10
|
+
FlatList,
|
|
11
|
+
Share
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
import { RafflesScreenProps } from '../../types/navigation';
|
|
14
|
+
import { Strings, theme } from '../../constants';
|
|
15
|
+
import { moderateScale } from '../../utils/scaling';
|
|
16
|
+
import { Fonts } from '../../constants/Fonts';
|
|
17
|
+
import SVG from '../../assets/icons';
|
|
18
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
19
|
+
import { Button, TextInput } from '../../components/common';
|
|
20
|
+
import { useInfiniteRaffles, mainService } from '../../services/mainServices';
|
|
21
|
+
import Images from '../../assets/images';
|
|
22
|
+
import { useFocusEffect } from '@react-navigation/native';
|
|
23
|
+
|
|
24
|
+
export const RafflesScreen: React.FC<RafflesScreenProps> = ({ navigation, route }) => {
|
|
25
|
+
const { selectedClub, selectedMember: initialSelectedMember } = route?.params ?? {};
|
|
26
|
+
|
|
27
|
+
const memberId = initialSelectedMember?.id;
|
|
28
|
+
const clubId = selectedClub?.id;
|
|
29
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
30
|
+
|
|
31
|
+
const {
|
|
32
|
+
data,
|
|
33
|
+
isLoading,
|
|
34
|
+
isError,
|
|
35
|
+
refetch,
|
|
36
|
+
fetchNextPage,
|
|
37
|
+
hasNextPage,
|
|
38
|
+
isFetchingNextPage,
|
|
39
|
+
isRefetching,
|
|
40
|
+
} = useInfiniteRaffles(memberId, clubId, 10, searchQuery);
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
useFocusEffect(
|
|
44
|
+
React.useCallback(() => {
|
|
45
|
+
refetch();
|
|
46
|
+
}, [])
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// Flatten API pages into a single array
|
|
51
|
+
const raffles = useMemo(() => {
|
|
52
|
+
const pages = data?.pages ?? [];
|
|
53
|
+
const flat = pages.flatMap((page: any) => {
|
|
54
|
+
const payload = page?.data;
|
|
55
|
+
if (Array.isArray(payload?.data)) return payload.data;
|
|
56
|
+
if (Array.isArray(payload)) return payload;
|
|
57
|
+
return [];
|
|
58
|
+
});
|
|
59
|
+
return flat;
|
|
60
|
+
}, [data]);
|
|
61
|
+
|
|
62
|
+
const renderRaffleCard = ({ item }: { item: any }) => {
|
|
63
|
+
const title = item?.title || item?.raffleTitle || 'Raffle';
|
|
64
|
+
const prizePool = item?.totalPricePoolAmount || '$0.00';
|
|
65
|
+
const drawDate = item?.drawDate || '';
|
|
66
|
+
const heroBanner = item?.heroBanner || item?.bannerImage || item?.bannerImageUrl || item?.image || '';
|
|
67
|
+
const referralSales = item?.totalSales || item?.totalSales || 0;
|
|
68
|
+
const raffleId = item?.raffleId || 0;
|
|
69
|
+
|
|
70
|
+
const onRaffleCardPress = () => {
|
|
71
|
+
navigation.navigate('RaffleDetails', {
|
|
72
|
+
selectedClub,
|
|
73
|
+
selectedMember: selectedClub?.selectedMember,
|
|
74
|
+
raffleId: raffleId,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
const createNavigationData = () => {
|
|
80
|
+
const navigationData = {
|
|
81
|
+
selectedClub: selectedClub,
|
|
82
|
+
selectedMember: selectedClub?.selectedMember,
|
|
83
|
+
raffleId: raffleId,
|
|
84
|
+
raffleTitle: title,
|
|
85
|
+
};
|
|
86
|
+
console.log('Navigation data being passed:', navigationData);
|
|
87
|
+
return navigationData;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<TouchableOpacity style={styles.cardContainer}
|
|
92
|
+
onPress={onRaffleCardPress}>
|
|
93
|
+
{!!heroBanner ? (
|
|
94
|
+
<Image source={{ uri: heroBanner }} style={styles.cardBanner} resizeMode="cover" />
|
|
95
|
+
) : (
|
|
96
|
+
|
|
97
|
+
<View style={{}}>
|
|
98
|
+
<Image source={Images.clubDefauldImage} style={{ width: '100%', height: moderateScale(150) }} />
|
|
99
|
+
</View>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
<View>
|
|
103
|
+
<Text style={styles.cardTitle}>{title}</Text>
|
|
104
|
+
<View style={styles.prizeContainer}>
|
|
105
|
+
<Text style={styles.prizeLabel}>Prize Pool: <Text style={{ fontFamily: Fonts.outfitSemiBold }}>${prizePool}</Text></Text>
|
|
106
|
+
<Text style={styles.drawDetails}>Draw Date: {drawDate}</Text>
|
|
107
|
+
</View>
|
|
108
|
+
<View style={styles.actionsRow}>
|
|
109
|
+
<Button
|
|
110
|
+
title="Refer to Friends"
|
|
111
|
+
onPress={async () => {
|
|
112
|
+
try {
|
|
113
|
+
const response = await mainService.getReferralCode({
|
|
114
|
+
raffleId: raffleId,
|
|
115
|
+
memberId: memberId || 0,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const responseData = response?.data?.data;
|
|
119
|
+
const referralCode = responseData?.referralCode || '';
|
|
120
|
+
const clubCode = responseData?.clubCode || '';
|
|
121
|
+
const clubName = responseData?.clubName || 'ClubYakka';
|
|
122
|
+
|
|
123
|
+
const appLink = 'dummy url'; // Replace with actual app link
|
|
124
|
+
const shareMessage =
|
|
125
|
+
`Join the ${title} raffle on ClubYakka app!
|
|
126
|
+
|
|
127
|
+
Use my referral code: "${referralCode}" when buying tickets
|
|
128
|
+
|
|
129
|
+
Steps to buy:
|
|
130
|
+
1. Ensure you have ${clubName} club already joined or if not, find it with club code: "${clubCode}" to join it
|
|
131
|
+
2. Continue as desired member in Club Dashboard
|
|
132
|
+
3. Click Raffle section and find raffle: "${title}"
|
|
133
|
+
4. When buying raffle tickets, apply my code: "${referralCode}"
|
|
134
|
+
5. Purchase raffle tickets and WIN!
|
|
135
|
+
6. Click the link to open the app: ${appLink}`;
|
|
136
|
+
|
|
137
|
+
Share.share(
|
|
138
|
+
{
|
|
139
|
+
message: shareMessage,
|
|
140
|
+
url: appLink,
|
|
141
|
+
title: `${clubName} Raffle on ClubYakka`
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
dialogTitle: `Share ${title} Raffle`,
|
|
145
|
+
subject: `Join ${title} on ClubYakka`
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
} catch (error) {
|
|
149
|
+
console.error('Failed to get referral code:', error);
|
|
150
|
+
}
|
|
151
|
+
}}
|
|
152
|
+
variant="outline"
|
|
153
|
+
textStyle={styles.referButtonText}
|
|
154
|
+
style={{ flex: 0.55, borderColor: theme.colors.blue }}
|
|
155
|
+
size="small"
|
|
156
|
+
/>
|
|
157
|
+
<Button
|
|
158
|
+
title="View"
|
|
159
|
+
onPress={onRaffleCardPress}
|
|
160
|
+
variant="outline"
|
|
161
|
+
textStyle={styles.viewButtonText}
|
|
162
|
+
style={{ flex: 0.4, borderColor: theme.colors.blue, backgroundColor: theme.colors.blue }}
|
|
163
|
+
size="small"
|
|
164
|
+
/>
|
|
165
|
+
</View>
|
|
166
|
+
<TouchableOpacity style={styles.referralRow}
|
|
167
|
+
onPress={() => { navigation.navigate('MyReferralMembers', createNavigationData()) }}
|
|
168
|
+
>
|
|
169
|
+
<View style={styles.referralIconWrapper}>
|
|
170
|
+
<SVG.ReferralMembers width={moderateScale(25)} height={moderateScale(25)} />
|
|
171
|
+
</View>
|
|
172
|
+
<Text style={styles.referralLabel}>My Referral Members</Text>
|
|
173
|
+
<View style={styles.referralBadge}>
|
|
174
|
+
<Text style={styles.referralBadgeText}>{referralSales}</Text>
|
|
175
|
+
</View>
|
|
176
|
+
</TouchableOpacity>
|
|
177
|
+
</View>
|
|
178
|
+
</TouchableOpacity>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<View style={styles.container}>
|
|
184
|
+
<StatusBar
|
|
185
|
+
barStyle="light-content"
|
|
186
|
+
backgroundColor={theme.colors.blue}
|
|
187
|
+
translucent={Platform.OS === 'android' ? true : false}
|
|
188
|
+
/>
|
|
189
|
+
{Platform.OS === 'ios' && <View style={styles.statusBarBackground} />}
|
|
190
|
+
<SafeAreaView style={styles.header}>
|
|
191
|
+
<View style={styles.headerTopRow}>
|
|
192
|
+
<TouchableOpacity onPress={() => navigation.goBack()}>
|
|
193
|
+
<SVG.arrowLeft_white width={moderateScale(25)} height={moderateScale(25)} />
|
|
194
|
+
</TouchableOpacity>
|
|
195
|
+
<View style={styles.clubInfoWrapper}>
|
|
196
|
+
<View style={styles.userConSty}>
|
|
197
|
+
{!!selectedClub?.clubImage ? (
|
|
198
|
+
<Image source={{ uri: selectedClub?.clubImage }} style={styles.userDetailsSty} resizeMode="cover" />
|
|
199
|
+
) : (
|
|
200
|
+
<View style={styles.placeholderLogoHeader}>
|
|
201
|
+
<SVG.UsersIcon width={moderateScale(20)} height={moderateScale(20)} />
|
|
202
|
+
</View>
|
|
203
|
+
)}
|
|
204
|
+
</View>
|
|
205
|
+
<Text style={styles.userNameSty}>{selectedClub?.clubName || 'Unknown Club'}</Text>
|
|
206
|
+
</View>
|
|
207
|
+
</View>
|
|
208
|
+
<View style={styles.titleWrapper}>
|
|
209
|
+
<Text style={styles.headerTitle}>Raffles</Text>
|
|
210
|
+
</View>
|
|
211
|
+
<View style={styles.addMemberContainer} />
|
|
212
|
+
|
|
213
|
+
<View style={styles.content}>
|
|
214
|
+
<View style={styles.searchContainer}>
|
|
215
|
+
<TextInput
|
|
216
|
+
placeholder="Search here"
|
|
217
|
+
placeholderTextColor={theme.colors.textSecondary}
|
|
218
|
+
value={searchQuery}
|
|
219
|
+
onChangeText={setSearchQuery}
|
|
220
|
+
autoCapitalize="none"
|
|
221
|
+
returnKeyType="search"
|
|
222
|
+
leftIcon={SVG.search}
|
|
223
|
+
leftIconStyle={{ marginLeft: moderateScale(10), width: moderateScale(18), height: moderateScale(18) }}
|
|
224
|
+
variant="outlined"
|
|
225
|
+
maxLength={30}
|
|
226
|
+
/>
|
|
227
|
+
</View>
|
|
228
|
+
<FlatList
|
|
229
|
+
data={raffles}
|
|
230
|
+
keyExtractor={(item) => item.id}
|
|
231
|
+
showsVerticalScrollIndicator={false}
|
|
232
|
+
contentContainerStyle={styles.listContent}
|
|
233
|
+
renderItem={renderRaffleCard}
|
|
234
|
+
onEndReachedThreshold={0.5}
|
|
235
|
+
onEndReached={() => {
|
|
236
|
+
if (hasNextPage && !isFetchingNextPage) {
|
|
237
|
+
fetchNextPage();
|
|
238
|
+
}
|
|
239
|
+
}}
|
|
240
|
+
refreshing={isRefetching}
|
|
241
|
+
onRefresh={refetch}
|
|
242
|
+
ListEmptyComponent={
|
|
243
|
+
<View style={styles.emptyState}>
|
|
244
|
+
<Text style={styles.emptyStateTitle}>No raffles found</Text>
|
|
245
|
+
<Text style={styles.emptyStateSubtitle}>
|
|
246
|
+
Try a different name or check back later for more raffles.
|
|
247
|
+
</Text>
|
|
248
|
+
</View>
|
|
249
|
+
}
|
|
250
|
+
ListFooterComponent={
|
|
251
|
+
isFetchingNextPage ? (
|
|
252
|
+
<View style={{ paddingVertical: theme.spacing.lg }}>
|
|
253
|
+
<Text style={{ textAlign: 'center', color: theme.colors.textSecondary, fontFamily: Fonts.outfitRegular }}>
|
|
254
|
+
Loading more...
|
|
255
|
+
</Text>
|
|
256
|
+
</View>
|
|
257
|
+
) : null
|
|
258
|
+
}
|
|
259
|
+
/>
|
|
260
|
+
</View>
|
|
261
|
+
</SafeAreaView>
|
|
262
|
+
</View>
|
|
263
|
+
);
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
const styles = StyleSheet.create({
|
|
267
|
+
container: {
|
|
268
|
+
flex: 1,
|
|
269
|
+
backgroundColor: theme.colors.blue,
|
|
270
|
+
},
|
|
271
|
+
statusBarBackground: {
|
|
272
|
+
position: 'absolute',
|
|
273
|
+
top: 0,
|
|
274
|
+
left: 0,
|
|
275
|
+
right: 0,
|
|
276
|
+
height: Platform.OS === 'ios' ? 44 : 0, // Status bar height for iOS
|
|
277
|
+
backgroundColor: theme.colors.blue,
|
|
278
|
+
zIndex: 1000,
|
|
279
|
+
},
|
|
280
|
+
header: {
|
|
281
|
+
flex: 1,
|
|
282
|
+
backgroundColor: theme.colors.blue,
|
|
283
|
+
},
|
|
284
|
+
userConSty: {
|
|
285
|
+
marginHorizontal: moderateScale(10),
|
|
286
|
+
width: moderateScale(30),
|
|
287
|
+
height: moderateScale(30),
|
|
288
|
+
borderRadius: moderateScale(15),
|
|
289
|
+
borderWidth: 1.5,
|
|
290
|
+
borderColor: theme.colors.imageBorder,
|
|
291
|
+
backgroundColor: theme.colors.background,
|
|
292
|
+
alignItems: 'center',
|
|
293
|
+
justifyContent: 'center'
|
|
294
|
+
},
|
|
295
|
+
headerTopRow: {
|
|
296
|
+
flexDirection: 'row',
|
|
297
|
+
alignItems: 'center',
|
|
298
|
+
paddingHorizontal: theme.spacing.lg,
|
|
299
|
+
},
|
|
300
|
+
clubInfoWrapper: {
|
|
301
|
+
flexDirection: 'row',
|
|
302
|
+
alignItems: 'center',
|
|
303
|
+
},
|
|
304
|
+
headerTitle: {
|
|
305
|
+
marginTop: moderateScale(10),
|
|
306
|
+
fontFamily: Fonts.outfitMedium,
|
|
307
|
+
fontSize: moderateScale(22),
|
|
308
|
+
color: theme.colors.white,
|
|
309
|
+
},
|
|
310
|
+
titleWrapper: {
|
|
311
|
+
paddingHorizontal: theme.spacing.lg,
|
|
312
|
+
},
|
|
313
|
+
content: {
|
|
314
|
+
flex: 1,
|
|
315
|
+
backgroundColor: theme.colors.background,
|
|
316
|
+
paddingTop: theme.spacing.md,
|
|
317
|
+
borderTopLeftRadius: moderateScale(30),
|
|
318
|
+
borderTopRightRadius: moderateScale(30),
|
|
319
|
+
},
|
|
320
|
+
userDetailsSty: {
|
|
321
|
+
width: moderateScale(30),
|
|
322
|
+
height: moderateScale(30),
|
|
323
|
+
borderRadius: moderateScale(15),
|
|
324
|
+
},
|
|
325
|
+
placeholderLogoHeader: {
|
|
326
|
+
width: moderateScale(20),
|
|
327
|
+
height: moderateScale(20),
|
|
328
|
+
borderRadius: moderateScale(10),
|
|
329
|
+
alignItems: 'center',
|
|
330
|
+
justifyContent: 'center'
|
|
331
|
+
},
|
|
332
|
+
userNameSty: {
|
|
333
|
+
marginTop: moderateScale(5),
|
|
334
|
+
color: theme.colors.white,
|
|
335
|
+
fontFamily: Fonts.outfitMedium,
|
|
336
|
+
fontSize: moderateScale(15)
|
|
337
|
+
},
|
|
338
|
+
addMemberContainer: {
|
|
339
|
+
backgroundColor: theme.colors.blue,
|
|
340
|
+
paddingHorizontal: theme.spacing.lg,
|
|
341
|
+
paddingBottom: theme.spacing.md,
|
|
342
|
+
},
|
|
343
|
+
listContent: {
|
|
344
|
+
paddingHorizontal: theme.spacing.lg,
|
|
345
|
+
paddingBottom: theme.spacing.xl,
|
|
346
|
+
},
|
|
347
|
+
searchContainer: {
|
|
348
|
+
marginHorizontal: theme.spacing.lg,
|
|
349
|
+
marginBottom: theme.spacing.md,
|
|
350
|
+
},
|
|
351
|
+
|
|
352
|
+
cardContainer: {
|
|
353
|
+
padding: theme.spacing.md,
|
|
354
|
+
backgroundColor: theme.colors.lightLavenderGray,
|
|
355
|
+
borderRadius: theme.borderRadius.lg,
|
|
356
|
+
marginBottom: theme.spacing.lg,
|
|
357
|
+
shadowColor: theme.colors.black,
|
|
358
|
+
shadowOpacity: 0.1,
|
|
359
|
+
shadowRadius: 12,
|
|
360
|
+
shadowOffset: { width: 0, height: 4 },
|
|
361
|
+
elevation: 4,
|
|
362
|
+
overflow: 'hidden',
|
|
363
|
+
},
|
|
364
|
+
cardBanner: {
|
|
365
|
+
width: '100%',
|
|
366
|
+
height: moderateScale(150),
|
|
367
|
+
borderRadius: theme.borderRadius.lg
|
|
368
|
+
},
|
|
369
|
+
cardTitle: {
|
|
370
|
+
fontFamily: Fonts.outfitMedium,
|
|
371
|
+
fontSize: theme.typography.fontSize.md,
|
|
372
|
+
color: theme.colors.DarkGray,
|
|
373
|
+
marginVertical: theme.spacing.sm,
|
|
374
|
+
},
|
|
375
|
+
prizeContainer: {
|
|
376
|
+
backgroundColor: theme.colors.white,
|
|
377
|
+
alignItems: 'center',
|
|
378
|
+
justifyContent: 'center',
|
|
379
|
+
padding: theme.spacing.md,
|
|
380
|
+
borderRadius: theme.borderRadius.lg,
|
|
381
|
+
},
|
|
382
|
+
prizeLabel: {
|
|
383
|
+
fontFamily: Fonts.outfitRegular,
|
|
384
|
+
fontSize: theme.typography.fontSize.lg,
|
|
385
|
+
color: theme.colors.appleGreen,
|
|
386
|
+
},
|
|
387
|
+
prizeValue: {
|
|
388
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
389
|
+
fontSize: theme.typography.fontSize.md,
|
|
390
|
+
color: theme.colors.appleGreen,
|
|
391
|
+
},
|
|
392
|
+
drawDetails: {
|
|
393
|
+
fontFamily: Fonts.outfitRegular,
|
|
394
|
+
fontSize: theme.typography.fontSize.xs,
|
|
395
|
+
color: theme.colors.textSecondary,
|
|
396
|
+
},
|
|
397
|
+
actionsRow: {
|
|
398
|
+
flexDirection: 'row',
|
|
399
|
+
justifyContent: 'space-between',
|
|
400
|
+
marginVertical: theme.spacing.md,
|
|
401
|
+
},
|
|
402
|
+
secondaryAction: {
|
|
403
|
+
flex: 1,
|
|
404
|
+
borderRadius: theme.borderRadius.xl,
|
|
405
|
+
borderWidth: 1,
|
|
406
|
+
borderColor: theme.colors.blue,
|
|
407
|
+
paddingVertical: theme.spacing.sm,
|
|
408
|
+
marginRight: theme.spacing.sm,
|
|
409
|
+
alignItems: 'center',
|
|
410
|
+
justifyContent: 'center',
|
|
411
|
+
},
|
|
412
|
+
secondaryActionText: {
|
|
413
|
+
fontFamily: Fonts.outfitMedium,
|
|
414
|
+
fontSize: theme.typography.fontSize.sm,
|
|
415
|
+
color: theme.colors.blue,
|
|
416
|
+
},
|
|
417
|
+
primaryAction: {
|
|
418
|
+
flex: 1,
|
|
419
|
+
borderRadius: theme.borderRadius.xl,
|
|
420
|
+
backgroundColor: theme.colors.blue,
|
|
421
|
+
paddingVertical: theme.spacing.sm,
|
|
422
|
+
marginLeft: theme.spacing.sm,
|
|
423
|
+
alignItems: 'center',
|
|
424
|
+
justifyContent: 'center',
|
|
425
|
+
},
|
|
426
|
+
primaryActionText: {
|
|
427
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
428
|
+
fontSize: theme.typography.fontSize.sm,
|
|
429
|
+
color: theme.colors.white,
|
|
430
|
+
},
|
|
431
|
+
referralRow: {
|
|
432
|
+
flexDirection: 'row',
|
|
433
|
+
alignItems: 'center',
|
|
434
|
+
paddingVertical: theme.spacing.sm,
|
|
435
|
+
paddingHorizontal: theme.spacing.sm,
|
|
436
|
+
borderBottomLeftRadius: theme.borderRadius.lg,
|
|
437
|
+
borderBottomRightRadius: theme.borderRadius.lg,
|
|
438
|
+
backgroundColor: theme.colors.white,
|
|
439
|
+
},
|
|
440
|
+
referralIconWrapper: {
|
|
441
|
+
width: moderateScale(32),
|
|
442
|
+
height: moderateScale(32),
|
|
443
|
+
borderRadius: moderateScale(16),
|
|
444
|
+
backgroundColor: theme.colors.white,
|
|
445
|
+
alignItems: 'center',
|
|
446
|
+
justifyContent: 'center',
|
|
447
|
+
marginRight: theme.spacing.xs,
|
|
448
|
+
},
|
|
449
|
+
referralLabel: {
|
|
450
|
+
flex: 1,
|
|
451
|
+
fontFamily: Fonts.outfitRegular,
|
|
452
|
+
fontSize: theme.typography.fontSize.sm,
|
|
453
|
+
color: theme.colors.blue,
|
|
454
|
+
},
|
|
455
|
+
referralBadge: {
|
|
456
|
+
minWidth: moderateScale(32),
|
|
457
|
+
height: moderateScale(32),
|
|
458
|
+
borderRadius: moderateScale(16),
|
|
459
|
+
backgroundColor: theme.colors.appleGreen,
|
|
460
|
+
alignItems: 'center',
|
|
461
|
+
justifyContent: 'center',
|
|
462
|
+
paddingHorizontal: theme.spacing.xs,
|
|
463
|
+
},
|
|
464
|
+
referralBadgeText: {
|
|
465
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
466
|
+
fontSize: theme.typography.fontSize.sm,
|
|
467
|
+
color: theme.colors.white,
|
|
468
|
+
},
|
|
469
|
+
emptyState: {
|
|
470
|
+
alignItems: 'center',
|
|
471
|
+
paddingVertical: theme.spacing.xl,
|
|
472
|
+
},
|
|
473
|
+
emptyStateTitle: {
|
|
474
|
+
fontFamily: Fonts.outfitMedium,
|
|
475
|
+
fontSize: theme.typography.fontSize.lg,
|
|
476
|
+
color: theme.colors.DarkGray,
|
|
477
|
+
marginBottom: theme.spacing.xs,
|
|
478
|
+
},
|
|
479
|
+
emptyStateSubtitle: {
|
|
480
|
+
fontFamily: Fonts.outfitRegular,
|
|
481
|
+
fontSize: theme.typography.fontSize.sm,
|
|
482
|
+
color: theme.colors.textSecondary,
|
|
483
|
+
textAlign: 'center',
|
|
484
|
+
paddingHorizontal: theme.spacing.lg,
|
|
485
|
+
},
|
|
486
|
+
referButtonText: {
|
|
487
|
+
color: theme.colors.blue,
|
|
488
|
+
fontWeight: theme.typography.fontWeight.semibold,
|
|
489
|
+
},
|
|
490
|
+
viewButtonText: {
|
|
491
|
+
color: theme.colors.white,
|
|
492
|
+
fontWeight: theme.typography.fontWeight.semibold,
|
|
493
|
+
},
|
|
494
|
+
|
|
495
|
+
});
|