@zezosoft/zezo-ott-react-native-ui-kit 1.3.6 → 1.3.7

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 (258) hide show
  1. package/README.md +40 -36
  2. package/package.json +1 -3
  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 -354
  41. package/src/components/Account/index.ts +0 -6
  42. package/src/components/Alert/AlertDialog.tsx +0 -253
  43. package/src/components/Alert/UAAlert.tsx +0 -176
  44. package/src/components/Alert/index.ts +0 -7
  45. package/src/components/Auth/AuthProvider/AuthProvider.tsx +0 -412
  46. package/src/components/Auth/One/ForgotPassword/ForgotPassword.tsx +0 -333
  47. package/src/components/Auth/One/Login/LoginWithEmail.tsx +0 -449
  48. package/src/components/Auth/One/Login/LoginWithPhone.tsx +0 -309
  49. package/src/components/Auth/One/OTP/OTP.tsx +0 -539
  50. package/src/components/Auth/One/QrLogin/QrLogin.tsx +0 -329
  51. package/src/components/Auth/One/QrLogin/components/index.ts +0 -8
  52. package/src/components/Auth/One/QrLogin/components/qr-scanner-fallback.tsx +0 -158
  53. package/src/components/Auth/One/QrLogin/components/qr-scanner-frame.tsx +0 -207
  54. package/src/components/Auth/One/QrLogin/components/qr-scanner-header.tsx +0 -65
  55. package/src/components/Auth/One/QrLogin/components/qr-scanner-intro.tsx +0 -255
  56. package/src/components/Auth/One/QrLogin/components/qr-scanner-overlay.tsx +0 -291
  57. package/src/components/Auth/One/SignUp/SignUp.tsx +0 -470
  58. package/src/components/Auth/One/SplashScreen/SplashScreen.tsx +0 -229
  59. package/src/components/Auth/One/SplashScreen/components/SplashImage/SplashImage.tsx +0 -92
  60. package/src/components/Auth/One/SplashScreen/components/SplashLottie/SplashLottie.tsx +0 -129
  61. package/src/components/Auth/One/SplashScreen/components/SplashVideo/SplashVideo.tsx +0 -172
  62. package/src/components/Auth/One/SplashScreen/utils/splashUtils.ts +0 -23
  63. package/src/components/Auth/One/index.ts +0 -24
  64. package/src/components/Auth/Two/AuthHeader/AuthHeader.tsx +0 -130
  65. package/src/components/Auth/Two/ForgotPassword/ForgotPassword.tsx +0 -331
  66. package/src/components/Auth/Two/Login/EmailOrPhoneLogin.tsx +0 -612
  67. package/src/components/Auth/Two/OTP/OTP.tsx +0 -504
  68. package/src/components/Auth/Two/SignUp/SignUp.tsx +0 -439
  69. package/src/components/Auth/Two/index.ts +0 -20
  70. package/src/components/Auth/index.ts +0 -16
  71. package/src/components/BackgroundLayout/One/One.tsx +0 -184
  72. package/src/components/BackgroundLayout/Two/Two.tsx +0 -65
  73. package/src/components/BackgroundLayout/index.ts +0 -14
  74. package/src/components/BlogView/BlogView.tsx +0 -282
  75. package/src/components/BlogView/index.ts +0 -8
  76. package/src/components/BlurView/BlurView.tsx +0 -199
  77. package/src/components/BlurView/index.ts +0 -7
  78. package/src/components/BottomSheet/BottomSheet.tsx +0 -204
  79. package/src/components/BottomSheet/BottomSheetOne.tsx +0 -223
  80. package/src/components/BottomSheet/index.ts +0 -9
  81. package/src/components/Button/BackBtn.tsx +0 -149
  82. package/src/components/Button/MenuBtn.tsx +0 -220
  83. package/src/components/Button/PrimaryBtn.tsx +0 -123
  84. package/src/components/Button/SecondaryBtn.tsx +0 -123
  85. package/src/components/Button/TextButton.tsx +0 -150
  86. package/src/components/Button/index.ts +0 -18
  87. package/src/components/Button/types.ts +0 -33
  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 -607
  91. package/src/components/Content/Card/Sliders/Styles/One.tsx +0 -490
  92. package/src/components/Content/Card/Sliders/Styles/Three.tsx +0 -1017
  93. package/src/components/Content/Card/Sliders/Styles/Two.tsx +0 -395
  94. package/src/components/Content/Card/Sliders/index.ts +0 -18
  95. package/src/components/Content/Card/Styles/Five.tsx +0 -367
  96. package/src/components/Content/Card/Styles/Four.tsx +0 -366
  97. package/src/components/Content/Card/Styles/One.tsx +0 -372
  98. package/src/components/Content/Card/Styles/RotateInOut.tsx +0 -413
  99. package/src/components/Content/Card/Styles/Six.tsx +0 -378
  100. package/src/components/Content/Card/Styles/Three.tsx +0 -312
  101. package/src/components/Content/Card/Styles/TopTen.tsx +0 -402
  102. package/src/components/Content/Card/Styles/Two.tsx +0 -404
  103. package/src/components/Content/Card/components/AdsPoster.tsx +0 -207
  104. package/src/components/Content/Card/components/CardPoster.tsx +0 -377
  105. package/src/components/Content/Card/components/LiveBadge.tsx +0 -125
  106. package/src/components/Content/Card/components/NavigateToMore.tsx +0 -97
  107. package/src/components/Content/Card/components/RentOrBuyIcon.tsx +0 -134
  108. package/src/components/Content/Card/components/ShowAllButton.tsx +0 -92
  109. package/src/components/Content/Card/components/ThumbnailCard.tsx +0 -219
  110. package/src/components/Content/Card/components/index.ts +0 -12
  111. package/src/components/Content/Card/index.ts +0 -31
  112. package/src/components/Content/Content.tsx +0 -338
  113. package/src/components/Content/Sections.tsx +0 -239
  114. package/src/components/Content/types.ts +0 -180
  115. package/src/components/ContentView/MoreContentList.tsx +0 -330
  116. package/src/components/ContentView/One/ContentViewOne.tsx +0 -251
  117. package/src/components/ContentView/One/components/CastCard.tsx +0 -266
  118. package/src/components/ContentView/One/components/HeroBanner.tsx +0 -413
  119. package/src/components/ContentView/One/components/MiniInfo.tsx +0 -343
  120. package/src/components/ContentView/One/components/Title.tsx +0 -149
  121. package/src/components/ContentView/Two/ContentViewTwo.tsx +0 -332
  122. package/src/components/ContentView/Two/components/Details.tsx +0 -196
  123. package/src/components/ContentView/Two/components/HeroBanner.tsx +0 -267
  124. package/src/components/ContentView/Two/components/LikeShareActions.tsx +0 -125
  125. package/src/components/ContentView/Two/components/MoreLikeThisContentList .tsx +0 -308
  126. package/src/components/ContentView/Two/components/PlayOrTrailer.tsx +0 -162
  127. package/src/components/ContentView/Two/components/SectionTabs.tsx +0 -181
  128. package/src/components/ContentView/Two/components/Title.tsx +0 -229
  129. package/src/components/ContentView/Two/components/index.ts +0 -12
  130. package/src/components/ContentView/index.ts +0 -13
  131. package/src/components/ContentView/shared/AboutSection.tsx +0 -226
  132. package/src/components/ContentView/shared/EpisodeCard.tsx +0 -600
  133. package/src/components/ContentView/shared/GenreTags.tsx +0 -189
  134. package/src/components/ContentView/shared/PlayButton.tsx +0 -52
  135. package/src/components/ContentView/shared/TrailerButton.tsx +0 -76
  136. package/src/components/Fallbacks/NoContentFallback.tsx +0 -175
  137. package/src/components/Fallbacks/NotFoundFallback.tsx +0 -94
  138. package/src/components/Fallbacks/index.ts +0 -7
  139. package/src/components/Headers/AppHeader.tsx +0 -151
  140. package/src/components/Headers/Four.tsx +0 -84
  141. package/src/components/Headers/One.tsx +0 -115
  142. package/src/components/Headers/Three.tsx +0 -137
  143. package/src/components/Headers/Two.tsx +0 -101
  144. package/src/components/Headers/index.ts +0 -34
  145. package/src/components/Input/Input.ts +0 -18
  146. package/src/components/Input/InputOne.tsx +0 -265
  147. package/src/components/Input/InputThree.tsx +0 -205
  148. package/src/components/Input/InputTwo.tsx +0 -217
  149. package/src/components/Input/PhoneInput/One/One.tsx +0 -415
  150. package/src/components/Input/PhoneInput/Two/Two.tsx +0 -406
  151. package/src/components/Input/PhoneInput/index.ts +0 -14
  152. package/src/components/Keyboard/HideKeyboard.tsx +0 -91
  153. package/src/components/Loader/Loader.tsx +0 -49
  154. package/src/components/Logo/Logo.tsx +0 -150
  155. package/src/components/NewRelease/NewReleaseSheet.tsx +0 -260
  156. package/src/components/NewRelease/index.ts +0 -6
  157. package/src/components/Reels/ReelsSeries/MediaControls/BottomControls.tsx +0 -226
  158. package/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.tsx +0 -324
  159. package/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.tsx +0 -201
  160. package/src/components/Reels/ReelsSeries/MediaControls/RightControls.tsx +0 -100
  161. package/src/components/Reels/ReelsSeries/MediaControls/TopControls.tsx +0 -168
  162. package/src/components/Reels/ReelsSeries/Model/DetailsModal.tsx +0 -207
  163. package/src/components/Reels/ReelsSeries/Model/SettingModal.tsx +0 -151
  164. package/src/components/Reels/ReelsSeries/Model/UnlockModal.tsx +0 -159
  165. package/src/components/Reels/ReelsSeries/ReelsSeries.tsx +0 -278
  166. package/src/components/Reels/ReelsSeries/ReelsSeriesItem.tsx +0 -569
  167. package/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.tsx +0 -189
  168. package/src/components/Reels/ReelsSeries/components/Episodes.tsx +0 -159
  169. package/src/components/Reels/ReelsSeries/components/GradientOverlay.tsx +0 -46
  170. package/src/components/Reels/ReelsSeries/components/Like.tsx +0 -45
  171. package/src/components/Reels/ReelsSeries/components/RotatingLoader.tsx +0 -84
  172. package/src/components/Reels/ReelsSeries/components/Synopsis.tsx +0 -338
  173. package/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.tsx +0 -185
  174. package/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.tsx +0 -77
  175. package/src/components/Reels/ReelsSeries/components/VideoControls/index.ts +0 -7
  176. package/src/components/Reels/ReelsSeries/types.ts +0 -78
  177. package/src/components/Reels/ReelsSeries/useReelsWatchProgress.ts +0 -90
  178. package/src/components/Reels/ReelsSeries/utils/quality.ts +0 -72
  179. package/src/components/Reels/index.ts +0 -9
  180. package/src/components/Reels/utils/Controls/gestureUtils.ts +0 -46
  181. package/src/components/Reels/utils/Controls/index.ts +0 -9
  182. package/src/components/Reels/utils/Controls/overlayUtils.ts +0 -40
  183. package/src/components/Reels/utils/Controls/videoControlsConstants.ts +0 -30
  184. package/src/components/Reels/utils/Controls/videoRef.ts +0 -9
  185. package/src/components/Reels/utils/index.ts +0 -6
  186. package/src/components/Reels/utils/timeoutUtils.ts +0 -34
  187. package/src/components/Search/One.tsx +0 -262
  188. package/src/components/Search/components/RecentSearchesSection.tsx +0 -181
  189. package/src/components/Search/components/SearchCard.tsx +0 -285
  190. package/src/components/Search/index.ts +0 -16
  191. package/src/components/Settings/AppSettings.tsx +0 -442
  192. package/src/components/Settings/index.ts +0 -6
  193. package/src/components/Subscription/SubOne.tsx +0 -423
  194. package/src/components/Subscription/components/SubsDetailsModal.tsx +0 -347
  195. package/src/components/Subscription/components/SubscriptionCard.tsx +0 -342
  196. package/src/components/Subscription/index.ts +0 -12
  197. package/src/components/TabBar/One.tsx +0 -145
  198. package/src/components/TabBar/Three.tsx +0 -162
  199. package/src/components/TabBar/Two.tsx +0 -179
  200. package/src/components/TabBar/index.ts +0 -20
  201. package/src/components/Text/Text.tsx +0 -90
  202. package/src/components/Text/index.ts +0 -6
  203. package/src/components/User/DeviceSessions/DeviceSessions.tsx +0 -468
  204. package/src/components/User/ProfileUpdate/ProfileUpdate.tsx +0 -293
  205. package/src/components/User/PurchaseHistory/PurchaseHistory.tsx +0 -504
  206. package/src/components/User/WatchHistory/WatchHistory.tsx +0 -214
  207. package/src/components/User/WatchLater/WatchLater.tsx +0 -400
  208. package/src/components/User/components/UserAvatar.tsx +0 -121
  209. package/src/components/User/components/UserSection.tsx +0 -218
  210. package/src/components/User/index.ts +0 -18
  211. package/src/components/View/View.tsx +0 -38
  212. package/src/components/View/index.ts +0 -6
  213. package/src/components/common/AppStatusBar.tsx +0 -57
  214. package/src/components/common/index.ts +0 -1
  215. package/src/components/index.ts +0 -30
  216. package/src/components/layout/SafeAreaWrapper.tsx +0 -50
  217. package/src/components/layout/index.ts +0 -6
  218. package/src/constants/dummySections.ts +0 -103
  219. package/src/hooks/Images/index.ts +0 -6
  220. package/src/hooks/Images/useImageLoader.ts +0 -209
  221. package/src/hooks/index.ts +0 -16
  222. package/src/hooks/useAdTracking.ts +0 -354
  223. package/src/hooks/useCards.ts +0 -247
  224. package/src/hooks/useDebounce.ts +0 -40
  225. package/src/hooks/useKeyboard.ts +0 -43
  226. package/src/hooks/useNavigationMode.ts +0 -48
  227. package/src/hooks/usePaginatedSection.ts +0 -108
  228. package/src/hooks/usePrevious.ts +0 -28
  229. package/src/hooks/useSafeCallback.ts +0 -29
  230. package/src/hooks/useSkeletonItems.ts +0 -30
  231. package/src/hooks/useSplashCache.ts +0 -245
  232. package/src/index.tsx +0 -9
  233. package/src/store/RecentSearchesStore.ts +0 -72
  234. package/src/store/splashStore.ts +0 -86
  235. package/src/store/storage.ts +0 -29
  236. package/src/theme/ThemeContext.ts +0 -19
  237. package/src/theme/ThemeProvider.tsx +0 -87
  238. package/src/theme/hooks/index.ts +0 -6
  239. package/src/theme/hooks/useTheme.ts +0 -118
  240. package/src/theme/index.ts +0 -8
  241. package/src/theme/store/theme.ts +0 -50
  242. package/src/theme/themes.ts +0 -262
  243. package/src/theme/utils/cleanColors.ts +0 -71
  244. package/src/theme/utils/toRgba.ts +0 -150
  245. package/src/types/content/content-view.types.ts +0 -209
  246. package/src/types/hook/index.ts +0 -6
  247. package/src/types/hook/usePaginatedSection.ts +0 -20
  248. package/src/types/index.ts +0 -10
  249. package/src/types/navigation.ts +0 -17
  250. package/src/types/sections/index.ts +0 -87
  251. package/src/types/user.ts +0 -18
  252. package/src/utils/Display.ts +0 -15
  253. package/src/utils/Formater.ts +0 -33
  254. package/src/utils/SizeMatters.ts +0 -8
  255. package/src/utils/Spacing.ts +0 -27
  256. package/src/utils/colorUtils.ts +0 -70
  257. package/src/utils/imageValidation.ts +0 -36
  258. package/src/utils/interaction.ts +0 -19
@@ -1,1017 +0,0 @@
1
- /**
2
- * @author Naresh Dhamu
3
- * @LastModified Mon 13 Jul 2026 at 10:13 AM
4
- */
5
-
6
- import {
7
- StyleSheet,
8
- TouchableOpacity,
9
- View,
10
- useWindowDimensions,
11
- type AccessibilityProps,
12
- } from 'react-native';
13
- import React, {
14
- memo,
15
- useCallback,
16
- useEffect,
17
- useMemo,
18
- useRef,
19
- useState,
20
- } from 'react';
21
- import LinearGradient from 'react-native-linear-gradient';
22
- import { moderateScale, verticalScale } from 'react-native-size-matters';
23
- import Animated, {
24
- Extrapolation,
25
- interpolate,
26
- runOnJS,
27
- useAnimatedReaction,
28
- useAnimatedScrollHandler,
29
- useAnimatedStyle,
30
- useSharedValue,
31
- type SharedValue,
32
- } from 'react-native-reanimated';
33
- import FastImage, { type ImageStyle } from 'react-native-fast-image';
34
- import { ActivityIndicator } from 'react-native';
35
- import { Play, Plus, CheckCircle2, Info } from 'lucide-react-native';
36
- import { Text } from '../../../../Text';
37
- import type { IContentData } from '@zezosoft/zezo-ott-api-client';
38
- import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
39
- import type { ISectionContent } from '../../../../../types';
40
- import type { ITheme, ThemeOverride } from '../../../../../theme/themes';
41
- import { useTheme } from '../../../../../theme';
42
- import { AppStatusBar } from '../../../../common/AppStatusBar';
43
- import type { ListViewToken } from 'react-native';
44
-
45
- type SkeletonItem = {
46
- _id: string;
47
- isSkeleton: true;
48
- };
49
-
50
- const SkeletonGradient = memo<{ theme: ITheme }>(({ theme }) => {
51
- const gradients = [
52
- {
53
- colors: [theme.colors.background, 'rgba(0,0,0,0)'],
54
- style: {
55
- top: 0,
56
- height: verticalScale(SLIDER_HEIGHT) / GRADIENT_DIVIDER_BOTTOM,
57
- },
58
- },
59
- {
60
- colors: ['rgba(0,0,0,0)', theme.colors.background],
61
- style: { bottom: 0 },
62
- },
63
- ];
64
-
65
- return (
66
- <>
67
- {gradients.map((g, i) => (
68
- <LinearGradient
69
- key={i}
70
- colors={g.colors}
71
- pointerEvents="none"
72
- style={[StyleSheet.absoluteFill, g.style]}
73
- />
74
- ))}
75
- </>
76
- );
77
- });
78
-
79
- SkeletonGradient.displayName = 'SkeletonGradient';
80
-
81
- const S = SkeletonPlaceholder.Item;
82
-
83
- const ContentInfoSkeleton = memo<{ theme: ITheme }>(({ theme }) => {
84
- const circle = moderateScale(44);
85
-
86
- return (
87
- <View
88
- style={[
89
- styles.contentInfoContainer,
90
- { backgroundColor: theme.colors.background },
91
- ]}
92
- >
93
- <SkeletonPlaceholder
94
- backgroundColor={theme.colors.skeletonBaseColor}
95
- highlightColor={theme.colors.skeletonHighlightColor}
96
- >
97
- <S
98
- width={moderateScale(140)}
99
- height={moderateScale(10)}
100
- borderRadius={6}
101
- alignSelf="center"
102
- marginBottom={verticalScale(18)}
103
- />
104
- <S
105
- height={verticalScale(60)}
106
- justifyContent="center"
107
- alignItems="center"
108
- >
109
- <S
110
- width={circle}
111
- height={circle}
112
- borderRadius={circle / 2}
113
- position="absolute"
114
- left={moderateScale(16)}
115
- />
116
- <S
117
- width={moderateScale(140)}
118
- height={verticalScale(48)}
119
- borderRadius={6}
120
- />
121
- <S
122
- width={circle}
123
- height={circle}
124
- borderRadius={circle / 2}
125
- position="absolute"
126
- right={moderateScale(16)}
127
- />
128
- </S>
129
- </SkeletonPlaceholder>
130
- </View>
131
- );
132
- });
133
-
134
- ContentInfoSkeleton.displayName = 'ContentInfoSkeleton';
135
-
136
- const SLIDER_HEIGHT = 370;
137
- const TITLE_IMAGE_HEIGHT = 55;
138
- const TITLE_IMAGE_WIDTH_PERCENT = '80%';
139
- const AUTO_PLAY_INTERVAL = 5000;
140
- const LOOP_MULTIPLIER = 3;
141
- const VIEWABILITY_THRESHOLD = 50;
142
- const GRADIENT_DIVIDER_BOTTOM = 2;
143
- const GRADIENT_DIVIDER_TOP = 1.1;
144
-
145
- type SliderThreeProps = {
146
- index?: number;
147
- data: ISectionContent | null;
148
- onPressItem?: (item: IContentData) => void;
149
- isLoading?: boolean;
150
- theme?: ThemeOverride;
151
- onToggleWatchlist?: (
152
- item: IContentData,
153
- { isFavorite }: { isFavorite: boolean }
154
- ) => void;
155
- checkWatchlistStatus?: (
156
- itemIds: string[]
157
- ) => Record<string, boolean> | Promise<Record<string, boolean>>;
158
- } & AccessibilityProps;
159
-
160
- type BackImageProps = {
161
- item: IContentData | SkeletonItem;
162
- index: number;
163
- x: SharedValue<number>;
164
- theme: ITheme;
165
- sliderDataLength: number;
166
- width: number;
167
- };
168
-
169
- type GradientProps = {
170
- theme: ITheme;
171
- };
172
-
173
- type RenderItemProps = {
174
- item: IContentData | SkeletonItem;
175
- index: number;
176
- x: SharedValue<number>;
177
- theme: ITheme;
178
- };
179
-
180
- type ContentInfoProps = {
181
- theme: ITheme;
182
- item: IContentData;
183
- onPressItem?: (item: IContentData) => void;
184
- isFavorite?: boolean;
185
- onToggleWatchlist?: (
186
- item: IContentData,
187
- { isFavorite }: { isFavorite: boolean }
188
- ) => void;
189
- };
190
-
191
- const SliderThree: React.FC<SliderThreeProps> = ({
192
- index = 0,
193
- data,
194
- onPressItem,
195
- isLoading = false,
196
- theme,
197
- onToggleWatchlist,
198
- checkWatchlistStatus,
199
- accessibilityLabel = 'Netflix style slider',
200
- accessibilityHint = 'Swipe to view content',
201
- }) => {
202
- const { width } = useWindowDimensions();
203
- const { theme: appliedTheme } = useTheme(theme);
204
- const scrollX = useSharedValue(0);
205
- const flatListRef =
206
- useRef<Animated.FlatList<IContentData | SkeletonItem>>(null);
207
-
208
- const autoPlayIntervalRef = useRef<NodeJS.Timeout | null>(null);
209
- const currentIndexRef = useRef(0);
210
- const isDraggingRef = useRef(false);
211
- const watchlistCache = useRef<Map<string, boolean>>(new Map());
212
- const isCheckingRef = useRef<boolean>(false);
213
- const [isInWatchlist, setIsInWatchlist] = useState<boolean>(false);
214
- const skeletonItems = useMemo<SkeletonItem[]>(
215
- () =>
216
- Array.from({ length: 3 }).map((_, i) => ({
217
- _id: `skeleton-${i}`,
218
- isSkeleton: true,
219
- })),
220
- []
221
- );
222
-
223
- const sliderData = useMemo<(IContentData | SkeletonItem)[]>(() => {
224
- if (isLoading) return skeletonItems;
225
-
226
- return (data?.data ?? []).filter(
227
- (item): item is IContentData => !('type' in item && item.type === 'ads')
228
- );
229
- }, [data, isLoading, skeletonItems]);
230
-
231
- const [displayIndex, setDisplayIndex] = useState(0);
232
-
233
- // Sync watchlist status for current display item
234
- useEffect(() => {
235
- const item = sliderData[displayIndex];
236
- if (!item || 'isSkeleton' in item || !item._id) {
237
- return;
238
- }
239
-
240
- // Update from cache immediately
241
- setIsInWatchlist(watchlistCache.current.get(item._id) ?? false);
242
-
243
- // Fetch uncached items if checkWatchlistStatus is available
244
- if (
245
- !checkWatchlistStatus ||
246
- sliderData.length === 0 ||
247
- isCheckingRef.current
248
- ) {
249
- return;
250
- }
251
-
252
- const itemIds = sliderData
253
- .filter((i): i is IContentData => i !== null && !!i._id)
254
- .map((i) => i._id);
255
-
256
- if (itemIds.length === 0) {
257
- return;
258
- }
259
-
260
- const uncachedIds = itemIds.filter((id) => !watchlistCache.current.has(id));
261
-
262
- if (uncachedIds.length === 0) {
263
- return;
264
- }
265
-
266
- isCheckingRef.current = true;
267
- (async () => {
268
- try {
269
- const result = checkWatchlistStatus(uncachedIds);
270
- const statusResult = result instanceof Promise ? await result : result;
271
- Object.entries(statusResult)?.forEach?.(([itemId, status]) => {
272
- watchlistCache.current.set(itemId, status);
273
- });
274
- // Update current item status after fetch
275
- if (sliderData[displayIndex]?._id) {
276
- setIsInWatchlist(
277
- watchlistCache.current.get(sliderData[displayIndex]._id) ?? false
278
- );
279
- }
280
- } catch (error) {
281
- console.error('Error checking watchlist status:', error);
282
- uncachedIds?.forEach?.((id) => watchlistCache.current.set(id, false));
283
- if (sliderData[displayIndex]?._id) {
284
- setIsInWatchlist(false);
285
- }
286
- } finally {
287
- isCheckingRef.current = false;
288
- }
289
- })();
290
- }, [sliderData, checkWatchlistStatus, displayIndex]);
291
-
292
- const infiniteData = useMemo(() => {
293
- if (!sliderData.length) return [];
294
-
295
- if (isLoading) return sliderData;
296
-
297
- return Array.from({ length: LOOP_MULTIPLIER }).flatMap(() => sliderData);
298
- }, [sliderData, isLoading]);
299
-
300
- const initialScrollIndex = useMemo(
301
- () => (isLoading ? 0 : sliderData.length),
302
- [isLoading, sliderData.length]
303
- );
304
-
305
- const [autoPlay, setAutoPlay] = useState(true);
306
-
307
- const normalizeIndex = useCallback(
308
- (idx: number) => (sliderData.length ? idx % sliderData.length : 0),
309
- [sliderData.length]
310
- );
311
-
312
- const resetToMiddleSection = useCallback(() => {
313
- const totalItems = sliderData.length;
314
- const rawIndex = currentIndexRef.current;
315
- const maxIndex = infiniteData.length - 1;
316
-
317
- if (rawIndex < totalItems || rawIndex >= totalItems * 2) {
318
- const middleIndex = totalItems + normalizeIndex(rawIndex);
319
- if (middleIndex >= 0 && middleIndex <= maxIndex && flatListRef.current) {
320
- flatListRef.current.scrollToIndex({
321
- index: middleIndex,
322
- animated: false,
323
- });
324
- currentIndexRef.current = middleIndex;
325
- }
326
- }
327
- }, [sliderData.length, normalizeIndex, infiniteData.length]);
328
-
329
- const onViewableItemsChangedRef = useRef<
330
- ({ viewableItems }: { viewableItems: ListViewToken[] }) => void
331
- >(() => {});
332
-
333
- const onViewableItemsChanged = useCallback(
334
- ({ viewableItems }: { viewableItems: ListViewToken[] }) => {
335
- if (!viewableItems.length) return;
336
-
337
- const rawIndex = viewableItems[0]?.index ?? 0;
338
- currentIndexRef.current = rawIndex;
339
- setDisplayIndex(normalizeIndex(rawIndex));
340
- },
341
- [normalizeIndex]
342
- );
343
-
344
- useEffect(() => {
345
- onViewableItemsChangedRef.current = onViewableItemsChanged;
346
- }, [onViewableItemsChanged]);
347
-
348
- const stableOnViewableItemsChanged = useCallback(
349
- ({ viewableItems }: { viewableItems: ListViewToken[] }) => {
350
- onViewableItemsChangedRef.current?.({ viewableItems });
351
- },
352
- []
353
- );
354
-
355
- const viewabilityConfigCallbackPairs = useRef([
356
- {
357
- viewabilityConfig: {
358
- itemVisiblePercentThreshold: VIEWABILITY_THRESHOLD,
359
- waitForInteraction: false,
360
- },
361
- onViewableItemsChanged: stableOnViewableItemsChanged,
362
- },
363
- ]);
364
-
365
- const onScroll = useAnimatedScrollHandler({
366
- onScroll: (event) => {
367
- scrollX.value = event.contentOffset.x;
368
- },
369
- });
370
-
371
- useAnimatedReaction(
372
- () => scrollX.value,
373
- (scrollXVal) => {
374
- const len = sliderData.length;
375
- if (len === 0 || width <= 0) return;
376
- const raw = Math.round(scrollXVal / width);
377
- const normalized = ((raw % len) + len) % len;
378
- runOnJS(setDisplayIndex)(normalized);
379
- },
380
- [width, sliderData.length]
381
- );
382
-
383
- const handleScrollBeginDrag = useCallback(() => {
384
- setAutoPlay(false);
385
- isDraggingRef.current = true;
386
- }, []);
387
-
388
- const handleMomentumScrollEnd = useCallback(() => {
389
- isDraggingRef.current = false;
390
- resetToMiddleSection();
391
- setAutoPlay(true);
392
- }, [resetToMiddleSection]);
393
- const handleToggleWatchlist = useCallback(
394
- async (item: IContentData, { isFavorite }: { isFavorite: boolean }) => {
395
- if (!item._id) return;
396
-
397
- const newStatus = !isFavorite;
398
- setIsInWatchlist(newStatus);
399
- watchlistCache.current.set(item._id, newStatus);
400
-
401
- try {
402
- if (onToggleWatchlist) {
403
- await onToggleWatchlist(item, { isFavorite });
404
- }
405
- } catch (error) {
406
- console.error('Error toggling watchlist:', error);
407
- const revertedStatus = isFavorite;
408
- setIsInWatchlist(revertedStatus);
409
- watchlistCache.current.set(item._id, revertedStatus);
410
- }
411
- },
412
- [onToggleWatchlist]
413
- );
414
-
415
- // Initial scroll position sync
416
- useEffect(() => {
417
- if (sliderData.length > 0) {
418
- currentIndexRef.current = initialScrollIndex;
419
- if (!isLoading && width > 0) scrollX.value = initialScrollIndex * width;
420
- }
421
- if (!sliderData.length) return;
422
- const t = setTimeout(() => {
423
- setDisplayIndex(normalizeIndex(currentIndexRef.current));
424
- }, 150);
425
- return () => clearTimeout(t);
426
- }, [
427
- sliderData.length,
428
- initialScrollIndex,
429
- isLoading,
430
- width,
431
- normalizeIndex,
432
- scrollX,
433
- ]);
434
-
435
- useEffect(() => {
436
- onViewableItemsChangedRef.current = onViewableItemsChanged;
437
- }, [onViewableItemsChanged]);
438
-
439
- // Auto-play interval + image preload
440
- useEffect(() => {
441
- if (isLoading || sliderData.length === 0) return;
442
-
443
- const preloadId = setTimeout(() => {
444
- const uris: string[] = [];
445
- const indices = [
446
- displayIndex,
447
- (displayIndex - 1 + sliderData.length) % sliderData.length,
448
- (displayIndex + 1) % sliderData.length,
449
- ];
450
- for (const i of indices) {
451
- const slideItem = sliderData[i];
452
- if (slideItem && !('isSkeleton' in slideItem)) {
453
- const poster = slideItem.poster?.trim?.();
454
- if (poster?.length) uris.push(poster);
455
- const title = slideItem.title_image?.trim?.();
456
- if (title?.length) uris.push(title);
457
- }
458
- }
459
- if (uris.length > 0) FastImage.preload(uris.map((uri) => ({ uri })));
460
- }, 0);
461
-
462
- if (!autoPlay || sliderData.length <= 1) {
463
- return () => clearTimeout(preloadId);
464
- }
465
- autoPlayIntervalRef.current = setInterval(() => {
466
- if (!isDraggingRef.current && flatListRef.current) {
467
- const nextIndex = currentIndexRef.current + 1;
468
- const maxIndex = infiniteData.length - 1;
469
- if (nextIndex >= 0 && nextIndex <= maxIndex) {
470
- flatListRef.current.scrollToIndex({
471
- index: nextIndex,
472
- animated: true,
473
- });
474
- }
475
- }
476
- }, AUTO_PLAY_INTERVAL);
477
- return () => {
478
- clearTimeout(preloadId);
479
- if (autoPlayIntervalRef.current) {
480
- clearInterval(autoPlayIntervalRef.current);
481
- }
482
- };
483
- }, [
484
- autoPlay,
485
- sliderData.length,
486
- infiniteData.length,
487
- displayIndex,
488
- sliderData,
489
- isLoading,
490
- ]);
491
-
492
- const renderItem = useCallback(
493
- ({
494
- item: listItem,
495
- index: itemIndex,
496
- }: {
497
- item: IContentData | SkeletonItem;
498
- index: number;
499
- }) => (
500
- <RenderItem
501
- item={listItem}
502
- index={itemIndex}
503
- x={scrollX}
504
- theme={appliedTheme}
505
- />
506
- ),
507
- [scrollX, appliedTheme]
508
- );
509
-
510
- const keyExtractor = useCallback(
511
- (listItem: IContentData | SkeletonItem, i: number) =>
512
- `item-${listItem._id ?? i}-${i}`,
513
- []
514
- );
515
-
516
- const getItemLayout = useCallback(
517
- (
518
- _: ArrayLike<IContentData | SkeletonItem> | null | undefined,
519
- i: number
520
- ) => ({
521
- length: width,
522
- offset: width * i,
523
- index: i,
524
- }),
525
- [width]
526
- );
527
-
528
- const backImageList = useMemo(() => {
529
- return sliderData.map((item, i) => (
530
- <BackImage
531
- key={`bg-${i}-${index}`}
532
- item={item}
533
- index={i}
534
- x={scrollX}
535
- theme={appliedTheme}
536
- sliderDataLength={sliderData.length}
537
- width={width}
538
- />
539
- ));
540
- }, [sliderData, index, scrollX, appliedTheme, width]);
541
-
542
- if (!data) {
543
- return null;
544
- }
545
-
546
- return (
547
- <View
548
- style={styles.container}
549
- accessibilityLabel={accessibilityLabel}
550
- accessibilityHint={accessibilityHint}
551
- >
552
- <AppStatusBar theme={theme} transparent={true} />
553
-
554
- {backImageList}
555
-
556
- <Gradient theme={appliedTheme} />
557
-
558
- <Animated.FlatList
559
- ref={flatListRef}
560
- data={infiniteData}
561
- style={styles.sliderList}
562
- horizontal
563
- pagingEnabled
564
- bounces={false}
565
- showsHorizontalScrollIndicator={false}
566
- initialScrollIndex={initialScrollIndex}
567
- getItemLayout={getItemLayout}
568
- onScroll={onScroll}
569
- scrollEventThrottle={16}
570
- viewabilityConfigCallbackPairs={viewabilityConfigCallbackPairs.current}
571
- onScrollBeginDrag={handleScrollBeginDrag}
572
- onMomentumScrollEnd={handleMomentumScrollEnd}
573
- renderItem={renderItem}
574
- keyExtractor={keyExtractor}
575
- removeClippedSubviews={true}
576
- maxToRenderPerBatch={5}
577
- windowSize={5}
578
- initialNumToRender={3}
579
- updateCellsBatchingPeriod={100}
580
- />
581
-
582
- {isLoading ? (
583
- <ContentInfoSkeleton theme={appliedTheme} />
584
- ) : (
585
- sliderData[displayIndex] &&
586
- !('isSkeleton' in sliderData[displayIndex]) && (
587
- <ContentInfo
588
- theme={appliedTheme}
589
- item={sliderData[displayIndex]}
590
- onPressItem={onPressItem}
591
- isFavorite={isInWatchlist}
592
- onToggleWatchlist={handleToggleWatchlist}
593
- />
594
- )
595
- )}
596
- </View>
597
- );
598
- };
599
-
600
- export default memo(SliderThree);
601
-
602
- const BackImage = memo<BackImageProps>(
603
- ({ item, index, x, theme, sliderDataLength, width }) => {
604
- const [loadError, setLoadError] = useState(false);
605
- const isSkeleton = 'isSkeleton' in item && item.isSkeleton;
606
- const posterUri = isSkeleton
607
- ? ''
608
- : ((item as IContentData).poster?.trim?.() ?? '');
609
- const hasValidUri = posterUri.length > 0;
610
- const prevPosterUriRef = useRef(posterUri);
611
-
612
- const handleLoad = useCallback(() => setLoadError(false), []);
613
- const handleError = useCallback(() => setLoadError(true), []);
614
-
615
- useEffect(() => {
616
- if (prevPosterUriRef.current !== posterUri) {
617
- prevPosterUriRef.current = posterUri;
618
- setLoadError(false);
619
- }
620
- if (!loadError || !hasValidUri) return;
621
- const id = setTimeout(() => setLoadError(false), 1000);
622
- return () => clearTimeout(id);
623
- }, [posterUri, loadError, hasValidUri]);
624
-
625
- const animatedStyle = useAnimatedStyle(() => {
626
- 'worklet';
627
- if (sliderDataLength <= 0 || width <= 0) {
628
- return { opacity: index === 0 ? 1 : 0 };
629
- }
630
-
631
- const scrollIndex = x.value / width;
632
- const normalizedIndex =
633
- ((Math.round(scrollIndex) % sliderDataLength) + sliderDataLength) %
634
- sliderDataLength;
635
-
636
- // Show full opacity for current item
637
- if (normalizedIndex === index) {
638
- return { opacity: 1 };
639
- }
640
-
641
- // Calculate smooth transition for adjacent slides
642
- const normalizedScroll =
643
- ((scrollIndex % sliderDataLength) + sliderDataLength) %
644
- sliderDataLength;
645
- let distance = Math.abs(normalizedScroll - index);
646
-
647
- // Handle wrap-around
648
- if (distance > sliderDataLength / 2) {
649
- distance = sliderDataLength - distance;
650
- }
651
-
652
- // Fade adjacent images (within 1 slide)
653
- if (distance <= 1) {
654
- return { opacity: Math.max(0, 1 - distance) };
655
- }
656
-
657
- return { opacity: 0 };
658
- });
659
-
660
- const containerStyle = [
661
- StyleSheet.absoluteFill,
662
- {
663
- width,
664
- height: verticalScale(SLIDER_HEIGHT),
665
- },
666
- animatedStyle,
667
- ];
668
-
669
- if (isSkeleton) {
670
- return (
671
- <Animated.View style={containerStyle}>
672
- <View
673
- style={[
674
- StyleSheet.absoluteFill,
675
- {
676
- width,
677
- height: verticalScale(SLIDER_HEIGHT),
678
- backgroundColor: theme.colors.black,
679
- },
680
- ]}
681
- >
682
- <SkeletonPlaceholder
683
- backgroundColor={theme.colors.skeletonBaseColor}
684
- highlightColor={theme.colors.skeletonHighlightColor}
685
- >
686
- <SkeletonPlaceholder.Item
687
- width={width}
688
- height={verticalScale(SLIDER_HEIGHT)}
689
- />
690
- </SkeletonPlaceholder>
691
- </View>
692
- </Animated.View>
693
- );
694
- }
695
-
696
- return (
697
- <Animated.View style={containerStyle}>
698
- {hasValidUri && !loadError && (
699
- <FastImage
700
- key={`poster-${item._id}-${posterUri}`}
701
- source={{
702
- uri: posterUri,
703
- priority: FastImage.priority.normal,
704
- cache: FastImage.cacheControl.immutable,
705
- }}
706
- style={[
707
- StyleSheet.absoluteFill as ImageStyle,
708
- {
709
- width,
710
- height: verticalScale(SLIDER_HEIGHT),
711
- backgroundColor: theme.colors.black,
712
- } as ImageStyle,
713
- ]}
714
- resizeMode={FastImage.resizeMode.cover}
715
- onLoad={handleLoad}
716
- onError={handleError}
717
- />
718
- )}
719
- {(!hasValidUri || loadError) && (
720
- <View
721
- style={[
722
- StyleSheet.absoluteFill,
723
- {
724
- width,
725
- height: verticalScale(SLIDER_HEIGHT),
726
- backgroundColor: theme.colors.black,
727
- },
728
- ]}
729
- />
730
- )}
731
- </Animated.View>
732
- );
733
- }
734
- );
735
-
736
- BackImage.displayName = 'BackImage';
737
-
738
- const Gradient = memo<GradientProps>(({ theme }) => {
739
- const { width } = useWindowDimensions();
740
- const sliderHeight = verticalScale(SLIDER_HEIGHT);
741
- const bottomGradientHeight =
742
- verticalScale(SLIDER_HEIGHT) / GRADIENT_DIVIDER_TOP + 2;
743
-
744
- return (
745
- <View
746
- pointerEvents="none"
747
- style={[styles.gradientContainer, { width, height: sliderHeight + 1 }]}
748
- >
749
- <LinearGradient
750
- colors={[theme.colors.background, 'rgba(0,0,0,0)']}
751
- style={styles.gradientBottom}
752
- pointerEvents="none"
753
- />
754
- <LinearGradient
755
- colors={['rgba(0,0,0,0)', theme.colors.background]}
756
- style={[styles.gradientTop, { height: bottomGradientHeight }]}
757
- pointerEvents="none"
758
- />
759
- </View>
760
- );
761
- });
762
-
763
- Gradient.displayName = 'Gradient';
764
-
765
- const RenderItem = memo<RenderItemProps>(({ item, index, x, theme }) => {
766
- const { width } = useWindowDimensions();
767
- const titleUri =
768
- 'isSkeleton' in item ? '' : (item.title_image?.trim?.() ?? '');
769
- const hasTitleUri = titleUri.length > 0;
770
- const [titleLoadError, setTitleLoadError] = useState(false);
771
-
772
- useEffect(() => {
773
- setTitleLoadError(false);
774
- }, [titleUri]);
775
-
776
- const handleTitleLoad = useCallback(() => setTitleLoadError(false), []);
777
- const handleTitleError = useCallback(() => setTitleLoadError(true), []);
778
-
779
- const animatedStyle = useAnimatedStyle(() => ({
780
- opacity: interpolate(
781
- x.value,
782
- [(index - 1) * width, index * width, (index + 1) * width],
783
- [-0.5, 1, -0.5],
784
- Extrapolation.CLAMP
785
- ),
786
- }));
787
-
788
- if ('isSkeleton' in item) {
789
- const skeletonContainerStyle = {
790
- width,
791
- height: verticalScale(SLIDER_HEIGHT),
792
- position: 'relative' as const,
793
- overflow: 'hidden' as const,
794
- };
795
-
796
- return (
797
- <View style={skeletonContainerStyle}>
798
- <SkeletonPlaceholder
799
- backgroundColor={theme.colors.skeletonBaseColor}
800
- highlightColor={theme.colors.skeletonHighlightColor}
801
- >
802
- <SkeletonPlaceholder.Item
803
- width={width}
804
- height={verticalScale(SLIDER_HEIGHT)}
805
- />
806
- </SkeletonPlaceholder>
807
-
808
- <SkeletonGradient theme={theme} />
809
- </View>
810
- );
811
- }
812
-
813
- return (
814
- <View style={{ width, height: verticalScale(SLIDER_HEIGHT) }}>
815
- {hasTitleUri && !titleLoadError && (
816
- <Animated.View style={[styles.titleImage, animatedStyle]}>
817
- <FastImage
818
- key={`title-${item._id}-${titleUri}`}
819
- source={{
820
- uri: titleUri,
821
- priority: FastImage.priority.normal,
822
- cache: FastImage.cacheControl.immutable,
823
- }}
824
- style={{ width: '100%', height: '100%' } as ImageStyle}
825
- resizeMode={FastImage.resizeMode.contain}
826
- onLoad={handleTitleLoad}
827
- onError={handleTitleError}
828
- />
829
- </Animated.View>
830
- )}
831
- </View>
832
- );
833
- });
834
-
835
- RenderItem.displayName = 'RenderItem';
836
-
837
- const ContentInfo = memo<ContentInfoProps>(
838
- ({ theme, item, onPressItem, isFavorite = false, onToggleWatchlist }) => {
839
- const [isWatchlistLoading, setIsWatchlistLoading] =
840
- useState<boolean>(false);
841
- const handleWatchlistPress = useCallback(async () => {
842
- if (!item._id) return;
843
-
844
- setIsWatchlistLoading(true);
845
-
846
- try {
847
- await onToggleWatchlist?.(item, { isFavorite });
848
- } catch (error) {
849
- console.error('Error toggling watchlist:', error);
850
- } finally {
851
- setIsWatchlistLoading(false);
852
- }
853
- }, [item, isFavorite, onToggleWatchlist]);
854
- const handlePlayPress = useCallback(() => {
855
- onPressItem?.(item);
856
- }, [item, onPressItem]);
857
-
858
- const handleInfoPress = useCallback(() => {
859
- onPressItem?.(item);
860
- }, [item, onPressItem]);
861
-
862
- const genresText = useMemo(
863
- () => item.genres?.map((g) => g.name).join(' • ') ?? '',
864
- [item.genres]
865
- );
866
-
867
- return (
868
- <View
869
- style={[
870
- styles.contentInfoContainer,
871
- { backgroundColor: theme.colors.background },
872
- ]}
873
- >
874
- {genresText ? (
875
- <Text style={[styles.genreText, { color: theme.colors.white }]}>
876
- {genresText}
877
- </Text>
878
- ) : null}
879
-
880
- <View style={styles.btnContainer}>
881
- <TouchableOpacity
882
- style={styles.mylistBtn}
883
- onPress={handleWatchlistPress}
884
- accessibilityRole="button"
885
- accessibilityLabel={
886
- isFavorite ? 'Remove from My List' : 'Add to My List'
887
- }
888
- >
889
- {isWatchlistLoading ? (
890
- <ActivityIndicator color={theme.colors.textPrimary} />
891
- ) : isFavorite ? (
892
- <CheckCircle2 size={22} color={theme.colors.textPrimary} />
893
- ) : (
894
- <Plus size={22} color={theme.colors.textPrimary} />
895
- )}
896
- <Text style={{ color: theme.colors.textPrimary }}>My List</Text>
897
- </TouchableOpacity>
898
-
899
- <TouchableOpacity
900
- style={[styles.playBtn, { backgroundColor: theme.colors.button }]}
901
- onPress={handlePlayPress}
902
- accessibilityRole="button"
903
- accessibilityLabel="Play content"
904
- >
905
- <Play size={20} color={theme.colors.buttonText} />
906
- <Text style={[styles.playText, { color: theme.colors.buttonText }]}>
907
- Play
908
- </Text>
909
- </TouchableOpacity>
910
-
911
- <TouchableOpacity
912
- style={styles.infoBtn}
913
- onPress={handleInfoPress}
914
- activeOpacity={0.8}
915
- accessibilityRole="button"
916
- accessibilityLabel="View content information"
917
- >
918
- <Info size={22} color={theme.colors.textPrimary} />
919
- <Text style={{ color: theme.colors.textPrimary }}>Info</Text>
920
- </TouchableOpacity>
921
- </View>
922
- </View>
923
- );
924
- }
925
- );
926
-
927
- ContentInfo.displayName = 'ContentInfo';
928
-
929
- const styles = StyleSheet.create({
930
- container: {
931
- flex: 1,
932
- },
933
- sliderList: {
934
- height: verticalScale(SLIDER_HEIGHT),
935
- },
936
- gradientContainer: {
937
- position: 'absolute',
938
- top: 0,
939
- left: 0,
940
- right: 0,
941
- overflow: 'hidden',
942
- },
943
- gradientBottom: {
944
- position: 'absolute',
945
- top: 0,
946
- height: verticalScale(SLIDER_HEIGHT) / GRADIENT_DIVIDER_BOTTOM,
947
- width: '100%',
948
- left: 0,
949
- right: 0,
950
- },
951
- gradientTop: {
952
- position: 'absolute',
953
- bottom: 0,
954
- left: 0,
955
- right: 0,
956
- height: verticalScale(SLIDER_HEIGHT) / GRADIENT_DIVIDER_TOP,
957
- },
958
- titleImage: {
959
- position: 'absolute',
960
- bottom: 0,
961
- height: verticalScale(TITLE_IMAGE_HEIGHT),
962
- width: TITLE_IMAGE_WIDTH_PERCENT,
963
- alignSelf: 'center',
964
- },
965
- contentInfoContainer: {
966
- paddingHorizontal: moderateScale(16),
967
- paddingTop: moderateScale(12),
968
- paddingBottom: verticalScale(15),
969
- },
970
- genreText: {
971
- fontSize: moderateScale(12),
972
- textAlign: 'center',
973
- marginBottom: verticalScale(16),
974
- },
975
- btnContainer: {
976
- flexDirection: 'row',
977
- justifyContent: 'center',
978
- alignItems: 'center',
979
- position: 'relative',
980
- minHeight: verticalScale(50),
981
- paddingVertical: verticalScale(4),
982
- },
983
- mylistBtn: {
984
- alignItems: 'center',
985
- justifyContent: 'center',
986
- gap: verticalScale(6),
987
- position: 'absolute',
988
- left: moderateScale(16),
989
- paddingVertical: verticalScale(8),
990
- paddingHorizontal: moderateScale(4),
991
- },
992
- playBtn: {
993
- flexDirection: 'row',
994
- alignItems: 'center',
995
- justifyContent: 'center',
996
- backgroundColor: '#fff',
997
- paddingHorizontal: moderateScale(28),
998
- paddingVertical: verticalScale(10),
999
- borderRadius: 4,
1000
- gap: moderateScale(8),
1001
- minWidth: moderateScale(90),
1002
- },
1003
- playText: {
1004
- color: '#000',
1005
- fontSize: moderateScale(18),
1006
- fontWeight: '600',
1007
- },
1008
- infoBtn: {
1009
- alignItems: 'center',
1010
- justifyContent: 'center',
1011
- gap: verticalScale(6),
1012
- position: 'absolute',
1013
- right: moderateScale(16),
1014
- paddingVertical: verticalScale(8),
1015
- paddingHorizontal: moderateScale(4),
1016
- },
1017
- });