create-gufran-expo-app 2.0.3 → 2.0.5

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.
Files changed (42) hide show
  1. package/README.md +1 -2
  2. package/package.json +3 -3
  3. package/template/src/navigation/AuthStack.tsx +6 -25
  4. package/template/src/navigation/MainStack.tsx +0 -148
  5. package/template/src/navigation/RootNavigator.tsx +4 -26
  6. package/template/src/navigation/index.ts +0 -1
  7. package/template/src/navigation/navigationRef.ts +1 -1
  8. package/template/src/screens/HomeScreen.tsx +3 -215
  9. package/template/src/screens/auth/LoginScreen.tsx +13 -13
  10. package/template/src/screens/auth/index.ts +1 -6
  11. package/template/src/screens/index.ts +0 -35
  12. package/template/src/services/api.ts +5 -5
  13. package/template/src/services/authService.ts +3 -299
  14. package/template/src/services/mainServices.ts +19 -1914
  15. package/template/src/types/navigation.ts +5 -155
  16. package/template/src/utils/index.ts +5 -8
  17. package/template/src/navigation/MiddleStack.tsx +0 -35
  18. package/template/src/screens/auth/AddMamber.tsx +0 -428
  19. package/template/src/screens/auth/ForgotPasswordScreen.tsx +0 -176
  20. package/template/src/screens/auth/OTPVerifyScreen.tsx +0 -359
  21. package/template/src/screens/auth/RegisterScreen.tsx +0 -430
  22. package/template/src/screens/auth/SuccessScreen.tsx +0 -201
  23. package/template/src/screens/chat/ChatScreen.tsx +0 -1819
  24. package/template/src/screens/chat/ChatThreadsScreen.tsx +0 -360
  25. package/template/src/screens/chat/ReportMessageScreen.tsx +0 -238
  26. package/template/src/screens/clubs/Announcements.tsx +0 -426
  27. package/template/src/screens/clubs/BuyRaffleTicketsScreen.tsx +0 -568
  28. package/template/src/screens/clubs/ClubDeteils.tsx +0 -497
  29. package/template/src/screens/clubs/JoinClub.tsx +0 -841
  30. package/template/src/screens/events/EventScreen.tsx +0 -460
  31. package/template/src/screens/raffles/MyReferralMembersScreen.tsx +0 -758
  32. package/template/src/screens/raffles/RaffleDetailsScreen.tsx +0 -762
  33. package/template/src/screens/raffles/RafflesScreen.tsx +0 -495
  34. package/template/src/screens/raffles/SetRaffleReminderScreen.tsx +0 -390
  35. package/template/src/screens/teams/JoinTeamScreen.tsx +0 -464
  36. package/template/src/screens/teams/MyTeamDetailsScreen.tsx +0 -979
  37. package/template/src/screens/teams/MyTeamScreen.tsx +0 -568
  38. package/template/src/screens/teams/PendingRequestsScreen.tsx +0 -426
  39. package/template/src/screens/volunteerOpportunities/SetReminderScreen.tsx +0 -631
  40. package/template/src/screens/volunteerOpportunities/VolunteerOpportunitiesDetailsScreen.tsx +0 -1049
  41. package/template/src/screens/volunteerOpportunities/VolunteerOpportunitiesScreen.tsx +0 -608
  42. package/template/src/utils/ClubSearchManager.ts +0 -222
@@ -1,495 +0,0 @@
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
- });