@zezosoft/zezo-ott-react-native-ui-kit 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/README.md +1 -1
  2. package/lib/module/components/Account/Account.js +7 -6
  3. package/lib/module/components/Account/Account.js.map +1 -1
  4. package/lib/module/components/Auth/ForgotPassword/ForgotPassword.js +39 -27
  5. package/lib/module/components/Auth/ForgotPassword/ForgotPassword.js.map +1 -1
  6. package/lib/module/components/Auth/Login/LoginWithEmail.js +39 -25
  7. package/lib/module/components/Auth/Login/LoginWithEmail.js.map +1 -1
  8. package/lib/module/components/Auth/Login/LoginWithPhone.js +34 -25
  9. package/lib/module/components/Auth/Login/LoginWithPhone.js.map +1 -1
  10. package/lib/module/components/Auth/OTP/OTP.js +61 -42
  11. package/lib/module/components/Auth/OTP/OTP.js.map +1 -1
  12. package/lib/module/components/Auth/SignUp/SignUp.js +41 -26
  13. package/lib/module/components/Auth/SignUp/SignUp.js.map +1 -1
  14. package/lib/module/components/Auth/SplashScreen/SplashScreen.js +132 -0
  15. package/lib/module/components/Auth/SplashScreen/SplashScreen.js.map +1 -0
  16. package/lib/module/components/Auth/SplashScreen/components/SplashImage/SplashImage.js +61 -0
  17. package/lib/module/components/Auth/SplashScreen/components/SplashImage/SplashImage.js.map +1 -0
  18. package/lib/module/components/{SplashScreen → Auth/SplashScreen}/components/SplashLottie/SplashLottie.js +8 -17
  19. package/lib/module/components/Auth/SplashScreen/components/SplashLottie/SplashLottie.js.map +1 -0
  20. package/lib/module/components/{SplashScreen → Auth/SplashScreen}/components/SplashVideo/SplashVideo.js +25 -11
  21. package/lib/module/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.js.map +1 -0
  22. package/lib/module/components/Auth/index.js +3 -1
  23. package/lib/module/components/Auth/index.js.map +1 -1
  24. package/lib/module/components/BackgroundLayout/BackgroundLayout.js +77 -57
  25. package/lib/module/components/BackgroundLayout/BackgroundLayout.js.map +1 -1
  26. package/lib/module/components/BlogView/BlogView.js +28 -9
  27. package/lib/module/components/BlogView/BlogView.js.map +1 -1
  28. package/lib/module/components/Button/BackBtn.js +1 -1
  29. package/lib/module/components/Button/BackBtn.js.map +1 -1
  30. package/lib/module/components/Button/MenuBtn.js +5 -3
  31. package/lib/module/components/Button/MenuBtn.js.map +1 -1
  32. package/lib/module/components/Button/PrimaryBtn.js +3 -2
  33. package/lib/module/components/Button/PrimaryBtn.js.map +1 -1
  34. package/lib/module/components/Button/TextButton.js +3 -2
  35. package/lib/module/components/Button/TextButton.js.map +1 -1
  36. package/lib/module/components/Content/Card/Category/Category.js +3 -2
  37. package/lib/module/components/Content/Card/Category/Category.js.map +1 -1
  38. package/lib/module/components/Content/Card/NowWatching/NowWatching.js +10 -7
  39. package/lib/module/components/Content/Card/NowWatching/NowWatching.js.map +1 -1
  40. package/lib/module/components/Content/Card/Sliders/Styles/One.js +6 -4
  41. package/lib/module/components/Content/Card/Sliders/Styles/One.js.map +1 -1
  42. package/lib/module/components/Content/Card/Sliders/Styles/Two.js +3 -2
  43. package/lib/module/components/Content/Card/Sliders/Styles/Two.js.map +1 -1
  44. package/lib/module/components/Content/Card/Sliders/index.js +1 -1
  45. package/lib/module/components/Content/Card/Sliders/index.js.map +1 -1
  46. package/lib/module/components/Content/Card/Styles/Five.js +7 -6
  47. package/lib/module/components/Content/Card/Styles/Five.js.map +1 -1
  48. package/lib/module/components/Content/Card/Styles/Four.js +9 -7
  49. package/lib/module/components/Content/Card/Styles/Four.js.map +1 -1
  50. package/lib/module/components/Content/Card/Styles/One.js +33 -70
  51. package/lib/module/components/Content/Card/Styles/One.js.map +1 -1
  52. package/lib/module/components/Content/Card/Styles/RotateInOut.js +6 -5
  53. package/lib/module/components/Content/Card/Styles/RotateInOut.js.map +1 -1
  54. package/lib/module/components/Content/Card/Styles/Six.js +7 -5
  55. package/lib/module/components/Content/Card/Styles/Six.js.map +1 -1
  56. package/lib/module/components/Content/Card/Styles/Three.js +6 -5
  57. package/lib/module/components/Content/Card/Styles/Three.js.map +1 -1
  58. package/lib/module/components/Content/Card/Styles/TopTen.js +10 -12
  59. package/lib/module/components/Content/Card/Styles/TopTen.js.map +1 -1
  60. package/lib/module/components/Content/Card/Styles/Two.js +8 -6
  61. package/lib/module/components/Content/Card/Styles/Two.js.map +1 -1
  62. package/lib/module/components/Content/Card/components/CardPoster.js +17 -9
  63. package/lib/module/components/Content/Card/components/CardPoster.js.map +1 -1
  64. package/lib/module/components/Content/Card/components/NavigateToMore.js +4 -3
  65. package/lib/module/components/Content/Card/components/NavigateToMore.js.map +1 -1
  66. package/lib/module/components/Content/Card/components/NoContentFallback.js +5 -4
  67. package/lib/module/components/Content/Card/components/NoContentFallback.js.map +1 -1
  68. package/lib/module/components/Content/Card/components/ThumbnailCard.js +2 -1
  69. package/lib/module/components/Content/Card/components/ThumbnailCard.js.map +1 -1
  70. package/lib/module/components/Content/Content.js +21 -7
  71. package/lib/module/components/Content/Content.js.map +1 -1
  72. package/lib/module/components/Content/Sections.js +1 -1
  73. package/lib/module/components/Content/Sections.js.map +1 -1
  74. package/lib/module/components/ContentView/ContentView.js +8 -6
  75. package/lib/module/components/ContentView/ContentView.js.map +1 -1
  76. package/lib/module/components/ContentView/MoreContentList.js +211 -0
  77. package/lib/module/components/ContentView/MoreContentList.js.map +1 -0
  78. package/lib/module/components/ContentView/components/AboutSection.js +5 -4
  79. package/lib/module/components/ContentView/components/AboutSection.js.map +1 -1
  80. package/lib/module/components/ContentView/components/CastCard.js +5 -4
  81. package/lib/module/components/ContentView/components/CastCard.js.map +1 -1
  82. package/lib/module/components/ContentView/components/EpisodeCard.js +23 -3
  83. package/lib/module/components/ContentView/components/EpisodeCard.js.map +1 -1
  84. package/lib/module/components/ContentView/components/GenreTags.js +2 -1
  85. package/lib/module/components/ContentView/components/GenreTags.js.map +1 -1
  86. package/lib/module/components/ContentView/components/HeroBanner.js +14 -5
  87. package/lib/module/components/ContentView/components/HeroBanner.js.map +1 -1
  88. package/lib/module/components/ContentView/components/Title.js +4 -3
  89. package/lib/module/components/ContentView/components/Title.js.map +1 -1
  90. package/lib/module/components/ContentView/index.js +1 -0
  91. package/lib/module/components/ContentView/index.js.map +1 -1
  92. package/lib/module/components/Headers/AppHeader.js +20 -25
  93. package/lib/module/components/Headers/AppHeader.js.map +1 -1
  94. package/lib/module/components/Headers/One.js +1 -1
  95. package/lib/module/components/Headers/Three.js +5 -3
  96. package/lib/module/components/Headers/Three.js.map +1 -1
  97. package/lib/module/components/Headers/Two.js +5 -3
  98. package/lib/module/components/Headers/Two.js.map +1 -1
  99. package/lib/module/components/Input/InputOne.js +6 -4
  100. package/lib/module/components/Input/InputOne.js.map +1 -1
  101. package/lib/module/components/Input/InputTwo.js +5 -4
  102. package/lib/module/components/Input/InputTwo.js.map +1 -1
  103. package/lib/module/components/Input/PhoneNumberInput.js +12 -11
  104. package/lib/module/components/Input/PhoneNumberInput.js.map +1 -1
  105. package/lib/module/components/Keyboard/HideKeyboard.js +40 -12
  106. package/lib/module/components/Keyboard/HideKeyboard.js.map +1 -1
  107. package/lib/module/components/Logo/Logo.js +2 -1
  108. package/lib/module/components/Logo/Logo.js.map +1 -1
  109. package/lib/module/components/Search/One.js +6 -4
  110. package/lib/module/components/Search/One.js.map +1 -1
  111. package/lib/module/components/Search/components/RecentSearchesSection.js +10 -9
  112. package/lib/module/components/Search/components/RecentSearchesSection.js.map +1 -1
  113. package/lib/module/components/Search/components/SearchCard.js +6 -5
  114. package/lib/module/components/Search/components/SearchCard.js.map +1 -1
  115. package/lib/module/components/Settings/AppSettings.js +5 -4
  116. package/lib/module/components/Settings/AppSettings.js.map +1 -1
  117. package/lib/module/components/Subscription/SubOne.js +16 -15
  118. package/lib/module/components/Subscription/SubOne.js.map +1 -1
  119. package/lib/module/components/TabBar/One.js +5 -3
  120. package/lib/module/components/TabBar/One.js.map +1 -1
  121. package/lib/module/components/TabBar/Three.js +18 -14
  122. package/lib/module/components/TabBar/Three.js.map +1 -1
  123. package/lib/module/components/TabBar/Two.js +4 -2
  124. package/lib/module/components/TabBar/Two.js.map +1 -1
  125. package/lib/module/components/Text/Text.js +4 -4
  126. package/lib/module/components/Text/Text.js.map +1 -1
  127. package/lib/module/components/User/DeviceSessions/DeviceSessions.js +7 -6
  128. package/lib/module/components/User/DeviceSessions/DeviceSessions.js.map +1 -1
  129. package/lib/module/components/User/WatchHistory/WatchHistory.js +6 -7
  130. package/lib/module/components/User/WatchHistory/WatchHistory.js.map +1 -1
  131. package/lib/module/components/User/WatchLater/WatchLater.js +12 -9
  132. package/lib/module/components/User/WatchLater/WatchLater.js.map +1 -1
  133. package/lib/module/components/User/components/UserAvatar.js +1 -1
  134. package/lib/module/components/User/components/UserAvatar.js.map +1 -1
  135. package/lib/module/components/User/components/UserSection.js +5 -4
  136. package/lib/module/components/User/components/UserSection.js.map +1 -1
  137. package/lib/module/components/index.js +0 -1
  138. package/lib/module/components/index.js.map +1 -1
  139. package/lib/module/components/layout/SafeAreaWrapper.js +12 -11
  140. package/lib/module/components/layout/SafeAreaWrapper.js.map +1 -1
  141. package/lib/module/hooks/useInitSplashCacheSync.js +67 -63
  142. package/lib/module/hooks/useInitSplashCacheSync.js.map +1 -1
  143. package/lib/module/hooks/useKeyboard.js +7 -9
  144. package/lib/module/hooks/useKeyboard.js.map +1 -1
  145. package/lib/module/hooks/usePaginatedSection.js +10 -3
  146. package/lib/module/hooks/usePaginatedSection.js.map +1 -1
  147. package/lib/module/theme/ThemeProvider.js +55 -52
  148. package/lib/module/theme/ThemeProvider.js.map +1 -1
  149. package/lib/module/theme/hook/useTheme.js +45 -0
  150. package/lib/module/theme/hook/useTheme.js.map +1 -0
  151. package/lib/module/theme/index.js +1 -0
  152. package/lib/module/theme/index.js.map +1 -1
  153. package/lib/module/theme/themes.js +1 -1
  154. package/lib/typescript/src/components/Account/Account.d.ts.map +1 -1
  155. package/lib/typescript/src/components/Auth/ForgotPassword/ForgotPassword.d.ts +9 -6
  156. package/lib/typescript/src/components/Auth/ForgotPassword/ForgotPassword.d.ts.map +1 -1
  157. package/lib/typescript/src/components/Auth/Login/LoginWithEmail.d.ts +6 -2
  158. package/lib/typescript/src/components/Auth/Login/LoginWithEmail.d.ts.map +1 -1
  159. package/lib/typescript/src/components/Auth/Login/LoginWithPhone.d.ts +6 -2
  160. package/lib/typescript/src/components/Auth/Login/LoginWithPhone.d.ts.map +1 -1
  161. package/lib/typescript/src/components/Auth/OTP/OTP.d.ts +7 -3
  162. package/lib/typescript/src/components/Auth/OTP/OTP.d.ts.map +1 -1
  163. package/lib/typescript/src/components/Auth/SignUp/SignUp.d.ts +6 -2
  164. package/lib/typescript/src/components/Auth/SignUp/SignUp.d.ts.map +1 -1
  165. package/lib/typescript/src/components/Auth/SplashScreen/SplashScreen.d.ts +34 -0
  166. package/lib/typescript/src/components/Auth/SplashScreen/SplashScreen.d.ts.map +1 -0
  167. package/lib/typescript/src/components/{SplashScreen → Auth/SplashScreen}/components/SplashImage/SplashImage.d.ts +2 -3
  168. package/lib/typescript/src/components/Auth/SplashScreen/components/SplashImage/SplashImage.d.ts.map +1 -0
  169. package/lib/typescript/src/components/{SplashScreen → Auth/SplashScreen}/components/SplashLottie/SplashLottie.d.ts +1 -1
  170. package/lib/typescript/src/components/Auth/SplashScreen/components/SplashLottie/SplashLottie.d.ts.map +1 -0
  171. package/lib/typescript/src/components/{SplashScreen → Auth/SplashScreen}/components/SplashVideo/SplashVideo.d.ts +1 -1
  172. package/lib/typescript/src/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.d.ts.map +1 -0
  173. package/lib/typescript/src/components/Auth/index.d.ts +49 -11
  174. package/lib/typescript/src/components/Auth/index.d.ts.map +1 -1
  175. package/lib/typescript/src/components/BackgroundLayout/BackgroundLayout.d.ts +5 -4
  176. package/lib/typescript/src/components/BackgroundLayout/BackgroundLayout.d.ts.map +1 -1
  177. package/lib/typescript/src/components/BlogView/BlogView.d.ts +1 -0
  178. package/lib/typescript/src/components/BlogView/BlogView.d.ts.map +1 -1
  179. package/lib/typescript/src/components/Button/MenuBtn.d.ts +1 -8
  180. package/lib/typescript/src/components/Button/MenuBtn.d.ts.map +1 -1
  181. package/lib/typescript/src/components/Button/PrimaryBtn.d.ts.map +1 -1
  182. package/lib/typescript/src/components/Button/TextButton.d.ts.map +1 -1
  183. package/lib/typescript/src/components/Content/Card/Category/Category.d.ts.map +1 -1
  184. package/lib/typescript/src/components/Content/Card/NowWatching/NowWatching.d.ts.map +1 -1
  185. package/lib/typescript/src/components/Content/Card/Sliders/Styles/One.d.ts.map +1 -1
  186. package/lib/typescript/src/components/Content/Card/Sliders/Styles/Two.d.ts.map +1 -1
  187. package/lib/typescript/src/components/Content/Card/Sliders/index.d.ts +1 -1
  188. package/lib/typescript/src/components/Content/Card/Styles/Five.d.ts.map +1 -1
  189. package/lib/typescript/src/components/Content/Card/Styles/Four.d.ts.map +1 -1
  190. package/lib/typescript/src/components/Content/Card/Styles/One.d.ts.map +1 -1
  191. package/lib/typescript/src/components/Content/Card/Styles/RotateInOut.d.ts.map +1 -1
  192. package/lib/typescript/src/components/Content/Card/Styles/Six.d.ts.map +1 -1
  193. package/lib/typescript/src/components/Content/Card/Styles/Three.d.ts.map +1 -1
  194. package/lib/typescript/src/components/Content/Card/Styles/TopTen.d.ts.map +1 -1
  195. package/lib/typescript/src/components/Content/Card/Styles/Two.d.ts.map +1 -1
  196. package/lib/typescript/src/components/Content/Card/components/CardPoster.d.ts +4 -0
  197. package/lib/typescript/src/components/Content/Card/components/CardPoster.d.ts.map +1 -1
  198. package/lib/typescript/src/components/Content/Card/components/NavigateToMore.d.ts.map +1 -1
  199. package/lib/typescript/src/components/Content/Card/components/NoContentFallback.d.ts.map +1 -1
  200. package/lib/typescript/src/components/Content/Card/components/ThumbnailCard.d.ts.map +1 -1
  201. package/lib/typescript/src/components/Content/Content.d.ts +1 -0
  202. package/lib/typescript/src/components/Content/Content.d.ts.map +1 -1
  203. package/lib/typescript/src/components/ContentView/MoreContentList.d.ts +27 -0
  204. package/lib/typescript/src/components/ContentView/MoreContentList.d.ts.map +1 -0
  205. package/lib/typescript/src/components/ContentView/components/AboutSection.d.ts.map +1 -1
  206. package/lib/typescript/src/components/ContentView/components/CastCard.d.ts.map +1 -1
  207. package/lib/typescript/src/components/ContentView/components/EpisodeCard.d.ts.map +1 -1
  208. package/lib/typescript/src/components/ContentView/components/GenreTags.d.ts.map +1 -1
  209. package/lib/typescript/src/components/ContentView/components/HeroBanner.d.ts.map +1 -1
  210. package/lib/typescript/src/components/ContentView/components/Title.d.ts.map +1 -1
  211. package/lib/typescript/src/components/ContentView/index.d.ts +1 -0
  212. package/lib/typescript/src/components/ContentView/index.d.ts.map +1 -1
  213. package/lib/typescript/src/components/Headers/AppHeader.d.ts.map +1 -1
  214. package/lib/typescript/src/components/Headers/Three.d.ts +1 -0
  215. package/lib/typescript/src/components/Headers/Three.d.ts.map +1 -1
  216. package/lib/typescript/src/components/Headers/Two.d.ts +1 -0
  217. package/lib/typescript/src/components/Headers/Two.d.ts.map +1 -1
  218. package/lib/typescript/src/components/Input/InputOne.d.ts.map +1 -1
  219. package/lib/typescript/src/components/Input/InputTwo.d.ts.map +1 -1
  220. package/lib/typescript/src/components/Input/PhoneNumberInput.d.ts.map +1 -1
  221. package/lib/typescript/src/components/Keyboard/HideKeyboard.d.ts +1 -1
  222. package/lib/typescript/src/components/Keyboard/HideKeyboard.d.ts.map +1 -1
  223. package/lib/typescript/src/components/Logo/Logo.d.ts.map +1 -1
  224. package/lib/typescript/src/components/Search/One.d.ts.map +1 -1
  225. package/lib/typescript/src/components/Search/components/RecentSearchesSection.d.ts.map +1 -1
  226. package/lib/typescript/src/components/Search/components/SearchCard.d.ts.map +1 -1
  227. package/lib/typescript/src/components/Settings/AppSettings.d.ts.map +1 -1
  228. package/lib/typescript/src/components/Subscription/SubOne.d.ts.map +1 -1
  229. package/lib/typescript/src/components/Subscription/index.d.ts.map +1 -1
  230. package/lib/typescript/src/components/TabBar/One.d.ts.map +1 -1
  231. package/lib/typescript/src/components/TabBar/Three.d.ts +2 -2
  232. package/lib/typescript/src/components/TabBar/Three.d.ts.map +1 -1
  233. package/lib/typescript/src/components/TabBar/Two.d.ts.map +1 -1
  234. package/lib/typescript/src/components/User/DeviceSessions/DeviceSessions.d.ts.map +1 -1
  235. package/lib/typescript/src/components/User/WatchHistory/WatchHistory.d.ts.map +1 -1
  236. package/lib/typescript/src/components/User/WatchLater/WatchLater.d.ts.map +1 -1
  237. package/lib/typescript/src/components/User/components/UserSection.d.ts.map +1 -1
  238. package/lib/typescript/src/components/index.d.ts +0 -1
  239. package/lib/typescript/src/components/index.d.ts.map +1 -1
  240. package/lib/typescript/src/components/layout/SafeAreaWrapper.d.ts +2 -4
  241. package/lib/typescript/src/components/layout/SafeAreaWrapper.d.ts.map +1 -1
  242. package/lib/typescript/src/hooks/useInitSplashCacheSync.d.ts +1 -1
  243. package/lib/typescript/src/hooks/useInitSplashCacheSync.d.ts.map +1 -1
  244. package/lib/typescript/src/hooks/useKeyboard.d.ts.map +1 -1
  245. package/lib/typescript/src/hooks/usePaginatedSection.d.ts +1 -0
  246. package/lib/typescript/src/hooks/usePaginatedSection.d.ts.map +1 -1
  247. package/lib/typescript/src/theme/ThemeProvider.d.ts +8 -4
  248. package/lib/typescript/src/theme/ThemeProvider.d.ts.map +1 -1
  249. package/lib/typescript/src/theme/hook/useTheme.d.ts +9 -0
  250. package/lib/typescript/src/theme/hook/useTheme.d.ts.map +1 -0
  251. package/lib/typescript/src/theme/index.d.ts +1 -0
  252. package/lib/typescript/src/theme/index.d.ts.map +1 -1
  253. package/lib/typescript/src/types/content/content-view.types.d.ts +7 -3
  254. package/lib/typescript/src/types/content/content-view.types.d.ts.map +1 -1
  255. package/package.json +3 -2
  256. package/src/components/Account/Account.tsx +7 -6
  257. package/src/components/Auth/ForgotPassword/ForgotPassword.tsx +51 -32
  258. package/src/components/Auth/Login/LoginWithEmail.tsx +45 -26
  259. package/src/components/Auth/Login/LoginWithPhone.tsx +38 -24
  260. package/src/components/Auth/OTP/OTP.tsx +96 -61
  261. package/src/components/Auth/SignUp/SignUp.tsx +49 -31
  262. package/src/components/Auth/SplashScreen/SplashScreen.tsx +166 -0
  263. package/src/components/Auth/SplashScreen/components/SplashImage/SplashImage.tsx +66 -0
  264. package/src/components/{SplashScreen → Auth/SplashScreen}/components/SplashLottie/SplashLottie.tsx +7 -19
  265. package/src/components/{SplashScreen → Auth/SplashScreen}/components/SplashVideo/SplashVideo.tsx +23 -14
  266. package/src/components/Auth/index.ts +3 -1
  267. package/src/components/BackgroundLayout/BackgroundLayout.tsx +72 -50
  268. package/src/components/BlogView/BlogView.tsx +29 -9
  269. package/src/components/Button/BackBtn.tsx +1 -1
  270. package/src/components/Button/MenuBtn.tsx +6 -9
  271. package/src/components/Button/PrimaryBtn.tsx +3 -2
  272. package/src/components/Button/TextButton.tsx +3 -2
  273. package/src/components/Content/Card/Category/Category.tsx +3 -2
  274. package/src/components/Content/Card/NowWatching/NowWatching.tsx +15 -8
  275. package/src/components/Content/Card/Sliders/Styles/One.tsx +4 -3
  276. package/src/components/Content/Card/Sliders/Styles/Two.tsx +3 -2
  277. package/src/components/Content/Card/Sliders/index.ts +1 -1
  278. package/src/components/Content/Card/Styles/Five.tsx +7 -6
  279. package/src/components/Content/Card/Styles/Four.tsx +7 -6
  280. package/src/components/Content/Card/Styles/One.tsx +44 -111
  281. package/src/components/Content/Card/Styles/RotateInOut.tsx +5 -5
  282. package/src/components/Content/Card/Styles/Six.tsx +7 -5
  283. package/src/components/Content/Card/Styles/Three.tsx +5 -5
  284. package/src/components/Content/Card/Styles/TopTen.tsx +10 -14
  285. package/src/components/Content/Card/Styles/Two.tsx +9 -7
  286. package/src/components/Content/Card/components/CardPoster.tsx +24 -11
  287. package/src/components/Content/Card/components/NavigateToMore.tsx +4 -3
  288. package/src/components/Content/Card/components/NoContentFallback.tsx +5 -4
  289. package/src/components/Content/Card/components/ThumbnailCard.tsx +2 -1
  290. package/src/components/Content/Content.tsx +38 -7
  291. package/src/components/Content/Sections.tsx +1 -1
  292. package/src/components/ContentView/ContentView.tsx +6 -6
  293. package/src/components/ContentView/MoreContentList.tsx +238 -0
  294. package/src/components/ContentView/components/AboutSection.tsx +5 -4
  295. package/src/components/ContentView/components/CastCard.tsx +5 -4
  296. package/src/components/ContentView/components/EpisodeCard.tsx +30 -4
  297. package/src/components/ContentView/components/GenreTags.tsx +2 -1
  298. package/src/components/ContentView/components/HeroBanner.tsx +10 -6
  299. package/src/components/ContentView/components/Title.tsx +4 -3
  300. package/src/components/ContentView/index.ts +1 -0
  301. package/src/components/Headers/AppHeader.tsx +20 -34
  302. package/src/components/Headers/One.tsx +1 -1
  303. package/src/components/Headers/Three.tsx +4 -3
  304. package/src/components/Headers/Two.tsx +4 -3
  305. package/src/components/Input/InputOne.tsx +6 -4
  306. package/src/components/Input/InputTwo.tsx +5 -4
  307. package/src/components/Input/PhoneNumberInput.tsx +12 -11
  308. package/src/components/Keyboard/HideKeyboard.tsx +41 -15
  309. package/src/components/Logo/Logo.tsx +2 -1
  310. package/src/components/Search/One.tsx +6 -5
  311. package/src/components/Search/components/RecentSearchesSection.tsx +10 -9
  312. package/src/components/Search/components/SearchCard.tsx +6 -5
  313. package/src/components/Settings/AppSettings.tsx +14 -13
  314. package/src/components/Subscription/SubOne.tsx +16 -15
  315. package/src/components/TabBar/One.tsx +6 -3
  316. package/src/components/TabBar/Three.tsx +28 -14
  317. package/src/components/TabBar/Two.tsx +4 -2
  318. package/src/components/Text/Text.tsx +4 -4
  319. package/src/components/User/DeviceSessions/DeviceSessions.tsx +7 -6
  320. package/src/components/User/WatchHistory/WatchHistory.tsx +5 -7
  321. package/src/components/User/WatchLater/WatchLater.tsx +12 -9
  322. package/src/components/User/components/UserAvatar.tsx +1 -1
  323. package/src/components/User/components/UserSection.tsx +5 -4
  324. package/src/components/index.ts +0 -1
  325. package/src/components/layout/SafeAreaWrapper.tsx +16 -9
  326. package/src/hooks/useInitSplashCacheSync.ts +74 -87
  327. package/src/hooks/useKeyboard.ts +9 -8
  328. package/src/hooks/usePaginatedSection.ts +7 -3
  329. package/src/theme/ThemeProvider.tsx +59 -55
  330. package/src/theme/hook/useTheme.ts +41 -0
  331. package/src/theme/index.ts +1 -0
  332. package/src/theme/themes.ts +1 -1
  333. package/src/types/content/content-view.types.ts +4 -2
  334. package/lib/module/components/SplashScreen/SplashScreen.js +0 -109
  335. package/lib/module/components/SplashScreen/SplashScreen.js.map +0 -1
  336. package/lib/module/components/SplashScreen/components/SplashImage/SplashImage.js +0 -68
  337. package/lib/module/components/SplashScreen/components/SplashImage/SplashImage.js.map +0 -1
  338. package/lib/module/components/SplashScreen/components/SplashLottie/SplashLottie.js.map +0 -1
  339. package/lib/module/components/SplashScreen/components/SplashVideo/SplashVideo.js.map +0 -1
  340. package/lib/module/components/SplashScreen/index.js +0 -9
  341. package/lib/module/components/SplashScreen/index.js.map +0 -1
  342. package/lib/typescript/src/components/SplashScreen/SplashScreen.d.ts +0 -32
  343. package/lib/typescript/src/components/SplashScreen/SplashScreen.d.ts.map +0 -1
  344. package/lib/typescript/src/components/SplashScreen/components/SplashImage/SplashImage.d.ts.map +0 -1
  345. package/lib/typescript/src/components/SplashScreen/components/SplashLottie/SplashLottie.d.ts.map +0 -1
  346. package/lib/typescript/src/components/SplashScreen/components/SplashVideo/SplashVideo.d.ts.map +0 -1
  347. package/lib/typescript/src/components/SplashScreen/index.d.ts +0 -6
  348. package/lib/typescript/src/components/SplashScreen/index.d.ts.map +0 -1
  349. package/src/components/SplashScreen/SplashScreen.tsx +0 -131
  350. package/src/components/SplashScreen/components/SplashImage/SplashImage.tsx +0 -84
  351. package/src/components/SplashScreen/index.ts +0 -6
@@ -1,14 +1,15 @@
1
1
  /**
2
- * @author Ashok Desai
3
- * @lastModified Jun 24, 2025 at 2:30 PM
2
+ * @author Naresh Desai
3
+ * @lastModified Sat 26 Jul 2025 at 12:37 PM
4
4
  */
5
5
  import React from 'react';
6
6
  import { View, Pressable, StyleSheet, Platform } from 'react-native';
7
7
  import { BlurView } from '@react-native-community/blur';
8
8
  import { createBottomTabNavigator, type BottomTabBarProps } from '@react-navigation/bottom-tabs';
9
9
  import { scale } from 'react-native-size-matters';
10
- import { useTheme } from '@zezosoft/zezo-ott-react-native-ui-kit';
10
+
11
11
  import type { AppTheme, ITheme } from '../../theme/themes';
12
+ import { useTheme } from '../../theme/hook/useTheme';
12
13
 
13
14
  export interface ITab {
14
15
  key: string;
@@ -39,7 +40,15 @@ const CustomTabBar: React.FC<
39
40
  }
40
41
  > = ({ state, navigation, tabs, onTabPress, theme }) => (
41
42
  <View style={styles.bottomWrapper}>
42
- <View style={[styles.bottomBox, { borderColor: theme.colors.border }]}>
43
+ <View
44
+ style={[
45
+ styles.bottomBox,
46
+ {
47
+ borderColor: theme.colors.border,
48
+ backgroundColor: Platform.OS === 'android' ? theme.colors.backdrop : 'transparent'
49
+ }
50
+ ]}
51
+ >
43
52
  {Platform.OS !== 'web' && (
44
53
  <BlurView
45
54
  style={StyleSheet.absoluteFill}
@@ -53,7 +62,8 @@ const CustomTabBar: React.FC<
53
62
  const isFocused = state.index === index;
54
63
  const iconColor = isFocused ? theme.colors.buttonText : theme.colors.textPrimary;
55
64
  const bgColor = isFocused ? theme.colors.button : theme.colors.blueBackground;
56
- const isBorderCode = isFocused ? theme.colors.button : theme.colors.border;
65
+ const isBorderColor = isFocused ? theme.colors.button : theme.colors.border;
66
+
57
67
  return (
58
68
  <Pressable
59
69
  key={tab.key}
@@ -65,7 +75,7 @@ const CustomTabBar: React.FC<
65
75
  styles.icon,
66
76
  {
67
77
  backgroundColor: bgColor,
68
- borderColor: isBorderCode
78
+ borderColor: isBorderColor
69
79
  }
70
80
  ]}
71
81
  >
@@ -87,7 +97,10 @@ const TabBarThree: React.FC<TabBarThreeProps> = ({ tabs, theme, onTabPress }) =>
87
97
  const { theme: appliedTheme } = useTheme(theme);
88
98
 
89
99
  return (
90
- <Tab.Navigator screenOptions={{ headerShown: false }} tabBar={renderTabBar(tabs, onTabPress, appliedTheme)}>
100
+ <Tab.Navigator
101
+ screenOptions={{ headerShown: false, tabBarShowLabel: false, tabBarHideOnKeyboard: true }}
102
+ tabBar={renderTabBar(tabs, onTabPress, appliedTheme)}
103
+ >
91
104
  {tabs.map((tab) => (
92
105
  <Tab.Screen key={tab.key} name={tab.key} component={tab.screenComponent} />
93
106
  ))}
@@ -97,18 +110,19 @@ const TabBarThree: React.FC<TabBarThreeProps> = ({ tabs, theme, onTabPress }) =>
97
110
 
98
111
  const styles = StyleSheet.create({
99
112
  bottomWrapper: {
100
- width: '100%',
101
- paddingHorizontal: scale(16),
102
113
  position: 'absolute',
103
- bottom: scale(20)
114
+ bottom: scale(20),
115
+ left: 0,
116
+ right: 0,
117
+ alignItems: 'center'
104
118
  },
105
119
  bottomBox: {
106
- width: '100%',
120
+ marginHorizontal: scale(16),
121
+ alignSelf: 'center',
107
122
  height: BOTTOM_BAR_HEIGHT,
108
- borderRadius: scale(40),
123
+ borderRadius: scale(BOTTOM_BAR_HEIGHT / 2),
109
124
  overflow: 'hidden',
110
125
  borderWidth: Platform.select({ ios: scale(1), android: scale(1.5) }),
111
- backgroundColor: 'transparent',
112
126
  alignItems: 'center',
113
127
  justifyContent: 'center'
114
128
  },
@@ -117,7 +131,7 @@ const styles = StyleSheet.create({
117
131
  justifyContent: 'space-between',
118
132
  alignItems: 'center',
119
133
  width: '100%',
120
- paddingHorizontal: scale(10)
134
+ paddingHorizontal: scale(12)
121
135
  },
122
136
  icon: {
123
137
  width: ICON_BOX_SIZE,
@@ -6,9 +6,10 @@ import React, { useState } from 'react';
6
6
  import { View, Pressable, StyleSheet, Platform } from 'react-native';
7
7
  import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
8
8
  import { scale } from 'react-native-size-matters';
9
- import { useTheme } from '@zezosoft/zezo-ott-react-native-ui-kit';
10
9
  import { Text } from '../Text';
11
10
  import type { AppTheme, ITheme } from '../../theme/themes';
11
+ import { useTheme } from '../../theme/hook/useTheme';
12
+ import { RFValue } from 'react-native-responsive-fontsize';
12
13
 
13
14
  export type ITab = {
14
15
  key: string;
@@ -83,6 +84,7 @@ const TabBarTwo = ({ tabs, theme, onTabPress }: TabBarTwoProps) => {
83
84
  screenOptions={{
84
85
  headerShown: false,
85
86
  tabBarShowLabel: false,
87
+ tabBarHideOnKeyboard: true,
86
88
  tabBarStyle: {
87
89
  position: 'absolute',
88
90
  bottom: scale(20),
@@ -145,7 +147,7 @@ const styles = StyleSheet.create({
145
147
  },
146
148
  label: {
147
149
  marginTop: scale(4),
148
- fontSize: scale(11),
150
+ fontSize: RFValue(10),
149
151
  textAlign: 'center'
150
152
  }
151
153
  });
@@ -5,8 +5,8 @@
5
5
 
6
6
  import React from 'react';
7
7
  import { Text as RNText, type TextProps as RNTextProps, type TextStyle } from 'react-native';
8
- import { scale } from 'react-native-size-matters';
9
- import { useTheme } from '../../theme/ThemeProvider';
8
+ import { useTheme } from '../../theme/hook/useTheme';
9
+ import { RFValue } from 'react-native-responsive-fontsize';
10
10
 
11
11
  export interface TextProps extends RNTextProps {
12
12
  children: React.ReactNode;
@@ -21,7 +21,7 @@ export interface TextProps extends RNTextProps {
21
21
 
22
22
  const Text: React.FC<TextProps> = ({
23
23
  children,
24
- size = 12,
24
+ size = 10,
25
25
  color,
26
26
  weight = '500',
27
27
  align = 'left',
@@ -41,7 +41,7 @@ const Text: React.FC<TextProps> = ({
41
41
  style={[
42
42
  {
43
43
  color: color ?? theme.colors.textPrimary,
44
- fontSize: scale(size),
44
+ fontSize: RFValue(size),
45
45
  fontWeight: weight,
46
46
  textAlign: align,
47
47
  fontFamily
@@ -7,10 +7,11 @@ import React from 'react';
7
7
  import { View, StyleSheet, FlatList, TouchableOpacity, type StyleProp, type ViewStyle, Alert } from 'react-native';
8
8
  import { scale, verticalScale } from 'react-native-size-matters';
9
9
  import { Text } from '../../Text';
10
- import { useTheme } from '../../../theme';
10
+ import { useTheme } from '../../../theme/hook/useTheme';
11
11
  import AppHeader from '../../Headers/AppHeader';
12
12
  import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
13
13
  import type { AppTheme } from '../../../theme/themes';
14
+ import { RFValue } from 'react-native-responsive-fontsize';
14
15
 
15
16
  type IUserLocation = {
16
17
  country: string | null;
@@ -318,13 +319,13 @@ const styles = StyleSheet.create({
318
319
  marginBottom: scale(4)
319
320
  },
320
321
  deviceName: {
321
- fontSize: scale(13),
322
+ fontSize: RFValue(12),
322
323
  fontWeight: '600',
323
324
  flexShrink: 1,
324
325
  maxWidth: '80%'
325
326
  },
326
327
  deviceMeta: {
327
- fontSize: scale(10),
328
+ fontSize: RFValue(9),
328
329
  marginTop: scale(2),
329
330
  flexShrink: 1
330
331
  },
@@ -337,7 +338,7 @@ const styles = StyleSheet.create({
337
338
  alignItems: 'center'
338
339
  },
339
340
  logoutText: {
340
- fontSize: scale(11),
341
+ fontSize: RFValue(10),
341
342
  fontWeight: '600'
342
343
  },
343
344
  badge: {
@@ -346,7 +347,7 @@ const styles = StyleSheet.create({
346
347
  borderRadius: scale(6)
347
348
  },
348
349
  badgeText: {
349
- fontSize: scale(10),
350
+ fontSize: RFValue(9),
350
351
  fontWeight: '500',
351
352
  maxWidth: scale(100),
352
353
  flexShrink: 1
@@ -357,7 +358,7 @@ const styles = StyleSheet.create({
357
358
  justifyContent: 'center'
358
359
  },
359
360
  emptyText: {
360
- fontSize: scale(12),
361
+ fontSize: RFValue(11),
361
362
  textAlign: 'center'
362
363
  },
363
364
  skeletonLine: {
@@ -9,13 +9,14 @@ import { FlatGrid } from 'react-native-super-grid';
9
9
  import { scale } from 'react-native-size-matters';
10
10
  import { Search } from 'lucide-react-native';
11
11
 
12
- import { useTheme } from '../../../theme';
12
+ import { useTheme } from '../../../theme/hook/useTheme';
13
13
 
14
14
  import AppHeader from '../../Headers/AppHeader';
15
15
  import { Text } from '../../Text';
16
16
  import CardPoster from '../../Content/Card/components/CardPoster';
17
17
  import type { IContentData } from '../../../types';
18
18
  import type { AppTheme } from '../../../theme/themes';
19
+ import { RFValue } from 'react-native-responsive-fontsize';
19
20
 
20
21
  export interface IHistoryItem {
21
22
  _id: string;
@@ -119,7 +120,6 @@ export const WatchHistory: React.FC<WatchHistoryProps> = ({
119
120
  titleAlign="left"
120
121
  theme={appliedTheme}
121
122
  titleStyle={{
122
- ...styles.title,
123
123
  color: appliedTheme.colors.onBackground
124
124
  }}
125
125
  onRightPress={onSearchPress}
@@ -134,7 +134,7 @@ export const WatchHistory: React.FC<WatchHistoryProps> = ({
134
134
  data={listData}
135
135
  keyExtractor={(item, index) => item._id || `item-${index}`}
136
136
  style={listStyle}
137
- contentContainerStyle={contentContainerStyle}
137
+ contentContainerStyle={[contentContainerStyle, { paddingBottom: scale(50) }]}
138
138
  renderItem={renderGridItem}
139
139
  onEndReached={onEndReached}
140
140
  onEndReachedThreshold={onEndReachedThreshold ?? 0.5}
@@ -154,16 +154,14 @@ const styles = StyleSheet.create({
154
154
  container: {
155
155
  flex: 1
156
156
  },
157
- title: {
158
- fontSize: scale(15)
159
- },
157
+
160
158
  noData: {
161
159
  flex: 1,
162
160
  alignItems: 'center',
163
161
  justifyContent: 'center'
164
162
  },
165
163
  noDataText: {
166
- fontSize: scale(14),
164
+ fontSize: RFValue(12),
167
165
  opacity: 0.5
168
166
  }
169
167
  });
@@ -19,7 +19,7 @@ import { scale } from 'react-native-size-matters';
19
19
  import { Search } from 'lucide-react-native';
20
20
  import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
21
21
 
22
- import { useTheme } from '../../../theme';
22
+ import { useTheme } from '../../../theme/hook/useTheme';
23
23
 
24
24
  import AppHeader from '../../Headers/AppHeader';
25
25
  import { Text } from '../../Text';
@@ -27,6 +27,7 @@ import { ThumbnailCard } from '../../Content/Card/components/ThumbnailCard';
27
27
  import CardPoster from '../../Content/Card/components/CardPoster';
28
28
  import type { IContentData } from '../../../types';
29
29
  import type { AppTheme, ITheme } from '../../../theme/themes';
30
+ import { RFValue } from 'react-native-responsive-fontsize';
30
31
 
31
32
  type IWatchLaterItem = {
32
33
  _id: string;
@@ -158,7 +159,7 @@ export const WatchLater: React.FC<WatchLaterProps> = ({
158
159
  <Text numberOfLines={1} style={styles.detailedTitle}>
159
160
  {item?.content?.name}
160
161
  </Text>
161
- <Text numberOfLines={4} style={[styles.detailedDesc, { color: appliedTheme.colors.textSecondary }]}>
162
+ <Text numberOfLines={5} style={[styles.detailedDesc, { color: appliedTheme.colors.textSecondary }]}>
162
163
  {item?.content?.description}
163
164
  </Text>
164
165
  </View>
@@ -239,14 +240,14 @@ const styles = StyleSheet.create({
239
240
  justifyContent: 'center'
240
241
  },
241
242
  noDataText: {
242
- fontSize: scale(14),
243
+ fontSize: RFValue(13),
243
244
  opacity: 0.5
244
245
  },
245
246
  contentContainerFlatStyle: {
246
- paddingBottom: scale(100)
247
+ paddingBottom: scale(50)
247
248
  },
248
249
  thumbnailWrapper: {
249
- width: scale(140),
250
+ width: scale(150),
250
251
  aspectRatio: 16 / 9,
251
252
  borderRadius: scale(6),
252
253
  overflow: 'hidden',
@@ -271,14 +272,16 @@ const styles = StyleSheet.create({
271
272
  },
272
273
  detailedInfo: {
273
274
  flex: 1,
274
- marginLeft: scale(8)
275
+ marginLeft: scale(5)
275
276
  },
276
277
  detailedTitle: {
277
- fontSize: scale(13),
278
- fontWeight: 'bold'
278
+ fontSize: RFValue(11),
279
+ fontWeight: '500'
279
280
  },
280
281
  detailedDesc: {
281
- fontSize: scale(10),
282
+ fontSize: RFValue(9),
283
+ textAlign: 'auto',
284
+ fontWeight: '400',
282
285
  marginTop: scale(1)
283
286
  }
284
287
  });
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from 'react';
2
2
  import { Image, StyleSheet, View } from 'react-native';
3
3
  import { scale } from 'react-native-size-matters';
4
- import { useTheme } from '../../../theme';
4
+ import { useTheme } from '../../../theme/hook/useTheme';
5
5
  import type { AppTheme } from '../../../theme/themes';
6
6
 
7
7
  const fallbackAvatar = require('../../../assets/img/profile.jpg');
@@ -9,8 +9,9 @@ import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
9
9
  import { moderateScale, scale, verticalScale } from 'react-native-size-matters';
10
10
  import UserAvatar from './UserAvatar';
11
11
  import { Text } from '../../Text';
12
- import { useTheme } from '../../../theme';
12
+ import { useTheme } from '../../../theme/hook/useTheme';
13
13
  import type { AppTheme } from '../../../theme/themes';
14
+ import { RFValue } from 'react-native-responsive-fontsize';
14
15
 
15
16
  export interface UserInfo {
16
17
  name: string;
@@ -143,19 +144,19 @@ const styles = {
143
144
  justifyContent: 'center'
144
145
  } as ViewStyle,
145
146
  editLabel: {
146
- fontSize: moderateScale(9),
147
+ fontSize: RFValue(8),
147
148
  marginTop: verticalScale(1),
148
149
  fontWeight: '500',
149
150
  lineHeight: moderateScale(12)
150
151
  } as TextStyle,
151
152
  userName: {
152
- fontSize: moderateScale(16),
153
+ fontSize: RFValue(15),
153
154
  fontWeight: '600',
154
155
  marginTop: verticalScale(10),
155
156
  marginBottom: verticalScale(2)
156
157
  } as TextStyle,
157
158
  userEmail: {
158
- fontSize: moderateScale(14),
159
+ fontSize: RFValue(13),
159
160
  opacity: 0.7
160
161
  } as TextStyle,
161
162
  skeletonWrapper: {
@@ -8,7 +8,6 @@ export * from './Loader/Loader';
8
8
  export * from './Headers';
9
9
  export * from './Content/Content';
10
10
  export * from './Logo/Logo';
11
- export * from './SplashScreen';
12
11
  export * from './Auth';
13
12
  export * from './layout';
14
13
  export * from './Settings';
@@ -1,25 +1,32 @@
1
- /**
2
- * @author Naresh Dhamu
3
- * @lastModified Wed 25 Jun 2025 at 02:34 PM
4
- */
5
-
6
- import React from 'react';
1
+ import React, { useMemo } from 'react';
7
2
  import { StyleSheet, type ViewStyle } from 'react-native';
8
3
  import { SafeAreaView } from 'react-native-safe-area-context';
9
- import { useTheme } from '../../theme';
10
4
  import type { AppTheme } from '../../theme/themes';
5
+ import { useTheme } from '../../theme/hook/useTheme';
11
6
 
12
7
  type SafeAreaWrapperProps = {
13
8
  children: React.ReactNode;
14
9
  style?: ViewStyle;
15
10
  theme?: AppTheme;
11
+ edges?: ('top' | 'right' | 'bottom' | 'left')[];
12
+ fallbackBackground?: string;
16
13
  };
17
14
 
18
- export const SafeAreaWrapper: React.FC<SafeAreaWrapperProps> = ({ children, style, theme }) => {
15
+ export const SafeAreaWrapper: React.FC<SafeAreaWrapperProps> = ({
16
+ children,
17
+ style,
18
+ theme,
19
+ edges = ['top'],
20
+ fallbackBackground = '#fff'
21
+ }) => {
19
22
  const { theme: appliedTheme } = useTheme(theme);
20
23
 
24
+ const containerStyle = useMemo(() => {
25
+ return [styles.container, { backgroundColor: appliedTheme?.colors?.background || fallbackBackground }, style];
26
+ }, [appliedTheme.colors.background, fallbackBackground, style]);
27
+
21
28
  return (
22
- <SafeAreaView style={[styles.container, { backgroundColor: appliedTheme.colors.background }, style]}>
29
+ <SafeAreaView edges={edges} style={containerStyle}>
23
30
  {children}
24
31
  </SafeAreaView>
25
32
  );
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @author Naresh Dhamu
3
- * @lastModified Thu 12 Jun 2025 at 07:57 PM
3
+ * @lastModified Tue 29 Jul 2025 at 05:37 PM
4
4
  */
5
5
 
6
6
  import { useEffect, useState } from 'react';
@@ -9,59 +9,75 @@ import CryptoJS from 'crypto-js';
9
9
  import { MMKV } from 'react-native-mmkv';
10
10
  import { useSplashStore } from '../store/splashStore';
11
11
 
12
- const mmkv = new MMKV(); // Initialize MMKV instance
13
- const downloadPromises = new Map<string, Promise<string | null>>();
12
+ const mmkvStorage = new MMKV();
13
+ const inFlightDownloadsMap = new Map<string, Promise<string | null>>();
14
14
 
15
- const getSplashLocalPath = async (
15
+ const SUPPORTED_FILE_TYPES = ['json', 'mp4', 'jpg', 'jpeg', 'png', 'webp'] as const;
16
+
17
+ const extractFileExtension = (url: string): string => {
18
+ try {
19
+ const cleanUrl = url.split('?')[0];
20
+ const ext = cleanUrl?.substring(cleanUrl.lastIndexOf('.') + 1).toLowerCase() || '';
21
+ return SUPPORTED_FILE_TYPES.includes(ext as (typeof SUPPORTED_FILE_TYPES)[number]) ? ext : 'png';
22
+ } catch {
23
+ return 'png';
24
+ }
25
+ };
26
+
27
+ const cacheSplashAsset = async (
16
28
  url: string,
17
29
  extension: string,
18
- LAST_HASH_KEY: string,
30
+ mmkvKey: string,
19
31
  forceDownload: boolean
20
32
  ): Promise<string | null> => {
21
33
  if (!url?.trim()) return null;
22
34
 
23
- const sanitizedExtension = extension.replace(/^\./, '').trim() || 'mp4';
24
- const currentHash = CryptoJS.MD5(`${url}|${LAST_HASH_KEY}|${sanitizedExtension}`).toString();
25
- const filePath = `${RNFS.CachesDirectoryPath}/splash_${currentHash}.${sanitizedExtension}`;
35
+ const ext = extension.replace(/^\./, '').trim() || 'mp4';
36
+ const hash = CryptoJS.MD5(`${url}|${mmkvKey}|${ext}`).toString();
37
+ const localPath = `${RNFS.CachesDirectoryPath}/splash_${hash}.${ext}`;
26
38
 
27
- if (downloadPromises.has(currentHash)) {
28
- return downloadPromises.get(currentHash)!;
39
+ if (inFlightDownloadsMap.has(hash)) {
40
+ return inFlightDownloadsMap.get(hash)!;
29
41
  }
30
42
 
31
- const downloadOperation = (async () => {
32
- const lastUsedHash = mmkv.getString(LAST_HASH_KEY); // Updated to use MMKV getString
43
+ const downloadTask = (async () => {
44
+ try {
45
+ const previousHash = mmkvStorage.getString(mmkvKey);
33
46
 
34
- if (lastUsedHash && lastUsedHash !== currentHash) {
35
- const oldFilePath = `${RNFS.CachesDirectoryPath}/splash_${lastUsedHash}.${sanitizedExtension}`;
36
- const existsOld = await RNFS.exists(oldFilePath);
37
- if (existsOld) await RNFS.unlink(oldFilePath).catch(() => {});
38
- }
47
+ if (previousHash && previousHash !== hash) {
48
+ const oldPath = `${RNFS.CachesDirectoryPath}/splash_${previousHash}.${ext}`;
49
+ const exists = await RNFS.exists(oldPath);
50
+ if (exists) {
51
+ await RNFS.unlink(oldPath).catch(() => {});
52
+ }
53
+ }
39
54
 
40
- if (!forceDownload) {
41
- const exists = await RNFS.exists(filePath);
42
- if (exists && lastUsedHash === currentHash) {
43
- return filePath;
55
+ if (!forceDownload) {
56
+ const exists = await RNFS.exists(localPath);
57
+ if (exists && previousHash === hash) {
58
+ return localPath;
59
+ }
44
60
  }
45
- }
46
61
 
47
- const result = await RNFS.downloadFile({
48
- fromUrl: url,
49
- toFile: filePath,
50
- cacheable: true,
51
- readTimeout: 15000,
52
- connectionTimeout: 10000
53
- }).promise;
54
-
55
- if (result.statusCode === 200) {
56
- mmkv.set(LAST_HASH_KEY, currentHash); // Updated to use MMKV set
57
- return filePath;
58
- }
62
+ const { statusCode } = await RNFS.downloadFile({
63
+ fromUrl: url,
64
+ toFile: localPath,
65
+ cacheable: true,
66
+ readTimeout: 15000,
67
+ connectionTimeout: 10000
68
+ }).promise;
69
+
70
+ if (statusCode === 200) {
71
+ mmkvStorage.set(mmkvKey, hash);
72
+ return localPath;
73
+ }
74
+ } catch {}
59
75
 
60
76
  return null;
61
77
  })();
62
78
 
63
- downloadPromises.set(currentHash, downloadOperation);
64
- return downloadOperation;
79
+ inFlightDownloadsMap.set(hash, downloadTask);
80
+ return downloadTask;
65
81
  };
66
82
 
67
83
  type UseSplashCacheSyncOptions = {
@@ -70,90 +86,61 @@ type UseSplashCacheSyncOptions = {
70
86
  forceDownload?: boolean;
71
87
  };
72
88
 
73
- // Helper to extract extension from URL
74
- const SUPPORTED_EXTENSIONS = ['json', 'mp4', 'jpg', 'jpeg', 'png', 'webp'] as const;
75
-
76
- const extractExtensionFromUrl = (url: string): string => {
77
- try {
78
- const cleanUrl = url.split('?')[0];
79
- const ext =
80
- cleanUrl
81
- ?.substring(cleanUrl.lastIndexOf('.') + 1)
82
- .trim()
83
- .toLowerCase() || '';
84
-
85
- return SUPPORTED_EXTENSIONS.includes(ext as any) ? ext : 'png';
86
- } catch {
87
- return 'png';
88
- }
89
- };
90
-
91
89
  export const useInitSplashCacheSync = ({
92
90
  logoUrl,
93
91
  backgroundUrl,
94
92
  forceDownload = false
95
- }: UseSplashCacheSyncOptions): {
96
- state: { isReady: boolean; error: Error | null };
97
- isLoading: boolean;
98
- data: {
99
- localPathLogo: string | null;
100
- localPathBackground: string | null;
101
- };
102
- } => {
103
- const [state, setState] = useState({
93
+ }: UseSplashCacheSyncOptions) => {
94
+ const [splashSyncState, setSplashSyncState] = useState({
104
95
  isReady: false,
105
96
  error: null as Error | null
106
97
  });
107
98
 
108
- const setLocalPathLogo = useSplashStore((s) => s.setLogoPath);
109
- const setLocalPathBackground = useSplashStore((s) => s.setBackdropPath);
99
+ const setSplashLogoPath = useSplashStore((s) => s.setLogoPath);
100
+ const setSplashBackgroundPath = useSplashStore((s) => s.setBackdropPath);
110
101
 
111
102
  useEffect(() => {
112
103
  let isMounted = true;
113
104
 
114
- const syncCache = async () => {
105
+ const syncSplashAssets = async () => {
115
106
  try {
116
- const [logoPath, bgPath] = await Promise.all([
107
+ const [logoPath, backgroundPath] = await Promise.all([
117
108
  logoUrl
118
- ? getSplashLocalPath(logoUrl, extractExtensionFromUrl(logoUrl), 'logo', forceDownload)
109
+ ? cacheSplashAsset(logoUrl, extractFileExtension(logoUrl), 'splash_logo', forceDownload)
119
110
  : Promise.resolve(null),
120
111
  backgroundUrl
121
- ? getSplashLocalPath(
122
- backgroundUrl,
123
- extractExtensionFromUrl(backgroundUrl),
124
- 'backgroundImage',
125
- forceDownload
126
- )
112
+ ? cacheSplashAsset(backgroundUrl, extractFileExtension(backgroundUrl), 'splash_background', forceDownload)
127
113
  : Promise.resolve(null)
128
114
  ]);
129
115
 
130
116
  if (!isMounted) return;
131
117
 
132
- if (logoPath) setLocalPathLogo?.(`file://${logoPath}`);
133
- if (bgPath) setLocalPathBackground?.(`file://${bgPath}`);
118
+ if (logoPath) setSplashLogoPath?.(logoPath);
119
+ if (backgroundPath) setSplashBackgroundPath?.(backgroundPath);
134
120
 
135
- setState({ isReady: true, error: null });
121
+ setSplashSyncState({ isReady: true, error: null });
136
122
  } catch (err) {
137
123
  if (isMounted) {
138
- setState({ isReady: true, error: err as Error });
124
+ setSplashSyncState({ isReady: true, error: err as Error });
139
125
  }
140
126
  }
141
127
  };
142
128
 
143
- syncCache();
144
-
129
+ syncSplashAssets();
145
130
  return () => {
146
131
  isMounted = false;
147
132
  };
148
- }, [logoUrl, backgroundUrl, forceDownload, setLocalPathLogo, setLocalPathBackground]);
149
- const localPathLogo = useSplashStore((s) => s.logo.localPath);
150
- const localPathBackground = useSplashStore((s) => s.backdrop.localPath);
133
+ }, [logoUrl, backgroundUrl, forceDownload, setSplashLogoPath, setSplashBackgroundPath]);
134
+
135
+ const splashLogoLocalPath = useSplashStore((s) => s.logo.localPath);
136
+ const splashBackgroundLocalPath = useSplashStore((s) => s.backdrop.localPath);
137
+
151
138
  return {
152
- state,
153
- isLoading: !state.isReady && !state.error,
139
+ state: splashSyncState,
140
+ isLoading: !splashSyncState.isReady && !splashSyncState.error,
154
141
  data: {
155
- localPathLogo,
156
- localPathBackground
142
+ localPathLogo: splashLogoLocalPath,
143
+ localPathBackground: splashBackgroundLocalPath
157
144
  }
158
145
  };
159
146
  };