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,360 @@
|
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
FlatList,
|
|
7
|
+
StatusBar,
|
|
8
|
+
Platform,
|
|
9
|
+
TouchableOpacity,
|
|
10
|
+
Image,
|
|
11
|
+
RefreshControl,
|
|
12
|
+
Keyboard,
|
|
13
|
+
} from "react-native";
|
|
14
|
+
import moment from "moment";
|
|
15
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
16
|
+
import { useFocusEffect } from "@react-navigation/native";
|
|
17
|
+
import { useTeamThreads, ChatThread } from "@services/mainServices";
|
|
18
|
+
import { ChatThreadsScreenProps } from "@navigation";
|
|
19
|
+
import { moderateScale } from "@utils/scaling";
|
|
20
|
+
import { Fonts } from "@constants/Fonts";
|
|
21
|
+
import { theme } from "@constants";
|
|
22
|
+
import SVG from "@assets/icons";
|
|
23
|
+
|
|
24
|
+
export const ChatThreadsScreen: React.FC<ChatThreadsScreenProps> = ({
|
|
25
|
+
navigation,
|
|
26
|
+
route,
|
|
27
|
+
}) => {
|
|
28
|
+
const { team }: any = route?.params ?? {};
|
|
29
|
+
const teamId = team?.teamId;
|
|
30
|
+
const memberId = team?.memberId;
|
|
31
|
+
const clubImage = team?.teamProfileImage;
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
data: threadsResponse,
|
|
35
|
+
isLoading,
|
|
36
|
+
isError,
|
|
37
|
+
error,
|
|
38
|
+
refetch,
|
|
39
|
+
} = useTeamThreads(teamId, memberId);
|
|
40
|
+
|
|
41
|
+
// Get threads data from response
|
|
42
|
+
const threads = threadsResponse?.data?.data || [];
|
|
43
|
+
|
|
44
|
+
useFocusEffect(useCallback(() => {
|
|
45
|
+
refetch();
|
|
46
|
+
}, [refetch]));
|
|
47
|
+
|
|
48
|
+
// Refresh data
|
|
49
|
+
const onRefresh = useCallback(() => {
|
|
50
|
+
refetch();
|
|
51
|
+
}, [refetch]);
|
|
52
|
+
|
|
53
|
+
const handleThreadPress = (item: any) => {
|
|
54
|
+
|
|
55
|
+
navigation.navigate("ChatScreen", {
|
|
56
|
+
itemDetails: item,
|
|
57
|
+
memberId: memberId,
|
|
58
|
+
teamId: teamId,
|
|
59
|
+
team: team,
|
|
60
|
+
userType: "teams"
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
const renderThreadCard = ({ item }: { item: ChatThread }) => {
|
|
67
|
+
return (
|
|
68
|
+
<TouchableOpacity
|
|
69
|
+
style={styles.threadCard}
|
|
70
|
+
onPress={() => handleThreadPress(item)}
|
|
71
|
+
>
|
|
72
|
+
<View style={styles.threadInfo}>
|
|
73
|
+
<View style={styles.threadHeader}>
|
|
74
|
+
<Text style={styles.threadName} numberOfLines={1}>
|
|
75
|
+
{item?.threadName}
|
|
76
|
+
</Text>
|
|
77
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: theme.spacing.sm }}>
|
|
78
|
+
{item?.isMute && (
|
|
79
|
+
<SVG.mute width={moderateScale(18)} height={moderateScale(18)} />
|
|
80
|
+
)}
|
|
81
|
+
{item?.unreadMessageCount > 0 && (
|
|
82
|
+
<View style={styles.notificationBadge}>
|
|
83
|
+
<Text style={styles.notificationText}>{item?.unreadMessageCount}</Text>
|
|
84
|
+
</View>
|
|
85
|
+
)}
|
|
86
|
+
</View>
|
|
87
|
+
</View>
|
|
88
|
+
|
|
89
|
+
{item?.lastMessageText == "Attachment_Image" ? (
|
|
90
|
+
<Text style={styles.lastMessage} numberOfLines={1}>
|
|
91
|
+
Attachment Image
|
|
92
|
+
</Text>
|
|
93
|
+
) : (
|
|
94
|
+
<Text style={styles.lastMessage} numberOfLines={1}>
|
|
95
|
+
{item?.lastMessageText || 'No messages yet'}
|
|
96
|
+
</Text>
|
|
97
|
+
)}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
{item?.lastMessageSentAt && (
|
|
101
|
+
<View>
|
|
102
|
+
<Text style={styles.lastMessageTime}>{moment(new Date(item?.lastMessageSentAt + "Z")).format('DD/MM/YYYY, hh:mm A')}</Text>
|
|
103
|
+
</View>
|
|
104
|
+
)}
|
|
105
|
+
</View>
|
|
106
|
+
</TouchableOpacity>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const renderEmptyComponent = () => {
|
|
111
|
+
if (isLoading) {
|
|
112
|
+
return (
|
|
113
|
+
<View style={styles.loadingContainer}>
|
|
114
|
+
<Text style={styles.loadingText}>Loading chat threads...</Text>
|
|
115
|
+
</View>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<View style={styles.emptyContainer}>
|
|
121
|
+
<Text style={styles.emptyText}>No chat threads available</Text>
|
|
122
|
+
<Text style={styles.emptySubText}>Start a conversation to see threads here</Text>
|
|
123
|
+
</View>
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const handleScroll = useCallback(() => {
|
|
128
|
+
Keyboard.dismiss();
|
|
129
|
+
}, []);
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<SafeAreaView style={styles.container}>
|
|
133
|
+
<StatusBar backgroundColor={theme.colors.blue} barStyle="light-content" />
|
|
134
|
+
{Platform.OS === "android" && <View style={styles.statusBarBackground} />}
|
|
135
|
+
|
|
136
|
+
<View style={styles.header}>
|
|
137
|
+
<View style={styles.headerTopRow}>
|
|
138
|
+
<TouchableOpacity onPress={() => navigation.goBack()}>
|
|
139
|
+
<SVG.arrowLeft_white
|
|
140
|
+
width={moderateScale(25)}
|
|
141
|
+
height={moderateScale(25)}
|
|
142
|
+
/>
|
|
143
|
+
</TouchableOpacity>
|
|
144
|
+
<View style={{ flexDirection: "row", flex: 1 }}>
|
|
145
|
+
<View style={styles.userConSty}>
|
|
146
|
+
{!!clubImage ? (
|
|
147
|
+
<Image
|
|
148
|
+
source={{ uri: clubImage }}
|
|
149
|
+
style={styles.userDetailsSty}
|
|
150
|
+
resizeMode='cover'
|
|
151
|
+
/>
|
|
152
|
+
) : (
|
|
153
|
+
<View style={styles.placeholderLogoHeader}>
|
|
154
|
+
<SVG.UsersIcon
|
|
155
|
+
width={moderateScale(20)}
|
|
156
|
+
height={moderateScale(20)}
|
|
157
|
+
/>
|
|
158
|
+
</View>
|
|
159
|
+
)}
|
|
160
|
+
</View>
|
|
161
|
+
<View style={styles.clubInfoContainer}>
|
|
162
|
+
<Text style={styles.userNameSty}>
|
|
163
|
+
{team?.teamName || "Unknown Member"}
|
|
164
|
+
</Text>
|
|
165
|
+
<Text style={styles.totalMembersSty}>
|
|
166
|
+
{team?.totalMembers || 0}{" "}
|
|
167
|
+
{(team?.totalMembers || 0) === 1 ? "member" : "members"}
|
|
168
|
+
</Text>
|
|
169
|
+
</View>
|
|
170
|
+
</View>
|
|
171
|
+
</View>
|
|
172
|
+
|
|
173
|
+
</View>
|
|
174
|
+
<View style={styles.contentList}>
|
|
175
|
+
<Text style={styles.sectionHeading}>Chat Threads</Text>
|
|
176
|
+
<FlatList
|
|
177
|
+
data={threads}
|
|
178
|
+
renderItem={renderThreadCard}
|
|
179
|
+
keyExtractor={(item) => item?.id?.toString() || Math.random().toString()}
|
|
180
|
+
style={styles.clubsList}
|
|
181
|
+
showsVerticalScrollIndicator={false}
|
|
182
|
+
contentContainerStyle={styles.flatListContent}
|
|
183
|
+
removeClippedSubviews={false}
|
|
184
|
+
initialNumToRender={10}
|
|
185
|
+
ListEmptyComponent={renderEmptyComponent}
|
|
186
|
+
onScroll={handleScroll}
|
|
187
|
+
scrollEventThrottle={16}
|
|
188
|
+
refreshControl={
|
|
189
|
+
<RefreshControl
|
|
190
|
+
refreshing={isLoading}
|
|
191
|
+
onRefresh={onRefresh}
|
|
192
|
+
colors={[theme.colors.primary]}
|
|
193
|
+
tintColor={theme.colors.primary}
|
|
194
|
+
/>
|
|
195
|
+
}
|
|
196
|
+
/>
|
|
197
|
+
</View>
|
|
198
|
+
</SafeAreaView>
|
|
199
|
+
);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
const styles = StyleSheet.create({
|
|
203
|
+
container: {
|
|
204
|
+
flex: 1,
|
|
205
|
+
backgroundColor: theme.colors.blue,
|
|
206
|
+
},
|
|
207
|
+
statusBarBackground: {
|
|
208
|
+
position: "absolute",
|
|
209
|
+
top: 0,
|
|
210
|
+
left: 0,
|
|
211
|
+
right: 0,
|
|
212
|
+
height: Platform.OS === "ios" ? 44 : 0,
|
|
213
|
+
backgroundColor: theme.colors.blue,
|
|
214
|
+
zIndex: 1000,
|
|
215
|
+
},
|
|
216
|
+
header: {
|
|
217
|
+
backgroundColor: theme.colors.blue,
|
|
218
|
+
paddingTop: Platform.OS === "android" ? theme.spacing.lg : theme.spacing.xs,
|
|
219
|
+
paddingBottom: theme.spacing.xl,
|
|
220
|
+
},
|
|
221
|
+
headerTopRow: {
|
|
222
|
+
flexDirection: "row",
|
|
223
|
+
paddingHorizontal: theme.spacing.lg,
|
|
224
|
+
paddingBottom: theme.spacing.sm,
|
|
225
|
+
},
|
|
226
|
+
clubInfoContainer: {
|
|
227
|
+
marginLeft: moderateScale(4),
|
|
228
|
+
justifyContent: 'center',
|
|
229
|
+
},
|
|
230
|
+
userNameSty: {
|
|
231
|
+
color: theme.colors.white,
|
|
232
|
+
fontFamily: Fonts.outfitRegular,
|
|
233
|
+
fontSize: moderateScale(16),
|
|
234
|
+
},
|
|
235
|
+
totalMembersSty: {
|
|
236
|
+
fontFamily: Fonts.outfitRegular,
|
|
237
|
+
fontSize: moderateScale(11),
|
|
238
|
+
color: theme.colors.appleGreen,
|
|
239
|
+
},
|
|
240
|
+
userDetailsSty: {
|
|
241
|
+
width: moderateScale(36),
|
|
242
|
+
height: moderateScale(36),
|
|
243
|
+
borderRadius: moderateScale(18),
|
|
244
|
+
},
|
|
245
|
+
userConSty: {
|
|
246
|
+
marginLeft: moderateScale(12),
|
|
247
|
+
marginRight: theme.spacing.xs,
|
|
248
|
+
width: moderateScale(36),
|
|
249
|
+
height: moderateScale(36),
|
|
250
|
+
borderRadius: moderateScale(20),
|
|
251
|
+
borderWidth: 1.5,
|
|
252
|
+
borderColor: theme.colors.imageBorder,
|
|
253
|
+
backgroundColor: theme.colors.imageBorder,
|
|
254
|
+
alignItems: "center",
|
|
255
|
+
justifyContent: "center",
|
|
256
|
+
},
|
|
257
|
+
placeholderLogoHeader: {
|
|
258
|
+
width: moderateScale(20),
|
|
259
|
+
height: moderateScale(20),
|
|
260
|
+
borderRadius: moderateScale(10),
|
|
261
|
+
alignItems: "center",
|
|
262
|
+
justifyContent: "center",
|
|
263
|
+
},
|
|
264
|
+
sectionHeading: {
|
|
265
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
266
|
+
fontSize: moderateScale(18),
|
|
267
|
+
color: theme.colors.black,
|
|
268
|
+
marginBottom: theme.spacing.md,
|
|
269
|
+
},
|
|
270
|
+
emptyContainer: {
|
|
271
|
+
alignItems: "center",
|
|
272
|
+
paddingVertical: theme.spacing.xl,
|
|
273
|
+
},
|
|
274
|
+
emptyText: {
|
|
275
|
+
fontFamily: Fonts.outfitRegular,
|
|
276
|
+
fontSize: moderateScale(14),
|
|
277
|
+
color: theme.colors.textSecondary,
|
|
278
|
+
},
|
|
279
|
+
loadingContainer: {
|
|
280
|
+
alignItems: "center",
|
|
281
|
+
paddingVertical: theme.spacing.xl,
|
|
282
|
+
},
|
|
283
|
+
loadingText: {
|
|
284
|
+
fontFamily: Fonts.outfitRegular,
|
|
285
|
+
fontSize: moderateScale(14),
|
|
286
|
+
color: theme.colors.textSecondary,
|
|
287
|
+
marginTop: theme.spacing.md,
|
|
288
|
+
},
|
|
289
|
+
clubsList: {
|
|
290
|
+
flex: 1,
|
|
291
|
+
},
|
|
292
|
+
flatListContent: {
|
|
293
|
+
paddingBottom: theme.spacing.xl,
|
|
294
|
+
},
|
|
295
|
+
contentList: {
|
|
296
|
+
flex: 1,
|
|
297
|
+
backgroundColor: theme.colors.background,
|
|
298
|
+
borderTopLeftRadius: moderateScale(30),
|
|
299
|
+
borderTopRightRadius: moderateScale(30),
|
|
300
|
+
marginTop: -theme.spacing.xl,
|
|
301
|
+
paddingHorizontal: theme.spacing.lg,
|
|
302
|
+
paddingTop: theme.spacing.lg,
|
|
303
|
+
},
|
|
304
|
+
threadCard: {
|
|
305
|
+
flexDirection: 'row',
|
|
306
|
+
padding: theme.spacing.md,
|
|
307
|
+
backgroundColor: theme.colors.lightLavenderGray,
|
|
308
|
+
marginBottom: theme.spacing.sm,
|
|
309
|
+
borderRadius: theme.borderRadius.xl,
|
|
310
|
+
|
|
311
|
+
},
|
|
312
|
+
threadInfo: {
|
|
313
|
+
flex: 1,
|
|
314
|
+
justifyContent: 'center',
|
|
315
|
+
},
|
|
316
|
+
threadHeader: {
|
|
317
|
+
flexDirection: 'row',
|
|
318
|
+
justifyContent: 'space-between',
|
|
319
|
+
alignItems: 'center',
|
|
320
|
+
marginBottom: theme.spacing.xs,
|
|
321
|
+
},
|
|
322
|
+
threadName: {
|
|
323
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
324
|
+
fontSize: moderateScale(16),
|
|
325
|
+
color: theme.colors.black,
|
|
326
|
+
flex: 1,
|
|
327
|
+
},
|
|
328
|
+
lastMessage: {
|
|
329
|
+
fontFamily: Fonts.outfitRegular,
|
|
330
|
+
fontSize: moderateScale(14),
|
|
331
|
+
color: theme.colors.textSecondary,
|
|
332
|
+
marginBottom: theme.spacing.xs,
|
|
333
|
+
},
|
|
334
|
+
lastMessageTime: {
|
|
335
|
+
fontFamily: Fonts.outfitRegular,
|
|
336
|
+
fontSize: moderateScale(12),
|
|
337
|
+
color: theme.colors.black,
|
|
338
|
+
alignSelf: 'flex-end',
|
|
339
|
+
},
|
|
340
|
+
emptySubText: {
|
|
341
|
+
fontFamily: Fonts.outfitRegular,
|
|
342
|
+
fontSize: moderateScale(12),
|
|
343
|
+
color: theme.colors.textSecondary,
|
|
344
|
+
marginTop: theme.spacing.xs,
|
|
345
|
+
textAlign: 'center',
|
|
346
|
+
},
|
|
347
|
+
notificationBadge: {
|
|
348
|
+
backgroundColor: theme.colors.error,
|
|
349
|
+
borderRadius: moderateScale(10),
|
|
350
|
+
minWidth: moderateScale(25),
|
|
351
|
+
height: moderateScale(20),
|
|
352
|
+
justifyContent: 'center',
|
|
353
|
+
alignItems: 'center'
|
|
354
|
+
},
|
|
355
|
+
notificationText: {
|
|
356
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
357
|
+
fontSize: moderateScale(12),
|
|
358
|
+
color: theme.colors.white,
|
|
359
|
+
},
|
|
360
|
+
});
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
TouchableOpacity,
|
|
7
|
+
KeyboardAvoidingView,
|
|
8
|
+
Platform,
|
|
9
|
+
ScrollView,
|
|
10
|
+
TextInput,
|
|
11
|
+
Alert,
|
|
12
|
+
StatusBar
|
|
13
|
+
} from "react-native";
|
|
14
|
+
import { theme } from "../../constants";
|
|
15
|
+
import { moderateScale } from "../../utils/scaling";
|
|
16
|
+
import { Fonts } from "../../constants/Fonts";
|
|
17
|
+
|
|
18
|
+
interface ReportMessageScreenProps {
|
|
19
|
+
navigation: any;
|
|
20
|
+
route: {
|
|
21
|
+
params: {
|
|
22
|
+
message: any;
|
|
23
|
+
memberId: string;
|
|
24
|
+
onReportSubmit?: (reason: string, message: any) => void;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const ReportMessageScreen: React.FC<ReportMessageScreenProps> = ({ navigation, route }) => {
|
|
30
|
+
const { message, memberId, onReportSubmit } = route.params;
|
|
31
|
+
const [reportReason, setReportReason] = useState('');
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
// Set navigation options
|
|
35
|
+
navigation.setOptions({
|
|
36
|
+
presentation: 'transparentModal',
|
|
37
|
+
headerShown: false,
|
|
38
|
+
});
|
|
39
|
+
}, [navigation]);
|
|
40
|
+
|
|
41
|
+
const handleReportSubmit = () => {
|
|
42
|
+
if (!reportReason.trim()) {
|
|
43
|
+
Alert.alert("Error", "Please provide a reason for reporting this message.");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Call the callback function if provided
|
|
48
|
+
if (onReportSubmit) {
|
|
49
|
+
onReportSubmit(reportReason, message);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Log the report
|
|
53
|
+
console.log("Reporting message:", {
|
|
54
|
+
messageId: message?._id,
|
|
55
|
+
reason: reportReason,
|
|
56
|
+
reportedBy: memberId
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
Alert.alert(
|
|
60
|
+
"Report Submitted",
|
|
61
|
+
"Your report has been submitted successfully. We will review it shortly.",
|
|
62
|
+
[
|
|
63
|
+
{
|
|
64
|
+
text: "OK",
|
|
65
|
+
onPress: () => navigation.goBack()
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const handleClose = () => {
|
|
72
|
+
navigation.goBack();
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<View style={styles.container}>
|
|
77
|
+
<StatusBar barStyle="dark-content" backgroundColor="transparent" translucent />
|
|
78
|
+
<KeyboardAvoidingView
|
|
79
|
+
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
|
80
|
+
style={styles.keyboardAvoidingView}
|
|
81
|
+
>
|
|
82
|
+
<TouchableOpacity
|
|
83
|
+
style={styles.overlay}
|
|
84
|
+
activeOpacity={1}
|
|
85
|
+
onPress={handleClose}
|
|
86
|
+
>
|
|
87
|
+
<TouchableOpacity
|
|
88
|
+
activeOpacity={1}
|
|
89
|
+
onPress={(e) => e.stopPropagation()}
|
|
90
|
+
style={styles.modalContent}
|
|
91
|
+
>
|
|
92
|
+
<View style={styles.modalHeader}>
|
|
93
|
+
<Text style={styles.modalTitle}>Report Message</Text>
|
|
94
|
+
<TouchableOpacity onPress={handleClose}>
|
|
95
|
+
<Text style={styles.closeButton}>✕</Text>
|
|
96
|
+
</TouchableOpacity>
|
|
97
|
+
</View>
|
|
98
|
+
|
|
99
|
+
<ScrollView
|
|
100
|
+
style={styles.modalBody}
|
|
101
|
+
showsVerticalScrollIndicator={false}
|
|
102
|
+
keyboardShouldPersistTaps="handled"
|
|
103
|
+
>
|
|
104
|
+
<Text style={styles.modalSubtitle}>
|
|
105
|
+
Why are you reporting this message?
|
|
106
|
+
</Text>
|
|
107
|
+
|
|
108
|
+
<TextInput
|
|
109
|
+
style={styles.reportInput}
|
|
110
|
+
placeholder="Please describe the issue..."
|
|
111
|
+
placeholderTextColor="#999"
|
|
112
|
+
multiline
|
|
113
|
+
numberOfLines={6}
|
|
114
|
+
value={reportReason}
|
|
115
|
+
onChangeText={setReportReason}
|
|
116
|
+
textAlignVertical="top"
|
|
117
|
+
/>
|
|
118
|
+
</ScrollView>
|
|
119
|
+
|
|
120
|
+
<View style={styles.modalFooter}>
|
|
121
|
+
<TouchableOpacity
|
|
122
|
+
style={styles.cancelButton}
|
|
123
|
+
onPress={handleClose}
|
|
124
|
+
>
|
|
125
|
+
<Text style={styles.cancelButtonText}>Cancel</Text>
|
|
126
|
+
</TouchableOpacity>
|
|
127
|
+
<TouchableOpacity
|
|
128
|
+
style={styles.submitButton}
|
|
129
|
+
onPress={handleReportSubmit}
|
|
130
|
+
>
|
|
131
|
+
<Text style={styles.submitButtonText}>Submit Report</Text>
|
|
132
|
+
</TouchableOpacity>
|
|
133
|
+
</View>
|
|
134
|
+
</TouchableOpacity>
|
|
135
|
+
</TouchableOpacity>
|
|
136
|
+
</KeyboardAvoidingView>
|
|
137
|
+
</View>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const styles = StyleSheet.create({
|
|
142
|
+
container: {
|
|
143
|
+
flex: 1,
|
|
144
|
+
backgroundColor: 'transparent',
|
|
145
|
+
},
|
|
146
|
+
keyboardAvoidingView: {
|
|
147
|
+
flex: 1,
|
|
148
|
+
},
|
|
149
|
+
overlay: {
|
|
150
|
+
flex: 1,
|
|
151
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
152
|
+
justifyContent: 'center',
|
|
153
|
+
alignItems: 'center',
|
|
154
|
+
},
|
|
155
|
+
modalContent: {
|
|
156
|
+
backgroundColor: theme.colors.white,
|
|
157
|
+
borderRadius: moderateScale(16),
|
|
158
|
+
width: '90%',
|
|
159
|
+
maxHeight: '80%',
|
|
160
|
+
overflow: 'hidden',
|
|
161
|
+
borderWidth: 1,
|
|
162
|
+
},
|
|
163
|
+
modalHeader: {
|
|
164
|
+
flexDirection: 'row',
|
|
165
|
+
justifyContent: 'space-between',
|
|
166
|
+
alignItems: 'center',
|
|
167
|
+
padding: moderateScale(16),
|
|
168
|
+
borderBottomWidth: 1,
|
|
169
|
+
borderBottomColor: theme.colors.border,
|
|
170
|
+
},
|
|
171
|
+
modalTitle: {
|
|
172
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
173
|
+
fontSize: moderateScale(18),
|
|
174
|
+
color: theme.colors.black,
|
|
175
|
+
},
|
|
176
|
+
closeButton: {
|
|
177
|
+
fontSize: moderateScale(24),
|
|
178
|
+
color: theme.colors.textSecondary,
|
|
179
|
+
fontWeight: '300',
|
|
180
|
+
},
|
|
181
|
+
modalBody: {
|
|
182
|
+
padding: moderateScale(16),
|
|
183
|
+
flexGrow: 1,
|
|
184
|
+
},
|
|
185
|
+
modalSubtitle: {
|
|
186
|
+
fontFamily: Fonts.outfitRegular,
|
|
187
|
+
fontSize: moderateScale(14),
|
|
188
|
+
color: theme.colors.textSecondary,
|
|
189
|
+
marginBottom: moderateScale(12),
|
|
190
|
+
},
|
|
191
|
+
reportInput: {
|
|
192
|
+
fontFamily: Fonts.outfitRegular,
|
|
193
|
+
fontSize: moderateScale(14),
|
|
194
|
+
color: theme.colors.black,
|
|
195
|
+
backgroundColor: theme.colors.lightLavenderGray,
|
|
196
|
+
borderRadius: moderateScale(8),
|
|
197
|
+
padding: moderateScale(12),
|
|
198
|
+
minHeight: moderateScale(120),
|
|
199
|
+
borderWidth: 1,
|
|
200
|
+
borderColor: theme.colors.border,
|
|
201
|
+
},
|
|
202
|
+
modalFooter: {
|
|
203
|
+
flexDirection: 'row',
|
|
204
|
+
borderTopWidth: 1,
|
|
205
|
+
borderTopColor: theme.colors.border,
|
|
206
|
+
padding: moderateScale(16),
|
|
207
|
+
},
|
|
208
|
+
cancelButton: {
|
|
209
|
+
flex: 1,
|
|
210
|
+
paddingVertical: moderateScale(12),
|
|
211
|
+
alignItems: 'center',
|
|
212
|
+
justifyContent: 'center',
|
|
213
|
+
marginRight: moderateScale(8),
|
|
214
|
+
borderRadius: moderateScale(8),
|
|
215
|
+
borderWidth: 1,
|
|
216
|
+
borderColor: theme.colors.border,
|
|
217
|
+
},
|
|
218
|
+
cancelButtonText: {
|
|
219
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
220
|
+
fontSize: moderateScale(16),
|
|
221
|
+
color: theme.colors.black,
|
|
222
|
+
},
|
|
223
|
+
submitButton: {
|
|
224
|
+
flex: 1,
|
|
225
|
+
paddingVertical: moderateScale(12),
|
|
226
|
+
alignItems: 'center',
|
|
227
|
+
justifyContent: 'center',
|
|
228
|
+
backgroundColor: theme.colors.blue,
|
|
229
|
+
borderRadius: moderateScale(8),
|
|
230
|
+
marginLeft: moderateScale(8),
|
|
231
|
+
},
|
|
232
|
+
submitButtonText: {
|
|
233
|
+
fontFamily: Fonts.outfitSemiBold,
|
|
234
|
+
fontSize: moderateScale(16),
|
|
235
|
+
color: theme.colors.white,
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
|