@zezosoft/zezo-ott-react-native-ui-kit 1.1.5 → 1.1.6

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 (252) hide show
  1. package/package.json +1 -14
  2. package/src/Styles/globalStyles.ts +0 -70
  3. package/src/assets/animations/135037-payment-processing-error.json +0 -1347
  4. package/src/assets/animations/7227-vui-animation.json +0 -3377
  5. package/src/assets/animations/Failed.json +0 -2103
  6. package/src/assets/animations/Pending.json +0 -522
  7. package/src/assets/animations/Successful.json +0 -2289
  8. package/src/assets/animations/heart.json +0 -788
  9. package/src/assets/animations/succesfull-payment.json +0 -2379
  10. package/src/assets/animations/voice-icon.json +0 -542
  11. package/src/assets/img/back.png +0 -0
  12. package/src/assets/img/bottom-panel.png +0 -0
  13. package/src/assets/img/camera.png +0 -0
  14. package/src/assets/img/camera2.png +0 -0
  15. package/src/assets/img/home.png +0 -0
  16. package/src/assets/img/lock.png +0 -0
  17. package/src/assets/img/play.png +0 -0
  18. package/src/assets/img/profile.jpg +0 -0
  19. package/src/assets/img/qr-code.png +0 -0
  20. package/src/assets/img/shadow.png +0 -0
  21. package/src/assets/img/shadow2.png +0 -0
  22. package/src/assets/img/user.png +0 -0
  23. package/src/assets/svg/Account.svg +0 -4
  24. package/src/assets/svg/Favourite.svg +0 -14
  25. package/src/assets/svg/Upcoming.svg +0 -4
  26. package/src/assets/svg/content-error.svg +0 -28
  27. package/src/assets/svg/download.svg +0 -3
  28. package/src/assets/svg/eye-off.svg +0 -10
  29. package/src/assets/svg/favorites.svg +0 -3
  30. package/src/assets/svg/h.svg +0 -4
  31. package/src/assets/svg/home.svg +0 -5
  32. package/src/assets/svg/home1.svg +0 -3
  33. package/src/assets/svg/menu-bar.svg +0 -4
  34. package/src/assets/svg/my-space.svg +0 -14
  35. package/src/assets/svg/play-icon-with-bg.svg +0 -5
  36. package/src/assets/svg/profile.svg +0 -4
  37. package/src/assets/svg/search.svg +0 -5
  38. package/src/assets/svg/search1.svg +0 -4
  39. package/src/assets/svg/server-error.svg +0 -139
  40. package/src/components/Account/Account.tsx +0 -367
  41. package/src/components/Account/index.ts +0 -1
  42. package/src/components/Alert/AlertDialog.tsx +0 -247
  43. package/src/components/Alert/UAAlert.tsx +0 -170
  44. package/src/components/Alert/index.ts +0 -2
  45. package/src/components/Auth/AuthProvider/AuthProvider.tsx +0 -419
  46. package/src/components/Auth/One/ForgotPassword/ForgotPassword.tsx +0 -324
  47. package/src/components/Auth/One/Login/LoginWithEmail.tsx +0 -455
  48. package/src/components/Auth/One/Login/LoginWithPhone.tsx +0 -306
  49. package/src/components/Auth/One/OTP/OTP.tsx +0 -465
  50. package/src/components/Auth/One/QrLogin/QrLogin.tsx +0 -602
  51. package/src/components/Auth/One/QrLogin/components/QrViewArea.tsx +0 -423
  52. package/src/components/Auth/One/SignUp/SignUp.tsx +0 -479
  53. package/src/components/Auth/One/SplashScreen/SplashScreen.tsx +0 -249
  54. package/src/components/Auth/One/SplashScreen/components/SplashImage/SplashImage.tsx +0 -103
  55. package/src/components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.tsx +0 -77
  56. package/src/components/Auth/One/SplashScreen/components/SplashVideo/SplashVideo.tsx +0 -174
  57. package/src/components/Auth/One/index.ts +0 -24
  58. package/src/components/Auth/Two/AuthHeader/AuthHeader.tsx +0 -108
  59. package/src/components/Auth/Two/ForgotPassword/ForgotPassword.tsx +0 -335
  60. package/src/components/Auth/Two/Login/AuthLoginShell.tsx +0 -173
  61. package/src/components/Auth/Two/Login/LoginWithEmail.tsx +0 -279
  62. package/src/components/Auth/Two/Login/LoginWithPhone.tsx +0 -188
  63. package/src/components/Auth/Two/OTP/OTP.tsx +0 -465
  64. package/src/components/Auth/Two/QrLogin/QrLogin.tsx +0 -602
  65. package/src/components/Auth/Two/QrLogin/components/QrViewArea.tsx +0 -423
  66. package/src/components/Auth/Two/SignUp/SignUp.tsx +0 -472
  67. package/src/components/Auth/Two/SplashScreen/SplashScreen.tsx +0 -248
  68. package/src/components/Auth/Two/SplashScreen/components/SplashImage/SplashImage.tsx +0 -92
  69. package/src/components/Auth/Two/SplashScreen/components/SplashLottie/SplashLottie.tsx +0 -77
  70. package/src/components/Auth/Two/SplashScreen/components/SplashVideo/SplashVideo.tsx +0 -178
  71. package/src/components/Auth/Two/index.ts +0 -28
  72. package/src/components/Auth/index.ts +0 -11
  73. package/src/components/BackgroundLayout/BackgroundLayout.tsx +0 -174
  74. package/src/components/BackgroundLayout/BackgroundLayoutOne.tsx +0 -56
  75. package/src/components/BlogView/BlogView.tsx +0 -276
  76. package/src/components/BlogView/index.ts +0 -8
  77. package/src/components/BlurView/BlurView.tsx +0 -199
  78. package/src/components/BlurView/index.ts +0 -7
  79. package/src/components/BottomSheet/BottomSheet.tsx +0 -200
  80. package/src/components/BottomSheet/BottomSheetOne.tsx +0 -220
  81. package/src/components/BottomSheet/index.ts +0 -4
  82. package/src/components/Button/BackBtn.tsx +0 -168
  83. package/src/components/Button/MenuBtn.tsx +0 -229
  84. package/src/components/Button/PrimaryBtn.tsx +0 -134
  85. package/src/components/Button/SecondaryBtn.tsx +0 -132
  86. package/src/components/Button/TextButton.tsx +0 -145
  87. package/src/components/Button/index.ts +0 -18
  88. package/src/components/Content/Card/Category/Category.tsx +0 -436
  89. package/src/components/Content/Card/Category/CategroyTwo.tsx +0 -429
  90. package/src/components/Content/Card/NowWatching/NowWatching.tsx +0 -624
  91. package/src/components/Content/Card/Sliders/Styles/One.tsx +0 -490
  92. package/src/components/Content/Card/Sliders/Styles/Three.tsx +0 -935
  93. package/src/components/Content/Card/Sliders/Styles/Two.tsx +0 -391
  94. package/src/components/Content/Card/Sliders/index.ts +0 -17
  95. package/src/components/Content/Card/Styles/Five.tsx +0 -385
  96. package/src/components/Content/Card/Styles/Four.tsx +0 -379
  97. package/src/components/Content/Card/Styles/One.tsx +0 -386
  98. package/src/components/Content/Card/Styles/RotateInOut.tsx +0 -413
  99. package/src/components/Content/Card/Styles/Six.tsx +0 -392
  100. package/src/components/Content/Card/Styles/Three.tsx +0 -314
  101. package/src/components/Content/Card/Styles/TopTen.tsx +0 -412
  102. package/src/components/Content/Card/Styles/Two.tsx +0 -416
  103. package/src/components/Content/Card/components/AdsPoster.tsx +0 -202
  104. package/src/components/Content/Card/components/CardPoster.tsx +0 -377
  105. package/src/components/Content/Card/components/NavigateToMore.tsx +0 -97
  106. package/src/components/Content/Card/components/RentOrBuyIcon.tsx +0 -129
  107. package/src/components/Content/Card/components/ShowAllButton.tsx +0 -92
  108. package/src/components/Content/Card/components/ThumbnailCard.tsx +0 -234
  109. package/src/components/Content/Card/components/index.ts +0 -1
  110. package/src/components/Content/Card/index.ts +0 -30
  111. package/src/components/Content/Content.tsx +0 -315
  112. package/src/components/Content/Sections.tsx +0 -238
  113. package/src/components/Content/types.ts +0 -176
  114. package/src/components/ContentView/MoreContentList.tsx +0 -327
  115. package/src/components/ContentView/One/ContentViewOne.tsx +0 -243
  116. package/src/components/ContentView/One/components/AboutSection.tsx +0 -216
  117. package/src/components/ContentView/One/components/CastCard.tsx +0 -265
  118. package/src/components/ContentView/One/components/EpisodeCard.tsx +0 -535
  119. package/src/components/ContentView/One/components/GenreTags.tsx +0 -132
  120. package/src/components/ContentView/One/components/HeroBanner.tsx +0 -357
  121. package/src/components/ContentView/One/components/MiniInfo.tsx +0 -356
  122. package/src/components/ContentView/One/components/PlayButton.tsx +0 -56
  123. package/src/components/ContentView/One/components/Title.tsx +0 -149
  124. package/src/components/ContentView/One/components/TrailerButton.tsx +0 -76
  125. package/src/components/ContentView/Two/ContentViewTwo.tsx +0 -343
  126. package/src/components/ContentView/Two/components/AboutSection.tsx +0 -216
  127. package/src/components/ContentView/Two/components/Details.tsx +0 -193
  128. package/src/components/ContentView/Two/components/EpisodeCard.tsx +0 -602
  129. package/src/components/ContentView/Two/components/GenreTags.tsx +0 -123
  130. package/src/components/ContentView/Two/components/HeroBanner.tsx +0 -402
  131. package/src/components/ContentView/Two/components/LikeShareActions.tsx +0 -125
  132. package/src/components/ContentView/Two/components/MoreLikeThisContentList .tsx +0 -305
  133. package/src/components/ContentView/Two/components/PlayOrTrailer.tsx +0 -133
  134. package/src/components/ContentView/Two/components/SectionTabs.tsx +0 -177
  135. package/src/components/ContentView/Two/components/Title.tsx +0 -226
  136. package/src/components/ContentView/Two/components/index.ts +0 -15
  137. package/src/components/ContentView/index.ts +0 -13
  138. package/src/components/Fallbacks/NoContentFallback.tsx +0 -176
  139. package/src/components/Fallbacks/NotFoundFallback.tsx +0 -94
  140. package/src/components/Fallbacks/index.ts +0 -2
  141. package/src/components/Headers/AppHeader.tsx +0 -150
  142. package/src/components/Headers/Four.tsx +0 -83
  143. package/src/components/Headers/One.tsx +0 -115
  144. package/src/components/Headers/Three.tsx +0 -135
  145. package/src/components/Headers/Two.tsx +0 -100
  146. package/src/components/Headers/index.ts +0 -18
  147. package/src/components/Input/Input.ts +0 -20
  148. package/src/components/Input/InputOne.tsx +0 -259
  149. package/src/components/Input/InputThree.tsx +0 -212
  150. package/src/components/Input/InputTwo.tsx +0 -212
  151. package/src/components/Input/PhoneNumberInput.tsx +0 -431
  152. package/src/components/Input/PhoneNumberInputTwo.tsx +0 -418
  153. package/src/components/Keyboard/HideKeyboard.tsx +0 -88
  154. package/src/components/Loader/Loader.tsx +0 -44
  155. package/src/components/Logo/Logo.tsx +0 -145
  156. package/src/components/NewRelease/NewReleaseSheet.tsx +0 -250
  157. package/src/components/NewRelease/index.ts +0 -1
  158. package/src/components/Reels/ReelsSeries/MediaControls/BottomControls.tsx +0 -221
  159. package/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.tsx +0 -314
  160. package/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.tsx +0 -196
  161. package/src/components/Reels/ReelsSeries/MediaControls/RightControls.tsx +0 -95
  162. package/src/components/Reels/ReelsSeries/MediaControls/TopControls.tsx +0 -163
  163. package/src/components/Reels/ReelsSeries/Model/DetailsModal.tsx +0 -210
  164. package/src/components/Reels/ReelsSeries/Model/SettingModal.tsx +0 -146
  165. package/src/components/Reels/ReelsSeries/Model/UnlockModal.tsx +0 -154
  166. package/src/components/Reels/ReelsSeries/ReelsSeries.tsx +0 -264
  167. package/src/components/Reels/ReelsSeries/ReelsSeriesItem.tsx +0 -494
  168. package/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.tsx +0 -184
  169. package/src/components/Reels/ReelsSeries/components/Episodes.tsx +0 -154
  170. package/src/components/Reels/ReelsSeries/components/GradientOverlay.tsx +0 -41
  171. package/src/components/Reels/ReelsSeries/components/Like.tsx +0 -40
  172. package/src/components/Reels/ReelsSeries/components/RotatingLoader.tsx +0 -79
  173. package/src/components/Reels/ReelsSeries/components/Synopsis.tsx +0 -332
  174. package/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.tsx +0 -187
  175. package/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.tsx +0 -80
  176. package/src/components/Reels/ReelsSeries/components/VideoControls/index.ts +0 -2
  177. package/src/components/Reels/ReelsSeries/types.ts +0 -54
  178. package/src/components/Reels/ReelsSeries/useReelsWatchProgress.ts +0 -85
  179. package/src/components/Reels/ReelsSeries/utils/quality.ts +0 -48
  180. package/src/components/Reels/index.ts +0 -9
  181. package/src/components/Reels/utils/Controls/gestureUtils.ts +0 -42
  182. package/src/components/Reels/utils/Controls/index.ts +0 -4
  183. package/src/components/Reels/utils/Controls/overlayUtils.ts +0 -35
  184. package/src/components/Reels/utils/Controls/videoControlsConstants.ts +0 -25
  185. package/src/components/Reels/utils/Controls/videoRef.ts +0 -4
  186. package/src/components/Reels/utils/index.ts +0 -1
  187. package/src/components/Reels/utils/timeoutUtils.ts +0 -29
  188. package/src/components/Search/One.tsx +0 -256
  189. package/src/components/Search/components/RecentSearchesSection.tsx +0 -181
  190. package/src/components/Search/components/SearchCard.tsx +0 -275
  191. package/src/components/Search/index.ts +0 -16
  192. package/src/components/Settings/AppSettings.tsx +0 -428
  193. package/src/components/Settings/index.ts +0 -1
  194. package/src/components/Subscription/SubOne.tsx +0 -874
  195. package/src/components/Subscription/index.ts +0 -12
  196. package/src/components/TabBar/One.tsx +0 -148
  197. package/src/components/TabBar/Three.tsx +0 -169
  198. package/src/components/TabBar/Two.tsx +0 -189
  199. package/src/components/TabBar/index.ts +0 -20
  200. package/src/components/Text/Text.tsx +0 -85
  201. package/src/components/Text/index.ts +0 -5
  202. package/src/components/User/DeviceSessions/DeviceSessions.tsx +0 -468
  203. package/src/components/User/ProfileUpdate/ProfileUpdate.tsx +0 -278
  204. package/src/components/User/PurchaseHistory/PurchaseHistory.tsx +0 -494
  205. package/src/components/User/WatchHistory/WatchHistory.tsx +0 -227
  206. package/src/components/User/WatchLater/WatchLater.tsx +0 -397
  207. package/src/components/User/components/UserAvatar.tsx +0 -120
  208. package/src/components/User/components/UserSection.tsx +0 -228
  209. package/src/components/User/index.ts +0 -18
  210. package/src/components/View/View.tsx +0 -37
  211. package/src/components/View/index.ts +0 -5
  212. package/src/components/common/AppStatusBar.tsx +0 -57
  213. package/src/components/index.ts +0 -29
  214. package/src/components/layout/SafeAreaWrapper.tsx +0 -45
  215. package/src/components/layout/index.ts +0 -1
  216. package/src/constants/dummySections.ts +0 -98
  217. package/src/hooks/Images/index.ts +0 -2
  218. package/src/hooks/Images/useImageLoader.ts +0 -206
  219. package/src/hooks/Images/useImageValidation.ts +0 -36
  220. package/src/hooks/index.ts +0 -17
  221. package/src/hooks/useAdTracking.ts +0 -349
  222. package/src/hooks/useCards.ts +0 -228
  223. package/src/hooks/useDebounce.ts +0 -35
  224. package/src/hooks/useKeyboard.ts +0 -43
  225. package/src/hooks/useNavigationMode.ts +0 -46
  226. package/src/hooks/usePaginatedSection.ts +0 -101
  227. package/src/hooks/usePrevious.ts +0 -28
  228. package/src/hooks/useSafeCallback.ts +0 -43
  229. package/src/hooks/useSkeletonItems.ts +0 -30
  230. package/src/hooks/useSplashCache.ts +0 -186
  231. package/src/hooks/useThemeColors.ts +0 -51
  232. package/src/index.tsx +0 -8
  233. package/src/store/RecentSearchesStore.ts +0 -78
  234. package/src/store/splashStore.ts +0 -91
  235. package/src/store/themeStore.ts +0 -43
  236. package/src/theme/ThemeProvider.tsx +0 -112
  237. package/src/theme/hook/index.ts +0 -1
  238. package/src/theme/hook/useInternalTheme.ts +0 -98
  239. package/src/theme/index.ts +0 -7
  240. package/src/theme/themes.ts +0 -336
  241. package/src/theme/utils/validateColor.ts +0 -127
  242. package/src/types/content/content-view.types.ts +0 -206
  243. package/src/types/hook/index.ts +0 -5
  244. package/src/types/hook/usePaginatedSetion.ts +0 -19
  245. package/src/types/index.ts +0 -7
  246. package/src/types/sections/index.ts +0 -84
  247. package/src/utils/Display.ts +0 -14
  248. package/src/utils/Formater.ts +0 -14
  249. package/src/utils/PlatformSelector.ts +0 -29
  250. package/src/utils/SizeMatters.ts +0 -7
  251. package/src/utils/Spacing.ts +0 -27
  252. package/src/utils/colorUtils.ts +0 -70
@@ -1,874 +0,0 @@
1
- /**
2
- * @author Naresh Dhamu
3
- * @lastModified Mon 21 Jul 2025 at 04:55 PM
4
- */
5
-
6
- import React, { memo, useCallback, useMemo, useState } from 'react';
7
- import {
8
- View,
9
- StyleSheet,
10
- TouchableOpacity,
11
- ActivityIndicator,
12
- ScrollView,
13
- Dimensions,
14
- } from 'react-native';
15
- import Carousel from 'react-native-reanimated-carousel';
16
- import { scale, verticalScale, moderateScale } from 'react-native-size-matters';
17
- import LinearGradient from 'react-native-linear-gradient';
18
- import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
19
- import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
20
- import Modal from 'react-native-modal';
21
- import { X } from 'lucide-react-native';
22
- import { Text } from '../Text';
23
- import AppHeader from '../Headers/AppHeader';
24
- import { useInternalTheme } from '../../theme/hook/useInternalTheme';
25
- import Display from '../../utils/Display';
26
- import type { ThemeOverride } from '../../theme/themes';
27
- import { RFValue } from 'react-native-responsive-fontsize';
28
-
29
- export type Plan = {
30
- id: string;
31
- title: string;
32
- price: string;
33
- duration: string;
34
- platforms: string;
35
- benefits?: string[];
36
- isPopular?: boolean;
37
- extraDetails?: {
38
- description?: string;
39
- features?: string[];
40
- terms?: string;
41
- [key: string]: any;
42
- };
43
- };
44
-
45
- // Memoized Plan Details Modal Component
46
- const PlanDetailsModalContent = memo<{
47
- plan: Plan;
48
- colors: {
49
- surface: string;
50
- background: string;
51
- textPrimary: string;
52
- textSecondary: string;
53
- primary: string;
54
- };
55
- onClose: () => void;
56
- }>(({ plan, colors, onClose }) => {
57
- const modalContentStyle = useMemo(
58
- () => [styles.modalContent, { backgroundColor: colors.surface }],
59
- [colors.surface]
60
- );
61
-
62
- const modalTitleStyle = useMemo(
63
- () => [styles.modalTitle, { color: colors.textPrimary }],
64
- [colors.textPrimary]
65
- );
66
-
67
- const modalCloseButtonStyle = useMemo(
68
- () => [styles.modalCloseButton, { backgroundColor: colors.background }],
69
- [colors.background]
70
- );
71
-
72
- const priceHighlightBoxStyle = useMemo(
73
- () => [styles.priceHighlightBox, { backgroundColor: colors.background }],
74
- [colors.background]
75
- );
76
-
77
- const platformBadgeStyle = useMemo(
78
- () => [
79
- styles.platformBadge,
80
- {
81
- backgroundColor: colors.surface,
82
- borderColor: colors.primary,
83
- },
84
- ],
85
- [colors.surface, colors.primary]
86
- );
87
-
88
- const modalPriceLabelStyle = useMemo(
89
- () => [styles.modalPriceLabel, { color: colors.textSecondary }],
90
- [colors.textSecondary]
91
- );
92
-
93
- const modalPriceValueStyle = useMemo(
94
- () => [styles.modalPriceValue, { color: colors.primary }],
95
- [colors.primary]
96
- );
97
-
98
- const modalPriceDurationStyle = useMemo(
99
- () => [styles.modalPriceDuration, { color: colors.textSecondary }],
100
- [colors.textSecondary]
101
- );
102
-
103
- const modalSectionTitleStyle = useMemo(
104
- () => [styles.modalSectionTitle, { color: colors.textPrimary }],
105
- [colors.textPrimary]
106
- );
107
-
108
- const platformBadgeTextStyle = useMemo(
109
- () => [styles.platformBadgeText, { color: colors.textPrimary }],
110
- [colors.textPrimary]
111
- );
112
-
113
- const benefitBulletStyle = useMemo(
114
- () => [styles.benefitBullet, { color: colors.primary }],
115
- [colors.primary]
116
- );
117
-
118
- const benefitTextStyle = useMemo(
119
- () => [styles.benefitText, { color: colors.textSecondary }],
120
- [colors.textSecondary]
121
- );
122
-
123
- const modalSectionValueStyle = useMemo(
124
- () => [styles.modalSectionValue, { color: colors.textSecondary }],
125
- [colors.textSecondary]
126
- );
127
-
128
- return (
129
- <View style={modalContentStyle}>
130
- <View style={styles.modalHeader}>
131
- <Text style={modalTitleStyle}>{plan.title || 'Plan Details'}</Text>
132
- <TouchableOpacity
133
- onPress={onClose}
134
- style={modalCloseButtonStyle}
135
- activeOpacity={0.7}
136
- >
137
- <X size={scale(20)} color={colors.textPrimary} />
138
- </TouchableOpacity>
139
- </View>
140
-
141
- <ScrollView
142
- style={styles.modalScrollView}
143
- contentContainerStyle={styles.modalScrollContent}
144
- showsVerticalScrollIndicator={false}
145
- bounces={false}
146
- scrollEventThrottle={16}
147
- keyboardShouldPersistTaps="handled"
148
- removeClippedSubviews={false}
149
- nestedScrollEnabled={true}
150
- >
151
- <View style={[styles.modalSection, styles.modalFirstSection]}>
152
- <View style={priceHighlightBoxStyle}>
153
- <Text style={modalPriceLabelStyle}>PRICING</Text>
154
- <Text style={modalPriceValueStyle}>{plan.price}</Text>
155
- <Text style={modalPriceDurationStyle}>per {plan.duration}</Text>
156
- </View>
157
- </View>
158
-
159
- <View style={styles.modalSection}>
160
- <Text style={modalSectionTitleStyle}>Available On</Text>
161
- <View style={platformBadgeStyle}>
162
- <Text style={platformBadgeTextStyle}>{plan.platforms}</Text>
163
- </View>
164
- </View>
165
-
166
- {plan.benefits && plan.benefits.length > 0 && (
167
- <View style={styles.modalSection}>
168
- <Text style={modalSectionTitleStyle}>Benefits</Text>
169
- {plan.benefits.map((benefit, index) => (
170
- <View
171
- key={`benefit-${plan.id}-${index}`}
172
- style={styles.benefitRow}
173
- >
174
- <Text style={benefitBulletStyle}>•</Text>
175
- <Text style={benefitTextStyle}>{benefit}</Text>
176
- </View>
177
- ))}
178
- </View>
179
- )}
180
-
181
- {plan.extraDetails?.description && (
182
- <View style={styles.modalSection}>
183
- <Text style={modalSectionTitleStyle}>Description</Text>
184
- <Text style={modalSectionValueStyle}>
185
- {plan.extraDetails.description}
186
- </Text>
187
- </View>
188
- )}
189
-
190
- {plan.extraDetails?.features &&
191
- plan.extraDetails.features.length > 0 && (
192
- <View style={styles.modalSection}>
193
- <Text style={modalSectionTitleStyle}>Features</Text>
194
- {plan.extraDetails.features.map((feature, index) => (
195
- <View
196
- key={`feature-${plan.id}-${index}`}
197
- style={styles.benefitRow}
198
- >
199
- <Text style={benefitBulletStyle}>✓</Text>
200
- <Text style={benefitTextStyle}>{feature}</Text>
201
- </View>
202
- ))}
203
- </View>
204
- )}
205
-
206
- {plan.extraDetails?.terms && (
207
- <View style={styles.modalSection}>
208
- <Text style={modalSectionTitleStyle}>Terms & Conditions</Text>
209
- <Text style={modalSectionValueStyle}>
210
- {plan.extraDetails.terms}
211
- </Text>
212
- </View>
213
- )}
214
- </ScrollView>
215
- </View>
216
- );
217
- });
218
-
219
- PlanDetailsModalContent.displayName = 'PlanDetailsModalContent';
220
-
221
- type SubscriptionSliderOneProps = {
222
- theme?: ThemeOverride;
223
- headerTitleAlign?: 'center' | 'left';
224
- subscribeButtonText?: string;
225
- onSubscribe?: (plan: Plan) => void;
226
- subscribeLoadingId?: string | null;
227
- plans: Plan[];
228
- errorMessage?: string;
229
- isLoading?: boolean;
230
- onBackPress?: () => void;
231
- header: {
232
- topTitle: string;
233
- topTitleAlign?: 'center' | 'left';
234
- title: string;
235
- subTitle: string;
236
- };
237
- footer: {
238
- title: string;
239
- subTitle: string;
240
- };
241
- extraContentText?: React.ReactNode;
242
- };
243
- const CAROUSEL_WIDTH = Display.fullWidth;
244
- const CAROUSEL_HEIGHT = verticalScale(CAROUSEL_WIDTH / 1.4);
245
-
246
- // Move parsePrice outside component to avoid recreation on every render
247
- const parsePrice = (price: string) =>
248
- parseFloat(price.replace(/[^\d.]/g, '')) || 0;
249
-
250
- const SubscriptionSliderOne = ({
251
- theme,
252
- onSubscribe,
253
- subscribeButtonText = 'Subscribe',
254
- subscribeLoadingId,
255
- plans,
256
- errorMessage = 'Something went wrong',
257
- isLoading = false,
258
- onBackPress = () => {},
259
- header,
260
- footer,
261
- extraContentText,
262
- }: SubscriptionSliderOneProps) => {
263
- const { theme: appliedTheme } = useInternalTheme(theme);
264
- const colors = appliedTheme.colors;
265
- const [selectedPlan, setSelectedPlan] = useState<Plan | null>(null);
266
- const [isModalVisible, setIsModalVisible] = useState(false);
267
- const sortedPlans = useMemo(() => {
268
- return [...plans].sort((a, b) => {
269
- const aPopular = a?.isPopular ? 1 : 0;
270
- const bPopular = b?.isPopular ? 1 : 0;
271
-
272
- if (aPopular !== bPopular) {
273
- return bPopular - aPopular;
274
- }
275
-
276
- if (aPopular === 1 && bPopular === 1) {
277
- return parsePrice(b.price) - parsePrice(a.price);
278
- }
279
-
280
- return 0;
281
- });
282
- }, [plans]);
283
-
284
- const placeholderData = useMemo(
285
- () => new Array(plans.length || 3).fill({}),
286
- [plans.length]
287
- );
288
-
289
- const shouldLoop = useMemo(
290
- () => sortedPlans.length > 1,
291
- [sortedPlans.length]
292
- );
293
-
294
- const carouselModeConfig = useMemo(
295
- () => ({
296
- parallaxScrollingOffset: Display.fullWidth * 0.21,
297
- parallaxAdjacentItemScale: 0.8,
298
- }),
299
- []
300
- );
301
-
302
- const errorMessageStyle = useMemo(
303
- () => ({ color: colors.error }),
304
- [colors.error]
305
- );
306
-
307
- const containerStyle = useMemo(
308
- () => [styles.container, { backgroundColor: colors.background }],
309
- [colors.background]
310
- );
311
-
312
- const headingStyle = useMemo(() => [styles.heading], []);
313
-
314
- const subTextStyle = useMemo(
315
- () => [styles.subText, { color: colors.onSurfaceVariant }],
316
- [colors.onSurfaceVariant]
317
- );
318
-
319
- const infoStyle = useMemo(
320
- () => [styles.info, { color: colors.onSurfaceVariant }],
321
- [colors.onSurfaceVariant]
322
- );
323
-
324
- const cancelTextStyle = useMemo(
325
- () => [styles.cancelText, { color: colors.onSurfaceVariant }],
326
- [colors.onSurfaceVariant]
327
- );
328
-
329
- const extraContentTextStyle = useMemo(
330
- () => [styles.extraContentTextText, { color: colors.onSurfaceVariant }],
331
- [colors.onSurfaceVariant]
332
- );
333
-
334
- const modalColors = useMemo(
335
- () => ({
336
- surface: colors.surface,
337
- background: colors.background,
338
- textPrimary: colors.textPrimary,
339
- textSecondary: colors.textSecondary,
340
- primary: colors.primary,
341
- }),
342
- [
343
- colors.surface,
344
- colors.background,
345
- colors.textPrimary,
346
- colors.textSecondary,
347
- colors.primary,
348
- ]
349
- );
350
-
351
- const skeletonColors = useMemo(
352
- () => ({
353
- backgroundColor: colors.skeletonBaseColor,
354
- highlightColor: colors.skeletonHighlightColor,
355
- }),
356
- [colors.skeletonBaseColor, colors.skeletonHighlightColor]
357
- );
358
-
359
- const renderSkeleton = useCallback(
360
- () => (
361
- <Animated.View
362
- entering={FadeIn}
363
- exiting={FadeOut}
364
- style={styles.cardContainer}
365
- >
366
- <SkeletonPlaceholder
367
- borderRadius={20}
368
- backgroundColor={skeletonColors.backgroundColor}
369
- highlightColor={skeletonColors.highlightColor}
370
- >
371
- <View style={styles.card} />
372
- </SkeletonPlaceholder>
373
- </Animated.View>
374
- ),
375
- [skeletonColors]
376
- );
377
-
378
- const openDetailsModal = useCallback((plan: Plan) => {
379
- setSelectedPlan(plan);
380
- setIsModalVisible(true);
381
- }, []);
382
-
383
- const closeDetailsModal = useCallback(() => {
384
- setIsModalVisible(false);
385
- // Delay clearing selectedPlan to prevent flicker during close animation
386
- setTimeout(() => {
387
- setSelectedPlan(null);
388
- }, 300);
389
- }, []);
390
-
391
- const gradientConfig = useMemo(
392
- () => ({
393
- colors: colors.cardGradient,
394
- start: { x: 1, y: 0 },
395
- end: { x: 0, y: 1.2 },
396
- locations: [0, 0.7, 1] as number[],
397
- }),
398
- [colors.cardGradient]
399
- );
400
-
401
- const cardStyle = useMemo(
402
- () => [styles.card, { shadowColor: colors.primary }],
403
- [colors.primary]
404
- );
405
-
406
- const handleSubscribe = useCallback(
407
- (item: Plan) => {
408
- onSubscribe?.(item);
409
- },
410
- [onSubscribe]
411
- );
412
-
413
- const renderPlan = useCallback(
414
- ({ item }: { item: Plan }) => {
415
- const isPopular = item?.isPopular;
416
- const hasBenefits = !!item.benefits?.length;
417
- const benefitsCount = item.benefits?.length || 0;
418
- const showViewDetails = hasBenefits || !!item.extraDetails;
419
- const isSubscribing = subscribeLoadingId === item.id;
420
- const viewDetailsText =
421
- hasBenefits && benefitsCount > 4 ? 'View More Details' : 'View Details';
422
-
423
- return (
424
- <View style={styles.cardContainer}>
425
- <LinearGradient
426
- colors={gradientConfig.colors}
427
- start={gradientConfig.start}
428
- end={gradientConfig.end}
429
- locations={gradientConfig.locations}
430
- style={cardStyle}
431
- >
432
- {isPopular && (
433
- <View
434
- style={[
435
- styles.popularBadge,
436
- { backgroundColor: colors.button },
437
- ]}
438
- >
439
- <Text
440
- style={[styles.popularText, { color: colors.buttonText }]}
441
- >
442
- POPULAR
443
- </Text>
444
- </View>
445
- )}
446
-
447
- <Text
448
- numberOfLines={1}
449
- style={[styles.cardTitle, { color: colors.white }]}
450
- >
451
- {item.title}
452
- </Text>
453
- <Text style={[styles.price, { color: colors.white }]}>
454
- {item.price}
455
- </Text>
456
- <Text style={[styles.per, { color: colors.white }]}>
457
- {item.duration}
458
- </Text>
459
- <Text style={[styles.platforms, { color: colors.white }]}>
460
- {item.platforms}
461
- </Text>
462
- {hasBenefits && item.benefits && (
463
- <View style={styles.benefitsContainer}>
464
- {item.benefits.slice(0, 4).map((benefit, i) => (
465
- <Text
466
- key={`${item.id}-benefit-${i}`}
467
- numberOfLines={1}
468
- style={[styles.benefit, { color: colors.white }]}
469
- >
470
- • {benefit}
471
- </Text>
472
- ))}
473
- </View>
474
- )}
475
- {showViewDetails && (
476
- <TouchableOpacity
477
- style={styles.viewDetailsButton}
478
- onPress={() => openDetailsModal(item)}
479
- activeOpacity={0.7}
480
- >
481
- <Text style={[styles.viewDetailsText, { color: colors.white }]}>
482
- {viewDetailsText}
483
- </Text>
484
- </TouchableOpacity>
485
- )}
486
- <TouchableOpacity
487
- style={[
488
- styles.subscribeButton,
489
- { backgroundColor: colors.button },
490
- ]}
491
- onPress={() => handleSubscribe(item)}
492
- activeOpacity={0.8}
493
- disabled={isSubscribing}
494
- >
495
- {isSubscribing ? (
496
- <ActivityIndicator size="small" color={colors.buttonText} />
497
- ) : (
498
- <Text
499
- style={[styles.subscribeText, { color: colors.buttonText }]}
500
- >
501
- {subscribeButtonText}
502
- </Text>
503
- )}
504
- </TouchableOpacity>
505
- </LinearGradient>
506
- </View>
507
- );
508
- },
509
- [
510
- gradientConfig,
511
- cardStyle,
512
- colors.button,
513
- colors.buttonText,
514
- colors.white,
515
- subscribeButtonText,
516
- subscribeLoadingId,
517
- openDetailsModal,
518
- handleSubscribe,
519
- ]
520
- );
521
-
522
- return (
523
- <View style={containerStyle}>
524
- <AppHeader
525
- title={header.topTitle}
526
- onBackPress={onBackPress}
527
- titleAlign={header.topTitleAlign}
528
- theme={theme}
529
- />
530
- <View style={styles.content}>
531
- <Text style={headingStyle} color={colors.textPrimary}>
532
- {header.title}
533
- </Text>
534
- <Text style={subTextStyle}>{header.subTitle}</Text>
535
-
536
- {!plans || (plans.length === 0 && !isLoading && errorMessage) ? (
537
- <View style={styles.errorMessage}>
538
- <Text style={errorMessageStyle}>{errorMessage}</Text>
539
- </View>
540
- ) : (
541
- <Carousel
542
- width={CAROUSEL_WIDTH}
543
- height={CAROUSEL_HEIGHT}
544
- data={isLoading ? placeholderData : sortedPlans}
545
- renderItem={isLoading ? renderSkeleton : renderPlan}
546
- loop={shouldLoop}
547
- autoPlay={false}
548
- scrollAnimationDuration={500}
549
- mode="parallax"
550
- modeConfig={carouselModeConfig}
551
- />
552
- )}
553
-
554
- <Text style={infoStyle}>{footer.title}</Text>
555
- <Text style={cancelTextStyle}>{footer.subTitle}</Text>
556
-
557
- {extraContentText && (
558
- <View style={styles.extraContentTextWrapper}>
559
- {React.isValidElement(extraContentText) ? (
560
- extraContentText
561
- ) : (
562
- <Text style={extraContentTextStyle}>{extraContentText}</Text>
563
- )}
564
- </View>
565
- )}
566
-
567
- {/* Details Modal */}
568
- <Modal
569
- isVisible={isModalVisible}
570
- onBackdropPress={closeDetailsModal}
571
- onBackButtonPress={closeDetailsModal}
572
- backdropOpacity={0.35}
573
- useNativeDriver={true}
574
- useNativeDriverForBackdrop={true}
575
- onSwipeComplete={closeDetailsModal}
576
- propagateSwipe
577
- style={styles.modal}
578
- hideModalContentWhileAnimating={true}
579
- animationIn="slideInUp"
580
- animationOut="slideOutDown"
581
- animationInTiming={300}
582
- animationOutTiming={300}
583
- >
584
- {selectedPlan && (
585
- <PlanDetailsModalContent
586
- plan={selectedPlan}
587
- colors={modalColors}
588
- onClose={closeDetailsModal}
589
- />
590
- )}
591
- </Modal>
592
- </View>
593
- </View>
594
- );
595
- };
596
-
597
- export default memo(SubscriptionSliderOne);
598
-
599
- namespace SubscriptionSliderOne {
600
- export type Props = SubscriptionSliderOneProps;
601
- }
602
-
603
- const styles = StyleSheet.create({
604
- container: { flex: 1 },
605
- content: { flex: 1, paddingTop: verticalScale(16) },
606
- heading: {
607
- fontSize: RFValue(21),
608
- fontWeight: '700',
609
- textAlign: 'center',
610
- marginBottom: verticalScale(12),
611
- marginHorizontal: scale(16),
612
- },
613
- subText: {
614
- textAlign: 'center',
615
- fontSize: RFValue(12),
616
- fontWeight: '400',
617
- marginBottom: verticalScale(12),
618
- marginHorizontal: scale(16),
619
- },
620
- errorMessage: {
621
- height: CAROUSEL_HEIGHT,
622
- fontSize: RFValue(13),
623
- fontWeight: '600',
624
- textAlign: 'center',
625
- textAlignVertical: 'center',
626
- justifyContent: 'center',
627
- alignItems: 'center',
628
- marginVertical: verticalScale(12),
629
- },
630
-
631
- cardContainer: {
632
- alignItems: 'center',
633
- justifyContent: 'center',
634
- },
635
- card: {
636
- position: 'relative',
637
- width: Display.fullWidth * 0.95,
638
- aspectRatio: 1,
639
- borderRadius: scale(20),
640
- justifyContent: 'center',
641
- alignItems: 'center',
642
- alignSelf: 'center',
643
- shadowOffset: { width: 0, height: 4 },
644
- shadowOpacity: 0.2,
645
- shadowRadius: 8,
646
- elevation: 5,
647
- },
648
- cardTitle: {
649
- fontSize: RFValue(17),
650
- fontWeight: '700',
651
- maxWidth: '50%',
652
- marginHorizontal: 'auto',
653
- marginBottom: verticalScale(8),
654
- textAlign: 'center',
655
- },
656
- price: {
657
- fontSize: RFValue(43),
658
- fontWeight: 'bold',
659
- marginBottom: verticalScale(4),
660
- },
661
- per: {
662
- fontSize: RFValue(13),
663
- textTransform: 'capitalize',
664
- marginBottom: verticalScale(6),
665
- },
666
- platforms: {
667
- fontSize: RFValue(13),
668
- textTransform: 'capitalize',
669
- textAlign: 'center',
670
- marginBottom: verticalScale(8),
671
- },
672
- benefitsContainer: {
673
- marginTop: verticalScale(8),
674
- alignItems: 'flex-start',
675
- justifyContent: 'center',
676
- width: '60%',
677
- marginHorizontal: 'auto',
678
- },
679
- benefit: {
680
- fontSize: RFValue(12),
681
- },
682
- subscribeButton: {
683
- paddingVertical: verticalScale(10),
684
- paddingHorizontal: scale(60),
685
- borderRadius: scale(30),
686
- alignItems: 'center',
687
- marginTop: verticalScale(5),
688
- },
689
- subscribeText: {
690
- fontSize: RFValue(14),
691
- fontWeight: '700',
692
- },
693
- info: {
694
- fontSize: RFValue(11),
695
- textAlign: 'center',
696
- fontWeight: '400',
697
- marginVertical: verticalScale(8),
698
- marginHorizontal: scale(16),
699
- },
700
- cancelText: {
701
- fontSize: RFValue(11),
702
- textAlign: 'center',
703
- fontWeight: '400',
704
- marginBottom: verticalScale(16),
705
- marginHorizontal: scale(16),
706
- },
707
- extraContentTextWrapper: {
708
- marginTop: verticalScale(18),
709
- alignItems: 'center',
710
- justifyContent: 'center',
711
- paddingHorizontal: scale(16),
712
- },
713
- extraContentTextText: {
714
- fontSize: RFValue(10),
715
- marginHorizontal: scale(16),
716
- fontWeight: '400',
717
- textAlign: 'center',
718
- },
719
- popularBadge: {
720
- position: 'absolute',
721
- top: verticalScale(10),
722
- right: scale(10),
723
- paddingHorizontal: scale(6),
724
- paddingVertical: verticalScale(3),
725
- borderRadius: scale(12),
726
- zIndex: 10,
727
- },
728
- popularText: {
729
- fontSize: RFValue(9),
730
- textTransform: 'uppercase',
731
- fontWeight: '700',
732
- },
733
- viewDetailsButton: {
734
- paddingVertical: verticalScale(6),
735
- paddingHorizontal: scale(20),
736
- alignItems: 'center',
737
- justifyContent: 'center',
738
- },
739
- viewDetailsText: {
740
- fontSize: RFValue(12),
741
- fontWeight: '600',
742
- textDecorationLine: 'underline',
743
- },
744
- modal: {
745
- margin: 0,
746
- justifyContent: 'flex-end',
747
- zIndex: 1000,
748
- },
749
-
750
- modalContent: {
751
- borderTopLeftRadius: moderateScale(24),
752
- borderTopRightRadius: moderateScale(24),
753
- maxHeight: Dimensions.get('window').height * 0.85,
754
- minHeight: Dimensions.get('window').height * 0.4,
755
- paddingBottom: verticalScale(20),
756
- shadowColor: '#000',
757
- shadowOffset: { width: 0, height: -4 },
758
- shadowOpacity: 0.15,
759
- shadowRadius: 12,
760
- elevation: 8,
761
- overflow: 'hidden',
762
- },
763
- modalHeader: {
764
- flexDirection: 'row',
765
- justifyContent: 'space-between',
766
- alignItems: 'center',
767
- paddingHorizontal: scale(20),
768
- paddingTop: verticalScale(16),
769
- paddingBottom: verticalScale(5),
770
- borderBottomWidth: StyleSheet.hairlineWidth,
771
- borderBottomColor: 'rgba(0,0,0,0.08)',
772
- },
773
- modalTitle: {
774
- fontSize: RFValue(17),
775
- fontWeight: '700',
776
- flex: 1,
777
- letterSpacing: 0.2,
778
- },
779
- modalCloseButton: {
780
- width: scale(30),
781
- height: scale(30),
782
- borderRadius: scale(20),
783
- justifyContent: 'center',
784
- alignItems: 'center',
785
- marginLeft: scale(12),
786
- },
787
- modalScrollView: {
788
- paddingHorizontal: scale(20),
789
- paddingTop: verticalScale(16),
790
- },
791
- modalScrollContent: {
792
- paddingBottom: verticalScale(24),
793
- flexGrow: 1,
794
- },
795
- modalSection: {
796
- marginBottom: verticalScale(10),
797
- paddingBottom: verticalScale(16),
798
- borderBottomWidth: StyleSheet.hairlineWidth,
799
- borderBottomColor: 'rgba(0,0,0,0.06)',
800
- },
801
- modalFirstSection: {
802
- marginTop: 0,
803
- },
804
- modalSectionTitle: {
805
- fontSize: RFValue(15),
806
- fontWeight: '700',
807
- marginBottom: verticalScale(10),
808
- letterSpacing: 0.3,
809
- opacity: 0.9,
810
- },
811
- modalSectionValue: {
812
- fontSize: RFValue(15),
813
- lineHeight: RFValue(20),
814
- letterSpacing: 0.2,
815
- opacity: 0.85,
816
- },
817
- benefitRow: {
818
- flexDirection: 'row',
819
- alignItems: 'center',
820
- marginBottom: verticalScale(10),
821
- paddingRight: scale(8),
822
- paddingLeft: scale(4),
823
- },
824
- benefitBullet: {
825
- fontSize: RFValue(16),
826
- marginRight: scale(10),
827
- fontWeight: '600',
828
- },
829
- benefitText: {
830
- fontSize: RFValue(12),
831
- flex: 1,
832
- letterSpacing: 0.2,
833
- textTransform: 'capitalize',
834
- opacity: 0.85,
835
- },
836
- priceHighlightBox: {
837
- borderRadius: scale(16),
838
- padding: scale(20),
839
- alignItems: 'center',
840
- justifyContent: 'center',
841
- },
842
- modalPriceLabel: {
843
- fontSize: RFValue(12),
844
- fontWeight: '700',
845
- letterSpacing: 1.2,
846
- marginBottom: verticalScale(8),
847
- opacity: 0.7,
848
- },
849
- modalPriceValue: {
850
- fontSize: RFValue(36),
851
- fontWeight: '800',
852
- marginBottom: verticalScale(4),
853
- letterSpacing: -0.5,
854
- },
855
- modalPriceDuration: {
856
- fontSize: RFValue(14),
857
- fontWeight: '500',
858
- opacity: 0.7,
859
- },
860
- platformBadge: {
861
- alignSelf: 'flex-start',
862
- paddingHorizontal: scale(12),
863
- paddingVertical: verticalScale(8),
864
- borderRadius: scale(12),
865
- borderWidth: 1,
866
- borderColor: 'rgba(0,0,0,0.08)',
867
- },
868
- platformBadgeText: {
869
- fontSize: RFValue(12),
870
- fontWeight: '600',
871
- letterSpacing: 0.3,
872
- textTransform: 'capitalize',
873
- },
874
- });