@zezosoft/zezo-ott-react-native-ui-kit 1.1.0 → 1.1.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 (178) hide show
  1. package/lib/module/components/BottomSheet/BottomSheet.js +152 -0
  2. package/lib/module/components/BottomSheet/BottomSheet.js.map +1 -0
  3. package/lib/module/components/BottomSheet/index.js +4 -0
  4. package/lib/module/components/BottomSheet/index.js.map +1 -0
  5. package/lib/module/components/Button/BackBtn.js +28 -2
  6. package/lib/module/components/Button/BackBtn.js.map +1 -1
  7. package/lib/module/components/Reels/ReelsSeries/MediaControls/BottomControls.js +134 -0
  8. package/lib/module/components/Reels/ReelsSeries/MediaControls/BottomControls.js.map +1 -0
  9. package/lib/module/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.js +154 -0
  10. package/lib/module/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.js.map +1 -0
  11. package/lib/module/components/Reels/ReelsSeries/MediaControls/MiddleControls.js +173 -0
  12. package/lib/module/components/Reels/ReelsSeries/MediaControls/MiddleControls.js.map +1 -0
  13. package/lib/module/components/Reels/ReelsSeries/MediaControls/RightControls.js +77 -0
  14. package/lib/module/components/Reels/ReelsSeries/MediaControls/RightControls.js.map +1 -0
  15. package/lib/module/components/Reels/ReelsSeries/MediaControls/TopControls.js +132 -0
  16. package/lib/module/components/Reels/ReelsSeries/MediaControls/TopControls.js.map +1 -0
  17. package/lib/module/components/Reels/ReelsSeries/Model/DetailsModal.js +165 -0
  18. package/lib/module/components/Reels/ReelsSeries/Model/DetailsModal.js.map +1 -0
  19. package/lib/module/components/Reels/ReelsSeries/Model/SettingModal.js +106 -0
  20. package/lib/module/components/Reels/ReelsSeries/Model/SettingModal.js.map +1 -0
  21. package/lib/module/components/Reels/ReelsSeries/Model/UnlockModal.js +124 -0
  22. package/lib/module/components/Reels/ReelsSeries/Model/UnlockModal.js.map +1 -0
  23. package/lib/module/components/Reels/ReelsSeries/ReelsSeries.js +102 -64
  24. package/lib/module/components/Reels/ReelsSeries/ReelsSeries.js.map +1 -1
  25. package/lib/module/components/Reels/ReelsSeries/ReelsSeriesItem.js +241 -232
  26. package/lib/module/components/Reels/ReelsSeries/ReelsSeriesItem.js.map +1 -1
  27. package/lib/module/components/Reels/ReelsSeries/components/AnimatedThreeLines.js +153 -0
  28. package/lib/module/components/Reels/ReelsSeries/components/AnimatedThreeLines.js.map +1 -0
  29. package/lib/module/components/Reels/ReelsSeries/{Model → components}/Episodes.js +46 -36
  30. package/lib/module/components/Reels/ReelsSeries/components/Episodes.js.map +1 -0
  31. package/lib/module/components/Reels/ReelsSeries/components/GradientOverlay.js +35 -0
  32. package/lib/module/components/Reels/ReelsSeries/components/GradientOverlay.js.map +1 -0
  33. package/lib/module/components/Reels/ReelsSeries/components/Like.js +37 -0
  34. package/lib/module/components/Reels/ReelsSeries/components/Like.js.map +1 -0
  35. package/lib/module/components/Reels/ReelsSeries/components/RotatingLoader.js +55 -0
  36. package/lib/module/components/Reels/ReelsSeries/components/RotatingLoader.js.map +1 -0
  37. package/lib/module/components/Reels/ReelsSeries/components/Synopsis.js +268 -0
  38. package/lib/module/components/Reels/ReelsSeries/components/Synopsis.js.map +1 -0
  39. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/QualityControl.js +143 -0
  40. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/QualityControl.js.map +1 -0
  41. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.js +56 -0
  42. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.js.map +1 -0
  43. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/index.js +5 -0
  44. package/lib/module/components/Reels/ReelsSeries/components/VideoControls/index.js.map +1 -0
  45. package/lib/module/components/Reels/utils/Controls/gestureUtils.js +30 -0
  46. package/lib/module/components/Reels/utils/Controls/gestureUtils.js.map +1 -0
  47. package/lib/module/components/Reels/utils/Controls/index.js +7 -0
  48. package/lib/module/components/Reels/utils/Controls/index.js.map +1 -0
  49. package/lib/module/components/Reels/utils/Controls/overlayUtils.js +28 -0
  50. package/lib/module/components/Reels/utils/Controls/overlayUtils.js.map +1 -0
  51. package/lib/module/components/Reels/utils/Controls/videoControlsConstants.js +27 -0
  52. package/lib/module/components/Reels/utils/Controls/videoControlsConstants.js.map +1 -0
  53. package/lib/module/components/Reels/utils/Controls/videoRef.js +5 -0
  54. package/lib/module/components/Reels/utils/Controls/videoRef.js.map +1 -0
  55. package/lib/module/components/Reels/utils/index.js +4 -0
  56. package/lib/module/components/Reels/utils/index.js.map +1 -0
  57. package/lib/module/components/Reels/utils/timeoutUtils.js +24 -0
  58. package/lib/module/components/Reels/utils/timeoutUtils.js.map +1 -0
  59. package/lib/module/components/index.js +1 -0
  60. package/lib/module/components/index.js.map +1 -1
  61. package/lib/module/theme/ThemeProvider.js +7 -4
  62. package/lib/module/theme/ThemeProvider.js.map +1 -1
  63. package/lib/module/theme/themes.js +3 -3
  64. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +18 -0
  65. package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -0
  66. package/lib/typescript/src/components/BottomSheet/index.d.ts +3 -0
  67. package/lib/typescript/src/components/BottomSheet/index.d.ts.map +1 -0
  68. package/lib/typescript/src/components/Button/BackBtn.d.ts +3 -1
  69. package/lib/typescript/src/components/Button/BackBtn.d.ts.map +1 -1
  70. package/lib/typescript/src/components/Button/index.d.ts +2 -0
  71. package/lib/typescript/src/components/Button/index.d.ts.map +1 -1
  72. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/BottomControls.d.ts +14 -0
  73. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/BottomControls.d.ts.map +1 -0
  74. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.d.ts +60 -0
  75. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.d.ts.map +1 -0
  76. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.d.ts +14 -0
  77. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.d.ts.map +1 -0
  78. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/RightControls.d.ts +14 -0
  79. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/RightControls.d.ts.map +1 -0
  80. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/TopControls.d.ts +12 -0
  81. package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/TopControls.d.ts.map +1 -0
  82. package/lib/typescript/src/components/Reels/ReelsSeries/Model/DetailsModal.d.ts +16 -0
  83. package/lib/typescript/src/components/Reels/ReelsSeries/Model/DetailsModal.d.ts.map +1 -0
  84. package/lib/typescript/src/components/Reels/ReelsSeries/Model/SettingModal.d.ts +15 -0
  85. package/lib/typescript/src/components/Reels/ReelsSeries/Model/SettingModal.d.ts.map +1 -0
  86. package/lib/typescript/src/components/Reels/ReelsSeries/Model/UnlockModal.d.ts +14 -0
  87. package/lib/typescript/src/components/Reels/ReelsSeries/Model/UnlockModal.d.ts.map +1 -0
  88. package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeries.d.ts +8 -2
  89. package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeries.d.ts.map +1 -1
  90. package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeriesItem.d.ts +8 -2
  91. package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeriesItem.d.ts.map +1 -1
  92. package/lib/typescript/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.d.ts +13 -0
  93. package/lib/typescript/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.d.ts.map +1 -0
  94. package/lib/typescript/src/components/Reels/ReelsSeries/{Model → components}/Episodes.d.ts +3 -2
  95. package/lib/typescript/src/components/Reels/ReelsSeries/components/Episodes.d.ts.map +1 -0
  96. package/lib/typescript/src/components/Reels/ReelsSeries/components/GradientOverlay.d.ts +7 -0
  97. package/lib/typescript/src/components/Reels/ReelsSeries/components/GradientOverlay.d.ts.map +1 -0
  98. package/lib/typescript/src/components/Reels/ReelsSeries/components/Like.d.ts +7 -0
  99. package/lib/typescript/src/components/Reels/ReelsSeries/components/Like.d.ts.map +1 -0
  100. package/lib/typescript/src/components/Reels/ReelsSeries/components/RotatingLoader.d.ts +12 -0
  101. package/lib/typescript/src/components/Reels/ReelsSeries/components/RotatingLoader.d.ts.map +1 -0
  102. package/lib/typescript/src/components/Reels/ReelsSeries/components/Synopsis.d.ts +12 -0
  103. package/lib/typescript/src/components/Reels/ReelsSeries/components/Synopsis.d.ts.map +1 -0
  104. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.d.ts +11 -0
  105. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.d.ts.map +1 -0
  106. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.d.ts +10 -0
  107. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.d.ts.map +1 -0
  108. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/index.d.ts +3 -0
  109. package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/index.d.ts.map +1 -0
  110. package/lib/typescript/src/components/Reels/ReelsSeries/types.d.ts +13 -0
  111. package/lib/typescript/src/components/Reels/ReelsSeries/types.d.ts.map +1 -1
  112. package/lib/typescript/src/components/Reels/utils/Controls/gestureUtils.d.ts +10 -0
  113. package/lib/typescript/src/components/Reels/utils/Controls/gestureUtils.d.ts.map +1 -0
  114. package/lib/typescript/src/components/Reels/utils/Controls/index.d.ts +5 -0
  115. package/lib/typescript/src/components/Reels/utils/Controls/index.d.ts.map +1 -0
  116. package/lib/typescript/src/components/Reels/utils/Controls/overlayUtils.d.ts +12 -0
  117. package/lib/typescript/src/components/Reels/utils/Controls/overlayUtils.d.ts.map +1 -0
  118. package/lib/typescript/src/components/Reels/utils/Controls/videoControlsConstants.d.ts +24 -0
  119. package/lib/typescript/src/components/Reels/utils/Controls/videoControlsConstants.d.ts.map +1 -0
  120. package/lib/typescript/src/components/Reels/utils/Controls/videoRef.d.ts +3 -0
  121. package/lib/typescript/src/components/Reels/utils/Controls/videoRef.d.ts.map +1 -0
  122. package/lib/typescript/src/components/Reels/utils/index.d.ts +2 -0
  123. package/lib/typescript/src/components/Reels/utils/index.d.ts.map +1 -0
  124. package/lib/typescript/src/components/Reels/utils/timeoutUtils.d.ts +14 -0
  125. package/lib/typescript/src/components/Reels/utils/timeoutUtils.d.ts.map +1 -0
  126. package/lib/typescript/src/components/index.d.ts +1 -0
  127. package/lib/typescript/src/components/index.d.ts.map +1 -1
  128. package/package.json +1 -1
  129. package/src/components/BottomSheet/BottomSheet.tsx +195 -0
  130. package/src/components/BottomSheet/index.ts +2 -0
  131. package/src/components/Button/BackBtn.tsx +33 -0
  132. package/src/components/Reels/ReelsSeries/MediaControls/BottomControls.tsx +156 -0
  133. package/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.tsx +234 -0
  134. package/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.tsx +196 -0
  135. package/src/components/Reels/ReelsSeries/MediaControls/RightControls.tsx +92 -0
  136. package/src/components/Reels/ReelsSeries/MediaControls/TopControls.tsx +163 -0
  137. package/src/components/Reels/ReelsSeries/Model/DetailsModal.tsx +210 -0
  138. package/src/components/Reels/ReelsSeries/Model/SettingModal.tsx +143 -0
  139. package/src/components/Reels/ReelsSeries/Model/UnlockModal.tsx +154 -0
  140. package/src/components/Reels/ReelsSeries/ReelsSeries.tsx +142 -74
  141. package/src/components/Reels/ReelsSeries/ReelsSeriesItem.tsx +349 -250
  142. package/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.tsx +184 -0
  143. package/src/components/Reels/ReelsSeries/{Model → components}/Episodes.tsx +54 -33
  144. package/src/components/Reels/ReelsSeries/components/GradientOverlay.tsx +41 -0
  145. package/src/components/Reels/ReelsSeries/components/Like.tsx +40 -0
  146. package/src/components/Reels/ReelsSeries/components/RotatingLoader.tsx +79 -0
  147. package/src/components/Reels/ReelsSeries/components/Synopsis.tsx +332 -0
  148. package/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.tsx +190 -0
  149. package/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.tsx +80 -0
  150. package/src/components/Reels/ReelsSeries/components/VideoControls/index.ts +2 -0
  151. package/src/components/Reels/ReelsSeries/types.ts +13 -2
  152. package/src/components/Reels/utils/Controls/gestureUtils.ts +42 -0
  153. package/src/components/Reels/utils/Controls/index.ts +4 -0
  154. package/src/components/Reels/utils/Controls/overlayUtils.ts +35 -0
  155. package/src/components/Reels/utils/Controls/videoControlsConstants.ts +25 -0
  156. package/src/components/Reels/utils/Controls/videoRef.ts +4 -0
  157. package/src/components/Reels/utils/index.ts +1 -0
  158. package/src/components/Reels/utils/timeoutUtils.ts +29 -0
  159. package/src/components/index.ts +1 -0
  160. package/src/theme/ThemeProvider.tsx +8 -2
  161. package/src/theme/themes.ts +3 -3
  162. package/lib/module/components/Reels/ReelsSeries/Model/Episodes.js.map +0 -1
  163. package/lib/module/components/Reels/ReelsSeries/Model/Synopsis.js +0 -212
  164. package/lib/module/components/Reels/ReelsSeries/Model/Synopsis.js.map +0 -1
  165. package/lib/module/components/Reels/ReelsSeries/ReelSeriesDetailsModal.js +0 -182
  166. package/lib/module/components/Reels/ReelsSeries/ReelSeriesDetailsModal.js.map +0 -1
  167. package/lib/module/components/Reels/ReelsSeries/ReelSeriesOverlay.js +0 -203
  168. package/lib/module/components/Reels/ReelsSeries/ReelSeriesOverlay.js.map +0 -1
  169. package/lib/typescript/src/components/Reels/ReelsSeries/Model/Episodes.d.ts.map +0 -1
  170. package/lib/typescript/src/components/Reels/ReelsSeries/Model/Synopsis.d.ts +0 -9
  171. package/lib/typescript/src/components/Reels/ReelsSeries/Model/Synopsis.d.ts.map +0 -1
  172. package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.d.ts +0 -13
  173. package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.d.ts.map +0 -1
  174. package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesOverlay.d.ts +0 -18
  175. package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesOverlay.d.ts.map +0 -1
  176. package/src/components/Reels/ReelsSeries/Model/Synopsis.tsx +0 -242
  177. package/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.tsx +0 -209
  178. package/src/components/Reels/ReelsSeries/ReelSeriesOverlay.tsx +0 -185
@@ -0,0 +1,184 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import { View, StyleSheet, Animated, Easing } from 'react-native';
3
+ import type { StyleProp, ViewStyle } from 'react-native';
4
+ import Svg, { Rect } from 'react-native-svg';
5
+
6
+ const AnimatedRect = Animated.createAnimatedComponent(Rect);
7
+
8
+ interface AnimatedThreeLinesProps {
9
+ isActive: boolean;
10
+ size?: number;
11
+ color?: string;
12
+ style?: StyleProp<ViewStyle>;
13
+ animationDuration?: number;
14
+ delayBetweenLines?: number;
15
+ }
16
+
17
+ const AnimatedThreeLines: React.FC<AnimatedThreeLinesProps> = ({
18
+ isActive,
19
+ size = 16,
20
+ color = 'white',
21
+ style,
22
+ animationDuration = 600,
23
+ delayBetweenLines = 200,
24
+ }) => {
25
+ const line1Anim = useRef(new Animated.Value(0)).current;
26
+ const line2Anim = useRef(new Animated.Value(0)).current;
27
+ const line3Anim = useRef(new Animated.Value(0)).current;
28
+
29
+ useEffect(() => {
30
+ if (isActive) {
31
+ // Custom bezier easing for ultra-smooth animation
32
+ const smoothEasing = Easing.bezier(0.4, 0.0, 0.2, 1); // Material Design easing
33
+
34
+ // Start continuous smooth animation
35
+ const createAnimation = (animValue: Animated.Value, delay: number) => {
36
+ return Animated.loop(
37
+ Animated.sequence([
38
+ Animated.delay(delay),
39
+ Animated.timing(animValue, {
40
+ toValue: 1,
41
+ duration: animationDuration,
42
+ easing: smoothEasing,
43
+ useNativeDriver: false, // SVG doesn't support native driver
44
+ }),
45
+ Animated.timing(animValue, {
46
+ toValue: 0,
47
+ duration: animationDuration,
48
+ easing: smoothEasing,
49
+ useNativeDriver: false, // SVG doesn't support native driver
50
+ }),
51
+ ]),
52
+ { iterations: -1 } // Infinite loop
53
+ );
54
+ };
55
+
56
+ const anim1 = createAnimation(line1Anim, 0);
57
+ const anim2 = createAnimation(line2Anim, delayBetweenLines);
58
+ const anim3 = createAnimation(line3Anim, delayBetweenLines * 2);
59
+
60
+ // Start all animations
61
+ anim1.start();
62
+ anim2.start();
63
+ anim3.start();
64
+
65
+ return () => {
66
+ anim1.stop();
67
+ anim2.stop();
68
+ anim3.stop();
69
+ // Reset values on cleanup
70
+ line1Anim.setValue(0);
71
+ line2Anim.setValue(0);
72
+ line3Anim.setValue(0);
73
+ };
74
+ } else {
75
+ // Smoothly reset to initial state when not active
76
+ Animated.parallel([
77
+ Animated.timing(line1Anim, {
78
+ toValue: 0,
79
+ duration: 200,
80
+ easing: Easing.out(Easing.ease),
81
+ useNativeDriver: false,
82
+ }),
83
+ Animated.timing(line2Anim, {
84
+ toValue: 0,
85
+ duration: 200,
86
+ easing: Easing.out(Easing.ease),
87
+ useNativeDriver: false,
88
+ }),
89
+ Animated.timing(line3Anim, {
90
+ toValue: 0,
91
+ duration: 200,
92
+ easing: Easing.out(Easing.ease),
93
+ useNativeDriver: false,
94
+ }),
95
+ ]).start();
96
+ }
97
+ return undefined;
98
+ }, [
99
+ isActive,
100
+ line1Anim,
101
+ line2Anim,
102
+ line3Anim,
103
+ animationDuration,
104
+ delayBetweenLines,
105
+ ]);
106
+
107
+ // Animate height and Y position for ultra-smooth up/down movement
108
+ // Using extended input range for smoother interpolation
109
+ const line1Height = line1Anim.interpolate({
110
+ inputRange: [0, 0.5, 1],
111
+ outputRange: [4, 7, 10],
112
+ extrapolate: 'clamp',
113
+ });
114
+
115
+ const line1Y = line1Anim.interpolate({
116
+ inputRange: [0, 0.5, 1],
117
+ outputRange: [12, 9, 6], // Move up as height increases
118
+ extrapolate: 'clamp',
119
+ });
120
+
121
+ const line2Height = line2Anim.interpolate({
122
+ inputRange: [0, 0.5, 1],
123
+ outputRange: [6, 9, 12],
124
+ extrapolate: 'clamp',
125
+ });
126
+
127
+ const line2Y = line2Anim.interpolate({
128
+ inputRange: [0, 0.5, 1],
129
+ outputRange: [10, 7, 4], // Move up as height increases
130
+ extrapolate: 'clamp',
131
+ });
132
+
133
+ const line3Height = line3Anim.interpolate({
134
+ inputRange: [0, 0.5, 1],
135
+ outputRange: [4, 6, 8],
136
+ extrapolate: 'clamp',
137
+ });
138
+
139
+ const line3Y = line3Anim.interpolate({
140
+ inputRange: [0, 0.5, 1],
141
+ outputRange: [12, 10, 8], // Move up as height increases
142
+ extrapolate: 'clamp',
143
+ });
144
+
145
+ return (
146
+ <View style={[styles.container, style]}>
147
+ <Svg width={size} height={size} viewBox="0 0 16 16">
148
+ <AnimatedRect
149
+ x={1}
150
+ y={line1Y}
151
+ width={2.5}
152
+ height={line1Height}
153
+ rx={1.25}
154
+ fill={color}
155
+ />
156
+ <AnimatedRect
157
+ x={6}
158
+ y={line2Y}
159
+ width={2.5}
160
+ height={line2Height}
161
+ rx={1.25}
162
+ fill={color}
163
+ />
164
+ <AnimatedRect
165
+ x={11}
166
+ y={line3Y}
167
+ width={2.5}
168
+ height={line3Height}
169
+ rx={1.25}
170
+ fill={color}
171
+ />
172
+ </Svg>
173
+ </View>
174
+ );
175
+ };
176
+
177
+ const styles = StyleSheet.create({
178
+ container: {
179
+ justifyContent: 'center',
180
+ alignItems: 'center',
181
+ },
182
+ });
183
+
184
+ export default AnimatedThreeLines;
@@ -7,69 +7,90 @@ import {
7
7
  Dimensions,
8
8
  TouchableOpacity,
9
9
  } from 'react-native';
10
- import { Lock, ChartNoAxesColumnIncreasing } from 'lucide-react-native';
10
+ import { Lock } from 'lucide-react-native';
11
11
  import { moderateScale, verticalScale } from 'react-native-size-matters';
12
12
  import { RFValue } from 'react-native-responsive-fontsize';
13
+ import AnimatedThreeLines from './AnimatedThreeLines';
14
+ import type { ITheme } from '../../../../theme';
13
15
  import type { ISeriesEpisode, ISeriesItem } from '../types';
14
16
 
15
- const { height, width } = Dimensions.get('window');
17
+ const { width } = Dimensions.get('window');
16
18
  const NUM_COLUMNS = 6;
17
19
 
18
20
  interface EpisodesProps {
21
+ theme: ITheme;
19
22
  reel: ISeriesEpisode;
20
23
  data: ISeriesItem;
21
- currentReel: number;
22
- onEpisodeSelect?: (index: number) => void;
24
+ onEpisodeSelect?: (episode: ISeriesEpisode) => void;
23
25
  totalReels?: number;
24
26
  }
25
27
 
26
28
  const Episodes: React.FC<EpisodesProps> = ({
29
+ theme,
30
+ reel,
27
31
  data,
28
- currentReel,
29
32
  onEpisodeSelect,
30
- totalReels = 0,
31
33
  }) => {
32
- const totalBoxes = Math.max(data.episodes?.length || 0, totalReels);
33
- const EpisodeData = Array.from({ length: totalBoxes }, (_, i) => i + 1);
34
+ const boxWidth = React.useMemo(() => {
35
+ return (
36
+ (width - moderateScale(15) * 2 - moderateScale(6) * NUM_COLUMNS) /
37
+ NUM_COLUMNS
38
+ );
39
+ }, []);
34
40
 
35
- const renderItem = ({ item }: { item: number }) => {
36
- const isAvailable = item <= (data.episodes.length ?? 0);
37
- const isActive = item === currentReel + 1;
41
+ const episodesArray = React.useMemo(() => {
42
+ return (data.episodes || []).map((episode) => ({
43
+ episode,
44
+ episodeNumber: episode.episodeNumber,
45
+ }));
46
+ }, [data.episodes]);
38
47
 
48
+ const renderItem = ({
49
+ item,
50
+ }: {
51
+ item: { episode: ISeriesEpisode; episodeNumber: number };
52
+ }) => {
53
+ const { episode, episodeNumber } = item;
54
+ const isAvailable = !episode.isLocked;
55
+ const isActive = episodeNumber === reel.episodeNumber;
39
56
  return (
40
57
  <TouchableOpacity
41
- key={`episode-${item}`}
42
- onPress={() => isAvailable && onEpisodeSelect?.(item - 1)}
58
+ key={`episode-${episodeNumber}`}
59
+ onPress={() => onEpisodeSelect?.(episode)}
43
60
  activeOpacity={0.8}
61
+ disabled={false}
44
62
  >
45
63
  <View
46
64
  style={[
47
65
  styles.box,
48
66
  {
49
67
  backgroundColor: isActive
50
- ? 'rgba(60,60,60,1)'
51
- : 'rgba(34,34,34,1)',
68
+ ? theme.colors.elevation.level2
69
+ : theme.colors.elevation.level1,
70
+ width: boxWidth,
52
71
  },
53
72
  ]}
54
73
  >
55
- <Text style={[styles.number, { color: 'white' }]}>{item}</Text>
74
+ <Text style={[styles.number, { color: theme.colors.textPrimary }]}>
75
+ {episodeNumber}
76
+ </Text>
56
77
 
57
78
  {!isAvailable && (
58
79
  <View
59
80
  style={[
60
81
  styles.lockContainer,
61
- { backgroundColor: 'rgba(76,76,76,1)' },
82
+ { backgroundColor: theme.colors.surfaceDisabled },
62
83
  ]}
63
84
  >
64
- <Lock color={'white'} size={moderateScale(11)} />
85
+ <Lock color={theme.colors.textPrimary} size={moderateScale(11)} />
65
86
  </View>
66
87
  )}
67
88
 
68
89
  {isActive && (
69
- <ChartNoAxesColumnIncreasing
70
- color={'white'}
71
- size={moderateScale(16)}
72
- style={styles.activeIcon}
90
+ <AnimatedThreeLines
91
+ isActive={isActive}
92
+ color={theme.colors.primary}
93
+ style={styles.animatedIndicator}
73
94
  />
74
95
  )}
75
96
  </View>
@@ -79,17 +100,17 @@ const Episodes: React.FC<EpisodesProps> = ({
79
100
 
80
101
  return (
81
102
  <FlatList
82
- data={EpisodeData}
103
+ data={episodesArray}
83
104
  numColumns={NUM_COLUMNS}
84
- keyExtractor={(item) => `episode-${item}`}
105
+ keyExtractor={(item) => `episode-${item.episode.episodeId}`}
85
106
  renderItem={renderItem}
86
107
  contentContainerStyle={[{ paddingBottom: verticalScale(20) }]}
87
108
  showsVerticalScrollIndicator={false}
88
- scrollEnabled={true} // important for modal
89
- removeClippedSubviews={true} // improves performance
90
- windowSize={10} // virtualized window
109
+ scrollEnabled={true}
110
+ removeClippedSubviews={true}
111
+ windowSize={10}
91
112
  initialNumToRender={NUM_COLUMNS * 2}
92
- nestedScrollEnabled={true} // Allows scroll inside modal
113
+ nestedScrollEnabled={true}
93
114
  />
94
115
  );
95
116
  };
@@ -98,16 +119,13 @@ export default Episodes;
98
119
 
99
120
  const styles = StyleSheet.create({
100
121
  box: {
101
- width:
102
- (width - moderateScale(8) * 2 - moderateScale(6) * NUM_COLUMNS) /
103
- NUM_COLUMNS,
104
- height: (height * 0.52) / 8,
105
122
  borderRadius: moderateScale(10),
106
123
  justifyContent: 'center',
107
124
  alignItems: 'center',
108
125
  marginVertical: moderateScale(2.5),
109
126
  marginHorizontal: moderateScale(2.5),
110
127
  position: 'relative',
128
+ aspectRatio: 1,
111
129
  },
112
130
  number: {
113
131
  fontSize: RFValue(15),
@@ -125,9 +143,12 @@ const styles = StyleSheet.create({
125
143
  justifyContent: 'center',
126
144
  alignItems: 'center',
127
145
  },
128
- activeIcon: {
146
+ animatedIndicator: {
129
147
  position: 'absolute',
130
148
  bottom: verticalScale(6),
131
149
  left: moderateScale(6),
150
+ justifyContent: 'center',
151
+ opacity: 0.9,
152
+ alignItems: 'center',
132
153
  },
133
154
  });
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { StyleSheet } from 'react-native';
3
+ import LinearGradient from 'react-native-linear-gradient';
4
+
5
+ interface GradientOverlayProps {
6
+ children?: React.ReactNode;
7
+ }
8
+
9
+ const GradientOverlay: React.FC<GradientOverlayProps> = ({ children }) => {
10
+ return (
11
+ <>
12
+ <LinearGradient
13
+ colors={['rgba(0,0,0,0.9)', 'rgba(0,0,0,0.5)', 'transparent']}
14
+ style={styles.topGradient}
15
+ />
16
+
17
+ <LinearGradient
18
+ colors={['transparent', 'rgba(0,0,0,0.3)', 'rgba(0,0,0,0.9)']}
19
+ style={styles.bottomGradient}
20
+ />
21
+ {children}
22
+ </>
23
+ );
24
+ };
25
+
26
+ export default GradientOverlay;
27
+
28
+ const styles = StyleSheet.create({
29
+ topGradient: {
30
+ position: 'absolute',
31
+ top: 0,
32
+ width: '100%',
33
+ height: 180,
34
+ },
35
+ bottomGradient: {
36
+ position: 'absolute',
37
+ bottom: 0,
38
+ width: '100%',
39
+ height: 220,
40
+ },
41
+ });
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { View, StyleSheet } from 'react-native';
3
+ import LottieView from 'lottie-react-native';
4
+ import DoubleTapAnim from '../../../../assets/animations/heart.json';
5
+
6
+ interface LikeProps {
7
+ visible: boolean;
8
+ }
9
+
10
+ const Like: React.FC<LikeProps> = ({ visible }) => {
11
+ if (!visible) return null;
12
+
13
+ return (
14
+ <View style={styles.container}>
15
+ <LottieView
16
+ style={styles.lottie}
17
+ source={DoubleTapAnim}
18
+ autoPlay
19
+ loop={false}
20
+ />
21
+ </View>
22
+ );
23
+ };
24
+
25
+ export default Like;
26
+
27
+ const styles = StyleSheet.create({
28
+ container: {
29
+ width: '100%',
30
+ height: '100%',
31
+ position: 'absolute',
32
+ justifyContent: 'center',
33
+ alignItems: 'center',
34
+ zIndex: 5,
35
+ },
36
+ lottie: {
37
+ width: '100%',
38
+ height: '100%',
39
+ },
40
+ });
@@ -0,0 +1,79 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import {
3
+ StyleSheet,
4
+ Animated,
5
+ Easing,
6
+ type StyleProp,
7
+ type ViewStyle,
8
+ } from 'react-native';
9
+ import { Loader } from 'lucide-react-native';
10
+ import { moderateScale } from 'react-native-size-matters';
11
+
12
+ interface RotatingLoaderProps {
13
+ size?: number;
14
+ color?: string;
15
+ containerStyle?: StyleProp<ViewStyle>;
16
+ rotationDuration?: number; // Duration in milliseconds for one full rotation
17
+ autoRotate?: boolean; // Whether to auto-rotate (default: true)
18
+ }
19
+
20
+ const RotatingLoader: React.FC<RotatingLoaderProps> = ({
21
+ size = moderateScale(35),
22
+ color = '#fff',
23
+ containerStyle,
24
+ rotationDuration = 1300,
25
+ autoRotate = true,
26
+ }) => {
27
+ const rotateAnim = useRef(new Animated.Value(0)).current;
28
+
29
+ useEffect(() => {
30
+ if (autoRotate) {
31
+ rotateAnim.setValue(0);
32
+ const animation = Animated.loop(
33
+ Animated.timing(rotateAnim, {
34
+ toValue: 1,
35
+ duration: rotationDuration,
36
+ easing: Easing.linear,
37
+ useNativeDriver: true,
38
+ })
39
+ );
40
+ animation.start();
41
+
42
+ return () => {
43
+ animation.stop();
44
+ rotateAnim.stopAnimation();
45
+ };
46
+ }
47
+ return undefined;
48
+ }, [autoRotate, rotationDuration, rotateAnim]);
49
+
50
+ return (
51
+ <Animated.View
52
+ style={[
53
+ styles.container,
54
+ containerStyle,
55
+ {
56
+ transform: [
57
+ {
58
+ rotate: rotateAnim.interpolate({
59
+ inputRange: [0, 1],
60
+ outputRange: ['0deg', '360deg'],
61
+ }),
62
+ },
63
+ ],
64
+ },
65
+ ]}
66
+ >
67
+ <Loader size={size} color={color} />
68
+ </Animated.View>
69
+ );
70
+ };
71
+
72
+ export default RotatingLoader;
73
+
74
+ const styles = StyleSheet.create({
75
+ container: {
76
+ justifyContent: 'center',
77
+ alignItems: 'center',
78
+ },
79
+ });