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.
Files changed (266) hide show
  1. package/lib/createApp.js +7 -2
  2. package/package.json +1 -1
  3. package/template/App.tsx +118 -0
  4. package/template/ReactotronConfig.js +5 -0
  5. package/template/android/app/build.gradle +184 -0
  6. package/template/android/app/debug.keystore +0 -0
  7. package/template/android/app/google-services.json +29 -0
  8. package/template/android/app/proguard-rules.pro +14 -0
  9. package/template/android/app/src/debug/AndroidManifest.xml +7 -0
  10. package/template/android/app/src/debugOptimized/AndroidManifest.xml +7 -0
  11. package/template/android/app/src/main/AndroidManifest.xml +28 -0
  12. package/template/android/app/src/main/assets/fonts/Outfit-Bold.ttf +0 -0
  13. package/template/android/app/src/main/assets/fonts/Outfit-Light.ttf +0 -0
  14. package/template/android/app/src/main/assets/fonts/Outfit-Medium.ttf +0 -0
  15. package/template/android/app/src/main/assets/fonts/Outfit-Regular.ttf +0 -0
  16. package/template/android/app/src/main/assets/fonts/Outfit-SemiBold.ttf +0 -0
  17. package/template/android/app/src/main/java/com/club/yakka/MainActivity.kt +61 -0
  18. package/template/android/app/src/main/java/com/club/yakka/MainApplication.kt +60 -0
  19. package/template/android/app/src/main/res/drawable/ic_launcher_background.xml +6 -0
  20. package/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  21. package/template/android/app/src/main/res/drawable-hdpi/splashscreen_logo.png +0 -0
  22. package/template/android/app/src/main/res/drawable-mdpi/splashscreen_logo.png +0 -0
  23. package/template/android/app/src/main/res/drawable-xhdpi/splashscreen_logo.png +0 -0
  24. package/template/android/app/src/main/res/drawable-xxhdpi/splashscreen_logo.png +0 -0
  25. package/template/android/app/src/main/res/drawable-xxxhdpi/splashscreen_logo.png +0 -0
  26. package/template/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  27. package/template/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  28. package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
  29. package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp +0 -0
  30. package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
  31. package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
  32. package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp +0 -0
  33. package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
  34. package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
  35. package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp +0 -0
  36. package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
  37. package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
  38. package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp +0 -0
  39. package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
  40. package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
  41. package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp +0 -0
  42. package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
  43. package/template/android/app/src/main/res/values/colors.xml +6 -0
  44. package/template/android/app/src/main/res/values/strings.xml +5 -0
  45. package/template/android/app/src/main/res/values/styles.xml +14 -0
  46. package/template/android/app/src/main/res/values-night/colors.xml +1 -0
  47. package/template/android/build.gradle +33 -0
  48. package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  49. package/template/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  50. package/template/android/gradle.properties +65 -0
  51. package/template/android/gradlew +251 -0
  52. package/template/android/gradlew.bat +94 -0
  53. package/template/android/settings.gradle +39 -0
  54. package/template/app.json +69 -0
  55. package/template/assets/adaptive-icon.png +0 -0
  56. package/template/assets/adaptive-icon1.png +0 -0
  57. package/template/assets/app_icon.png +0 -0
  58. package/template/assets/favicon.png +0 -0
  59. package/template/assets/icon.png +0 -0
  60. package/template/assets/splash-icon.png +0 -0
  61. package/template/babel-plugin-disable-font-scaling.js +41 -0
  62. package/template/babel.config.js +28 -0
  63. package/template/firebase.json +5 -0
  64. package/template/index.ts +24 -0
  65. package/template/ios/.xcode.env +11 -0
  66. package/template/ios/ClubYakka/AppDelegate.swift +74 -0
  67. package/template/ios/ClubYakka/ClubYakka-Bridging-Header.h +3 -0
  68. package/template/ios/ClubYakka/ClubYakka.entitlements +8 -0
  69. package/template/ios/ClubYakka/GoogleService-Info.plist +30 -0
  70. package/template/ios/ClubYakka/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png +0 -0
  71. package/template/ios/ClubYakka/Images.xcassets/AppIcon.appiconset/Contents.json +14 -0
  72. package/template/ios/ClubYakka/Images.xcassets/Contents.json +6 -0
  73. package/template/ios/ClubYakka/Images.xcassets/SplashScreenBackground.colorset/Contents.json +20 -0
  74. package/template/ios/ClubYakka/Images.xcassets/SplashScreenLegacy.imageset/Contents.json +23 -0
  75. package/template/ios/ClubYakka/Images.xcassets/SplashScreenLegacy.imageset/image.png +0 -0
  76. package/template/ios/ClubYakka/Images.xcassets/SplashScreenLegacy.imageset/image@2x.png +0 -0
  77. package/template/ios/ClubYakka/Images.xcassets/SplashScreenLegacy.imageset/image@3x.png +0 -0
  78. package/template/ios/ClubYakka/Info.plist +101 -0
  79. package/template/ios/ClubYakka/PrivacyInfo.xcprivacy +50 -0
  80. package/template/ios/ClubYakka/SplashScreen.storyboard +48 -0
  81. package/template/ios/ClubYakka/Supporting/Expo.plist +12 -0
  82. package/template/ios/ClubYakka.xcodeproj/project.pbxproj +669 -0
  83. package/template/ios/ClubYakka.xcodeproj/xcshareddata/xcschemes/ClubYakka.xcscheme +88 -0
  84. package/template/ios/ClubYakka.xcworkspace/contents.xcworkspacedata +10 -0
  85. package/template/ios/ClubYakka.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +5 -0
  86. package/template/ios/Podfile +84 -0
  87. package/template/ios/Podfile.lock +2698 -0
  88. package/template/ios/Podfile.properties.json +8 -0
  89. package/template/metro.config.js +17 -0
  90. package/template/package.json +70 -0
  91. package/template/patches/react-native-background-upload+6.6.0.patch +704 -0
  92. package/template/react-native.config.js +7 -0
  93. package/template/src/assets/fonts/Outfit-Bold.ttf +0 -0
  94. package/template/src/assets/fonts/Outfit-Light.ttf +0 -0
  95. package/template/src/assets/fonts/Outfit-Medium.ttf +0 -0
  96. package/template/src/assets/fonts/Outfit-Regular.ttf +0 -0
  97. package/template/src/assets/fonts/Outfit-SemiBold.ttf +0 -0
  98. package/template/src/assets/icons/BG.svg +33 -0
  99. package/template/src/assets/icons/Ic_Users.svg +6 -0
  100. package/template/src/assets/icons/arrow-left-white.svg +4 -0
  101. package/template/src/assets/icons/arrow-left.svg +4 -0
  102. package/template/src/assets/icons/bell.svg +4 -0
  103. package/template/src/assets/icons/bottomSheetIcone.svg +3 -0
  104. package/template/src/assets/icons/call.svg +4 -0
  105. package/template/src/assets/icons/camera.svg +0 -0
  106. package/template/src/assets/icons/chatAppleGreenBG.svg +22 -0
  107. package/template/src/assets/icons/check.svg +4 -0
  108. package/template/src/assets/icons/check_Radio.svg +4 -0
  109. package/template/src/assets/icons/chevron-right.svg +3 -0
  110. package/template/src/assets/icons/clubDefauldImage.png +0 -0
  111. package/template/src/assets/icons/curvBackgroundView.svg +3 -0
  112. package/template/src/assets/icons/defaultClub.png +0 -0
  113. package/template/src/assets/icons/email.svg +3 -0
  114. package/template/src/assets/icons/emptyUser.svg +5 -0
  115. package/template/src/assets/icons/eye-Hide.svg +8 -0
  116. package/template/src/assets/icons/eye.svg +4 -0
  117. package/template/src/assets/icons/gallery.svg +4 -0
  118. package/template/src/assets/icons/home.svg +4 -0
  119. package/template/src/assets/icons/ic_Calendar.svg +14 -0
  120. package/template/src/assets/icons/ic_Calendar_blue.svg +12 -0
  121. package/template/src/assets/icons/ic_Calendar_white.svg +12 -0
  122. package/template/src/assets/icons/ic_Chat.svg +14 -0
  123. package/template/src/assets/icons/ic_ChatAppleGreen.svg +21 -0
  124. package/template/src/assets/icons/ic_ChatAppleWhite.svg +21 -0
  125. package/template/src/assets/icons/ic_Download.svg +6 -0
  126. package/template/src/assets/icons/ic_Events.svg +6 -0
  127. package/template/src/assets/icons/ic_HeadCoachIcon.svg +3 -0
  128. package/template/src/assets/icons/ic_Membership.svg +10 -0
  129. package/template/src/assets/icons/ic_Notification.svg +6 -0
  130. package/template/src/assets/icons/ic_Raffles.svg +14 -0
  131. package/template/src/assets/icons/ic_Referral_Members.svg +12 -0
  132. package/template/src/assets/icons/ic_Shop.svg +13 -0
  133. package/template/src/assets/icons/ic_Teams.svg +8 -0
  134. package/template/src/assets/icons/ic_Volunteer.svg +9 -0
  135. package/template/src/assets/icons/ic_add.svg +3 -0
  136. package/template/src/assets/icons/ic_addCircle.svg +5 -0
  137. package/template/src/assets/icons/ic_chatSend.svg +4 -0
  138. package/template/src/assets/icons/ic_chat_blue_bg.svg +22 -0
  139. package/template/src/assets/icons/ic_clock_blue.svg +4 -0
  140. package/template/src/assets/icons/ic_delete.svg +8 -0
  141. package/template/src/assets/icons/ic_more.svg +5 -0
  142. package/template/src/assets/icons/ic_mute.svg +10 -0
  143. package/template/src/assets/icons/ic_pdf.svg +3 -0
  144. package/template/src/assets/icons/ic_pending_AppleGreen.svg +11 -0
  145. package/template/src/assets/icons/ic_right_appleGreen.svg +11 -0
  146. package/template/src/assets/icons/ic_unread_chat_blue_bg.svg +23 -0
  147. package/template/src/assets/icons/ic_volunteer_Member.svg +8 -0
  148. package/template/src/assets/icons/index.ts +144 -0
  149. package/template/src/assets/icons/location-blue.svg +4 -0
  150. package/template/src/assets/icons/location-white.svg +4 -0
  151. package/template/src/assets/icons/location.svg +4 -0
  152. package/template/src/assets/icons/lock.svg +5 -0
  153. package/template/src/assets/icons/log-out.svg +5 -0
  154. package/template/src/assets/icons/login_logo.svg +9 -0
  155. package/template/src/assets/icons/mail.svg +4 -0
  156. package/template/src/assets/icons/or_saprater.svg +5 -0
  157. package/template/src/assets/icons/password.svg +4 -0
  158. package/template/src/assets/icons/profile-appleGreen.svg +6 -0
  159. package/template/src/assets/icons/search.svg +3 -0
  160. package/template/src/assets/icons/settings.svg +4 -0
  161. package/template/src/assets/icons/success.svg +4 -0
  162. package/template/src/assets/icons/unCheck_Radio.svg +3 -0
  163. package/template/src/assets/icons/uncheck.svg +3 -0
  164. package/template/src/assets/icons/upload_Image.svg +6 -0
  165. package/template/src/assets/icons/upload_Image_Member.svg +6 -0
  166. package/template/src/assets/icons/user.svg +4 -0
  167. package/template/src/assets/icons/wifi.svg +1 -0
  168. package/template/src/assets/images/Splash.png +0 -0
  169. package/template/src/assets/images/SplashLogo.png +0 -0
  170. package/template/src/assets/images/background.png +0 -0
  171. package/template/src/assets/images/clubDefauldImage.png +0 -0
  172. package/template/src/assets/images/index.tsx +9 -0
  173. package/template/src/assets/index.ts +1 -0
  174. package/template/src/components/common/AddMemberModal.tsx +543 -0
  175. package/template/src/components/common/AppLoader.tsx +91 -0
  176. package/template/src/components/common/Button.tsx +173 -0
  177. package/template/src/components/common/ClubCard.tsx +248 -0
  178. package/template/src/components/common/Icon.tsx +93 -0
  179. package/template/src/components/common/IconAlt.tsx +65 -0
  180. package/template/src/components/common/IconButton.tsx +92 -0
  181. package/template/src/components/common/ImagePicker.tsx +451 -0
  182. package/template/src/components/common/LoadingSpinner.tsx +30 -0
  183. package/template/src/components/common/OTPInput.tsx +128 -0
  184. package/template/src/components/common/ReminderCalendar.tsx +129 -0
  185. package/template/src/components/common/ReminderCardItem.tsx +91 -0
  186. package/template/src/components/common/SafeAreaWrapper.tsx +27 -0
  187. package/template/src/components/common/SetReminderModal.tsx +308 -0
  188. package/template/src/components/common/SlowInternet.js +57 -0
  189. package/template/src/components/common/TeamCard.tsx +297 -0
  190. package/template/src/components/common/TextInput.tsx +227 -0
  191. package/template/src/components/common/ToastConfig.tsx +103 -0
  192. package/template/src/components/common/ToastManager.ts +86 -0
  193. package/template/src/components/common/UploadProgressModal.tsx +284 -0
  194. package/template/src/components/common/WrapperContainer.tsx +39 -0
  195. package/template/src/components/common/index.ts +19 -0
  196. package/template/src/constants/Constants.tsx +7 -0
  197. package/template/src/constants/Fonts.tsx +30 -0
  198. package/template/src/constants/index.ts +45 -0
  199. package/template/src/constants/strings.ts +211 -0
  200. package/template/src/constants/theme.ts +72 -0
  201. package/template/src/contexts/AuthContext.tsx +268 -0
  202. package/template/src/contexts/index.ts +2 -0
  203. package/template/src/hooks/index.ts +3 -0
  204. package/template/src/hooks/useImageUpload.ts +199 -0
  205. package/template/src/index.ts +8 -0
  206. package/template/src/navigation/AuthStack.tsx +67 -0
  207. package/template/src/navigation/MainStack.tsx +183 -0
  208. package/template/src/navigation/MiddleStack.tsx +35 -0
  209. package/template/src/navigation/RootNavigator.tsx +101 -0
  210. package/template/src/navigation/index.ts +5 -0
  211. package/template/src/navigation/navigationRef.ts +5 -0
  212. package/template/src/providers/QueryProvider.tsx +30 -0
  213. package/template/src/screens/DetailsScreen.tsx +271 -0
  214. package/template/src/screens/HomeScreen.tsx +736 -0
  215. package/template/src/screens/ProfileScreen.tsx +202 -0
  216. package/template/src/screens/SettingsScreen.tsx +253 -0
  217. package/template/src/screens/SportHubScreen.tsx +280 -0
  218. package/template/src/screens/auth/AddMamber.tsx +428 -0
  219. package/template/src/screens/auth/ForgotPasswordScreen.tsx +176 -0
  220. package/template/src/screens/auth/LoginScreen.tsx +286 -0
  221. package/template/src/screens/auth/OTPVerifyScreen.tsx +359 -0
  222. package/template/src/screens/auth/RegisterScreen.tsx +430 -0
  223. package/template/src/screens/auth/SuccessScreen.tsx +201 -0
  224. package/template/src/screens/auth/WalcomeScreen.tsx +274 -0
  225. package/template/src/screens/auth/index.ts +8 -0
  226. package/template/src/screens/chat/ChatScreen.tsx +1819 -0
  227. package/template/src/screens/chat/ChatThreadsScreen.tsx +360 -0
  228. package/template/src/screens/chat/ReportMessageScreen.tsx +238 -0
  229. package/template/src/screens/clubs/Announcements.tsx +426 -0
  230. package/template/src/screens/clubs/BuyRaffleTicketsScreen.tsx +568 -0
  231. package/template/src/screens/clubs/ClubDeteils.tsx +497 -0
  232. package/template/src/screens/clubs/JoinClub.tsx +841 -0
  233. package/template/src/screens/events/EventScreen.tsx +460 -0
  234. package/template/src/screens/index.ts +42 -0
  235. package/template/src/screens/raffles/MyReferralMembersScreen.tsx +758 -0
  236. package/template/src/screens/raffles/RaffleDetailsScreen.tsx +762 -0
  237. package/template/src/screens/raffles/RafflesScreen.tsx +495 -0
  238. package/template/src/screens/raffles/SetRaffleReminderScreen.tsx +390 -0
  239. package/template/src/screens/teams/JoinTeamScreen.tsx +464 -0
  240. package/template/src/screens/teams/MyTeamDetailsScreen.tsx +979 -0
  241. package/template/src/screens/teams/MyTeamScreen.tsx +568 -0
  242. package/template/src/screens/teams/PendingRequestsScreen.tsx +426 -0
  243. package/template/src/screens/volunteerOpportunities/SetReminderScreen.tsx +631 -0
  244. package/template/src/screens/volunteerOpportunities/VolunteerOpportunitiesDetailsScreen.tsx +1049 -0
  245. package/template/src/screens/volunteerOpportunities/VolunteerOpportunitiesScreen.tsx +608 -0
  246. package/template/src/services/api.ts +167 -0
  247. package/template/src/services/authService.ts +422 -0
  248. package/template/src/services/index.ts +5 -0
  249. package/template/src/services/mainServices.ts +1963 -0
  250. package/template/src/stores/authStore.ts +159 -0
  251. package/template/src/stores/index.ts +2 -0
  252. package/template/src/types/index.ts +85 -0
  253. package/template/src/types/navigation.ts +206 -0
  254. package/template/src/utils/AzureUploaderService.ts +371 -0
  255. package/template/src/utils/ClubSearchManager.ts +222 -0
  256. package/template/src/utils/NotificationManager.ts +503 -0
  257. package/template/src/utils/UploadDebugUtil.ts +107 -0
  258. package/template/src/utils/imagePicker.ts +321 -0
  259. package/template/src/utils/index.ts +111 -0
  260. package/template/src/utils/permissions.ts +277 -0
  261. package/template/src/utils/scaling.ts +14 -0
  262. package/template/src/utils/storage.ts +247 -0
  263. package/template/src/utils/usePermissions.ts +275 -0
  264. package/template/src/utils/validation.ts +340 -0
  265. package/template/tsconfig.json +50 -0
  266. package/template/types/svg.d.ts +6 -0
@@ -0,0 +1,129 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ StyleSheet,
6
+ TouchableOpacity,
7
+ Keyboard,
8
+ Platform,
9
+ } from 'react-native';
10
+ import { theme } from '../../constants';
11
+ import { moderateScale } from '../../utils/scaling';
12
+ import { Fonts } from '../../constants/Fonts';
13
+ import DatePicker from 'react-native-date-picker';
14
+
15
+ interface ReminderCalendarProps {
16
+ onSelectDateTime: (date: Date) => void;
17
+ selectedDateTime?: Date;
18
+ }
19
+
20
+ export const ReminderCalendar: React.FC<ReminderCalendarProps> = ({
21
+ onSelectDateTime,
22
+ selectedDateTime,
23
+ }) => {
24
+ // Initialize with minimum 30 minutes from now
25
+ const getInitialDate = () => {
26
+ const now = new Date();
27
+ // Add 30 minutes to current time
28
+ now.setMinutes(now.getMinutes() + 30);
29
+
30
+ // Round to nearest 30-minute slot
31
+ const minutes = now.getMinutes();
32
+ if (minutes < 30) {
33
+ now.setMinutes(30);
34
+ } else if (minutes > 30) {
35
+ now.setMinutes(60);
36
+ }
37
+
38
+ now.setSeconds(0);
39
+ now.setMilliseconds(0);
40
+ return now;
41
+ };
42
+
43
+ // Get minimum date (current time, not 30 minutes ahead)
44
+ // We'll handle the 30-minute buffer in the validation
45
+ const getMinimumDate = () => {
46
+ const now = new Date();
47
+ now.setSeconds(0);
48
+ now.setMilliseconds(0);
49
+ return now;
50
+ };
51
+
52
+ const [date, setDate] = useState(selectedDateTime || getInitialDate());
53
+ const [minimumDate, setMinimumDate] = useState(getMinimumDate());
54
+ const [isFutureTime, setIsFutureTime] = useState(true);
55
+
56
+ // Check if selected time is at least 30 minutes in the future
57
+ useEffect(() => {
58
+ const checkIfFutureTime = () => {
59
+ const now = new Date();
60
+ const minimumAllowedTime = new Date(now.getTime() + 30 * 60 * 1000); // 30 minutes from now
61
+ setIsFutureTime(date >= minimumAllowedTime);
62
+
63
+ // Update minimum date
64
+ setMinimumDate(getMinimumDate());
65
+ };
66
+
67
+ checkIfFutureTime();
68
+ // Check every second to update button state and minimum date
69
+ const interval = setInterval(checkIfFutureTime, 1000);
70
+
71
+ return () => clearInterval(interval);
72
+ }, [date]);
73
+
74
+ const handleDateChange = (newDate: Date) => {
75
+ setDate(newDate);
76
+ onSelectDateTime(newDate);
77
+ };
78
+
79
+ return (
80
+ <View style={styles.container}>
81
+
82
+ {/* Date Time Picker */}
83
+ <View style={styles.pickerContainer}>
84
+ <DatePicker
85
+ mode='datetime'
86
+ date={date}
87
+ minimumDate={minimumDate}
88
+ minuteInterval={30}
89
+ onDateChange={handleDateChange}
90
+ />
91
+ </View>
92
+
93
+ {/* Validation Info */}
94
+ {!isFutureTime && (
95
+ <Text style={styles.validationText}>
96
+ Reminder must be at least 60 minutes in the future
97
+ </Text>
98
+ )}
99
+ </View>
100
+ );
101
+ };
102
+
103
+ const styles = StyleSheet.create({
104
+ container: {
105
+ paddingHorizontal: theme.spacing.lg,
106
+ },
107
+ title: {
108
+ fontFamily: Fonts.outfitSemiBold,
109
+ fontSize: theme.typography.fontSize.sm,
110
+ color: theme.colors.black,
111
+ marginBottom: theme.spacing.md,
112
+ },
113
+ pickerContainer: {
114
+ alignItems: 'center',
115
+ borderColor: theme.colors.border,
116
+ borderRadius: moderateScale(12),
117
+ paddingHorizontal: theme.spacing.md,
118
+ paddingVertical: theme.spacing.md,
119
+ backgroundColor: theme.colors.background,
120
+ minHeight: moderateScale(250),
121
+ },
122
+ validationText: {
123
+ fontFamily: Fonts.outfitRegular,
124
+ fontSize: theme.typography.fontSize.xs,
125
+ color: theme.colors.cancelButton,
126
+ marginTop: theme.spacing.md,
127
+ textAlign: 'center',
128
+ },
129
+ });
@@ -0,0 +1,91 @@
1
+ import React from 'react';
2
+ import { View, Text, StyleSheet, TouchableOpacity, Alert } from 'react-native';
3
+ import { theme } from '../../constants';
4
+ import { moderateScale } from '../../utils/scaling';
5
+ import { Fonts } from '../../constants/Fonts';
6
+ import SVG from '../../assets/icons';
7
+ import moment from 'moment';
8
+
9
+ interface ReminderData {
10
+ reminderDateTime: string;
11
+ reminderId?: string | number;
12
+ }
13
+
14
+ interface ReminderCardItemProps {
15
+ reminderData: ReminderData;
16
+ onDelete?: () => void;
17
+ }
18
+
19
+ export const ReminderCardItem: React.FC<ReminderCardItemProps> = ({
20
+ reminderData,
21
+ onDelete,
22
+ }) => {
23
+
24
+
25
+
26
+ const handleDelete = () => {
27
+ if (onDelete) {
28
+ Alert.alert(
29
+ 'Delete Reminder',
30
+ 'Are you sure you want to delete this reminder?',
31
+ [
32
+ {
33
+ text: 'Cancel',
34
+ onPress: () => { },
35
+ style: 'cancel',
36
+ },
37
+ {
38
+ text: 'Delete',
39
+ onPress: onDelete,
40
+ style: 'destructive',
41
+ },
42
+ ],
43
+ );
44
+ }
45
+ };
46
+
47
+ return (
48
+ <View style={styles.reminderCard}>
49
+
50
+ <View style={styles.reminderContent}>
51
+
52
+ <Text style={styles.reminderDateTime}>
53
+ {moment(reminderData.reminderDateTime).format('DD MMM YYYY, h:mm A')}
54
+ </Text>
55
+ </View>
56
+
57
+ {onDelete && (
58
+ <TouchableOpacity
59
+ onPress={handleDelete}
60
+ hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
61
+ >
62
+ <SVG.Delete
63
+ width={moderateScale(35)}
64
+ height={moderateScale(35)}
65
+ />
66
+ </TouchableOpacity>
67
+ )}
68
+ </View>
69
+ );
70
+ };
71
+
72
+ const styles = StyleSheet.create({
73
+ reminderCard: {
74
+ flexDirection: 'row',
75
+ alignItems: 'center',
76
+ backgroundColor: theme.colors.surface,
77
+ borderRadius: theme.borderRadius.lg,
78
+ paddingHorizontal: theme.spacing.md,
79
+ paddingVertical: moderateScale(12),
80
+ marginTop: theme.spacing.sm,
81
+ },
82
+ reminderContent: {
83
+ flex: 1,
84
+ },
85
+ reminderDateTime: {
86
+ fontFamily: Fonts.outfitMedium,
87
+ fontSize: theme.typography.fontSize.md,
88
+ color: theme.colors.black,
89
+ },
90
+
91
+ });
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { SafeAreaView, StyleSheet, ViewStyle } from 'react-native';
3
+ import { theme } from '../../constants';
4
+
5
+ interface SafeAreaWrapperProps {
6
+ children: React.ReactNode;
7
+ style?: ViewStyle;
8
+ backgroundColor?: string;
9
+ }
10
+
11
+ export const SafeAreaWrapper: React.FC<SafeAreaWrapperProps> = ({
12
+ children,
13
+ style,
14
+ backgroundColor = theme.colors.background,
15
+ }) => {
16
+ return (
17
+ <SafeAreaView style={[styles.container, { backgroundColor }, style]}>
18
+ {children}
19
+ </SafeAreaView>
20
+ );
21
+ };
22
+
23
+ const styles = StyleSheet.create({
24
+ container: {
25
+ flex: 1,
26
+ },
27
+ });
@@ -0,0 +1,308 @@
1
+ import React, { useEffect, useState, useRef } from 'react';
2
+ import { View, Text, StyleSheet, Modal, TouchableOpacity, Animated, Dimensions, PanResponder } from 'react-native';
3
+ import DatePicker from 'react-native-date-picker';
4
+ import { Button } from './Button';
5
+ import { theme } from '@constants';
6
+ import { moderateScale } from '@utils/scaling';
7
+ import { Fonts } from '@constants/Fonts';
8
+
9
+
10
+ interface SetReminderModalProps {
11
+ visible: boolean;
12
+ onClose: () => void;
13
+ onSave: (reminderDateTime: Date) => void;
14
+ onSuccessClose?: boolean;
15
+ maxDate?: string;
16
+ }
17
+
18
+ export const SetReminderModal: React.FC<SetReminderModalProps> = ({
19
+ visible,
20
+ onClose,
21
+ onSave,
22
+ onSuccessClose = false,
23
+ maxDate
24
+ }) => {
25
+
26
+ const screenHeight = Dimensions.get('window').height;
27
+ const bottomSheetHeight = screenHeight * 0.6; // 60% of screen height
28
+ const translateY = useRef(new Animated.Value(bottomSheetHeight)).current;
29
+
30
+ // Calculate the minimum allowed date (Current time + 30 min, rounded to nearest 30-min interval)
31
+ const getCalculatedMinimumDate = () => {
32
+ const now = new Date();
33
+ // Add 30 minutes
34
+ now.setMinutes(now.getMinutes() + 30);
35
+
36
+ // Round up to the nearest 30-minute interval (:00 or :30)
37
+ const minutes = now.getMinutes();
38
+ if (minutes > 0 && minutes <= 30) {
39
+ // Round up to :30
40
+ now.setMinutes(30);
41
+ } else if (minutes > 30) {
42
+ // Round up to next hour :00
43
+ now.setHours(now.getHours() + 1);
44
+ now.setMinutes(0);
45
+ }
46
+
47
+ now.setSeconds(0);
48
+ now.setMilliseconds(0);
49
+ return now;
50
+ };
51
+
52
+ // Initialize with calculated minimum date
53
+ const getInitialDate = () => {
54
+ return getCalculatedMinimumDate();
55
+ };
56
+
57
+ // Get minimum date for picker
58
+ const getMinimumDate = () => {
59
+ return getCalculatedMinimumDate();
60
+ };
61
+
62
+ const [date, setDate] = useState(getInitialDate());
63
+ const [minimumDate, setMinimumDate] = useState(getMinimumDate());
64
+ const [isFutureTime, setIsFutureTime] = useState(true);
65
+
66
+ // Convert maxDate string to Date object
67
+ const getMaximumDate = () => {
68
+ if (!maxDate) return undefined;
69
+ const parsedDate = new Date(maxDate);
70
+ return isNaN(parsedDate.getTime()) ? undefined : parsedDate;
71
+ };
72
+
73
+ // Animate modal on visibility change
74
+ useEffect(() => {
75
+ if (visible) {
76
+ showBottomSheet();
77
+ }
78
+ }, [visible]);
79
+
80
+ useEffect(() => {
81
+ if (onSuccessClose) {
82
+ handleClose();
83
+ }
84
+ }, [onSuccessClose]);
85
+
86
+ // Check if selected time is valid
87
+ useEffect(() => {
88
+ const checkIfFutureTime = () => {
89
+ const minDate = getCalculatedMinimumDate();
90
+ setIsFutureTime(date >= minDate);
91
+
92
+ // Update minimum date for picker
93
+ setMinimumDate(minDate);
94
+ };
95
+
96
+ checkIfFutureTime();
97
+ // Check every second to update button state and minimum date
98
+ const interval = setInterval(checkIfFutureTime, 1000);
99
+
100
+ return () => clearInterval(interval);
101
+ }, [date]);
102
+
103
+ // Bottom sheet animation functions
104
+ const showBottomSheet = () => {
105
+ Animated.spring(translateY, {
106
+ toValue: 0,
107
+ useNativeDriver: true,
108
+ tension: 100,
109
+ friction: 8,
110
+ }).start();
111
+ };
112
+
113
+ const hideBottomSheet = () => {
114
+ Animated.timing(translateY, {
115
+ toValue: bottomSheetHeight,
116
+ duration: 300,
117
+ useNativeDriver: true,
118
+ }).start(() => {
119
+ translateY.setValue(bottomSheetHeight);
120
+ onClose();
121
+ });
122
+ };
123
+
124
+ // PanResponder for swipe gestures
125
+ const panResponder = useRef(
126
+ PanResponder.create({
127
+ onMoveShouldSetPanResponder: (_, gestureState) => {
128
+ return Math.abs(gestureState.dy) > 5;
129
+ },
130
+ onPanResponderGrant: () => {
131
+ translateY.setOffset((translateY as any)._value);
132
+ translateY.setValue(0);
133
+ },
134
+ onPanResponderMove: (_, gestureState) => {
135
+ // Only allow downward movement
136
+ if (gestureState.dy > 0) {
137
+ translateY.setValue(gestureState.dy);
138
+ }
139
+ },
140
+ onPanResponderRelease: (_, gestureState) => {
141
+ translateY.flattenOffset();
142
+
143
+ // If swiped down more than 100px or with high velocity, close the modal
144
+ if (gestureState.dy > 100 || gestureState.vy > 0.5) {
145
+ hideBottomSheet();
146
+ } else {
147
+ // Snap back to original position
148
+ Animated.spring(translateY, {
149
+ toValue: 0,
150
+ useNativeDriver: true,
151
+ tension: 100,
152
+ friction: 8,
153
+ }).start();
154
+ }
155
+ },
156
+ })
157
+ ).current;
158
+
159
+ const handleSave = () => {
160
+ onSave(date);
161
+ };
162
+
163
+ const handleClose = () => {
164
+ // Reset to next available time slot when closing
165
+ setDate(getInitialDate());
166
+ hideBottomSheet();
167
+ };
168
+
169
+ const handleDateChange = (newDate: Date) => {
170
+ console.log("Selected date:", newDate);
171
+ console.log("Current time:", new Date());
172
+
173
+ // Just set the date, validation will be done by the button enable/disable state
174
+ setDate(newDate);
175
+ };
176
+
177
+ return (
178
+ <Modal
179
+ visible={visible}
180
+ animationType="fade"
181
+ transparent={true}
182
+ onRequestClose={handleClose}
183
+ >
184
+ <View style={styles.modalOverlay}>
185
+ <TouchableOpacity
186
+ style={styles.modalBackdrop}
187
+ activeOpacity={1}
188
+ onPress={handleClose}
189
+ />
190
+ <Animated.View
191
+ style={[
192
+ styles.modalContainer,
193
+ {
194
+ transform: [{ translateY }],
195
+ },
196
+ ]}
197
+ >
198
+ <View style={styles.dragHandle} {...panResponder.panHandlers} />
199
+ <View style={styles.content}>
200
+ <Text style={styles.modalTitle}>
201
+ Set Reminder
202
+ </Text>
203
+
204
+ {/* Date Time Picker */}
205
+ <View style={styles.pickerContainer}>
206
+ <DatePicker
207
+ theme='auto'
208
+ mode='datetime'
209
+ date={date}
210
+ minimumDate={minimumDate}
211
+ maximumDate={getMaximumDate()}
212
+ minuteInterval={30}
213
+ onDateChange={handleDateChange}
214
+ />
215
+ </View>
216
+
217
+ {/* Save Button */}
218
+ <View style={styles.buttonContainer}>
219
+ <Button
220
+ title='Submit'
221
+ onPress={handleSave}
222
+ variant="primary"
223
+ size="medium"
224
+ style={styles.saveButton}
225
+ disabled={!isFutureTime}
226
+ />
227
+ </View>
228
+ </View>
229
+ </Animated.View>
230
+ </View>
231
+ </Modal>
232
+ );
233
+ };
234
+
235
+ const styles = StyleSheet.create({
236
+ modalOverlay: {
237
+ flex: 1,
238
+ justifyContent: 'flex-end',
239
+ },
240
+ modalBackdrop: {
241
+ position: 'absolute',
242
+ top: 0,
243
+ left: 0,
244
+ right: 0,
245
+ bottom: 0,
246
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
247
+ },
248
+ modalContainer: {
249
+ backgroundColor: theme.colors.white,
250
+ borderTopLeftRadius: moderateScale(20),
251
+ borderTopRightRadius: moderateScale(20),
252
+ paddingHorizontal: theme.spacing.lg,
253
+ paddingTop: theme.spacing.sm,
254
+ paddingBottom: theme.spacing.xl,
255
+ height: '45%',
256
+ maxHeight: '45%',
257
+ },
258
+
259
+ dragHandle: {
260
+ width: moderateScale(40),
261
+ height: moderateScale(4),
262
+ backgroundColor: theme.colors.border,
263
+ borderRadius: moderateScale(2),
264
+ alignSelf: 'center',
265
+ marginBottom: theme.spacing.sm,
266
+ },
267
+ content: {
268
+ flex: 1,
269
+ },
270
+ modalTitle: {
271
+ fontSize: moderateScale(18),
272
+ fontFamily: Fonts.outfitSemiBold,
273
+ color: theme.colors.text,
274
+ },
275
+ pickerContainer: {
276
+ alignItems: 'center',
277
+ borderColor: theme.colors.border,
278
+ borderRadius: moderateScale(30),
279
+ paddingHorizontal: theme.spacing.md,
280
+ paddingVertical: theme.spacing.sm,
281
+ backgroundColor: theme.colors.white,
282
+ minHeight: moderateScale(50),
283
+ },
284
+ dateText: {
285
+ fontFamily: Fonts.outfitRegular,
286
+ fontSize: theme.typography.fontSize.md,
287
+ color: theme.colors.text,
288
+ },
289
+ placeholderText: {
290
+ color: '#9CA3AF',
291
+ },
292
+ bottomContainer: {
293
+ paddingHorizontal: theme.spacing.lg,
294
+ paddingVertical: theme.spacing.lg,
295
+ backgroundColor: theme.colors.background,
296
+ borderTopWidth: 1,
297
+ borderTopColor: theme.colors.border,
298
+ },
299
+ buttonContainer: {
300
+ marginTop: theme.spacing.md,
301
+ paddingBottom: theme.spacing.lg,
302
+ },
303
+ saveButton: {
304
+ width: '100%',
305
+ backgroundColor: theme.colors.blue,
306
+ paddingVertical: theme.spacing.md,
307
+ },
308
+ });
@@ -0,0 +1,57 @@
1
+ import React, { FC } from 'react'
2
+ import { Text, View, ActivityIndicator, StyleSheet, Dimensions } from 'react-native'
3
+ import { SafeAreaView } from 'react-native-safe-area-context'
4
+ import SVG from '../../assets/icons'
5
+ import { moderateScale } from '../../utils/scaling'
6
+ import { Fonts } from '../../constants/Fonts'
7
+
8
+ export const SlowInternet = ({ isLoading, message }) =>
9
+ isLoading ? (
10
+ <SafeAreaView style={styles.mainView}>
11
+ <View style={styles.contentView}>
12
+ <View style={styles.iconContainer}>
13
+ <SVG.no_wifi width={moderateScale(50)} height={moderateScale(50)} />
14
+ </View>
15
+ <Text style={styles.messageText}>
16
+ {message}
17
+ </Text>
18
+ </View>
19
+ </SafeAreaView>
20
+ ) : (
21
+ <></>
22
+ )
23
+
24
+ const styles = StyleSheet.create({
25
+ mainView: {
26
+ position: 'absolute',
27
+ bottom: 0,
28
+ left: 0,
29
+ right: 0,
30
+ height: '50%',
31
+ backgroundColor: 'white',
32
+ borderTopLeftRadius: 20,
33
+ borderTopRightRadius: 20,
34
+ shadowColor: "#000",
35
+ shadowOffset: {
36
+ width: 0,
37
+ height: -2,
38
+ },
39
+ shadowOpacity: 0.25,
40
+ shadowRadius: 3.84,
41
+ elevation: 5,
42
+ },
43
+ contentView: {
44
+ flex: 1,
45
+ justifyContent: 'center',
46
+ alignItems: 'center',
47
+ },
48
+ iconContainer: {
49
+ alignItems: 'center',
50
+ justifyContent: 'center',
51
+ },
52
+ messageText: {
53
+ marginTop: moderateScale(2),
54
+ fontSize: moderateScale(16),
55
+ fontFamily:Fonts.outfitBold,
56
+ }
57
+ })