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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +7 -6
  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 +1 -1
  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 +2 -1
  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 +4 -2
  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 +7 -6
  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 +1 -1
  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 +2 -1
  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 +3 -1
  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
@@ -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
  };
@@ -3,26 +3,27 @@
3
3
  * @lastModified Sat 14 Jun 2025 at 03:01 PM
4
4
  */
5
5
 
6
- // use keyboard hook check keyboard open or not
7
6
  import { useEffect, useState } from 'react';
8
- import { Keyboard } from 'react-native';
7
+ import { Keyboard, Platform } from 'react-native';
9
8
 
10
9
  export const useKeyboard = () => {
11
10
  const [isKeyboardOpen, setKeyboardOpen] = useState(false);
12
11
 
13
- // hide keyboard when keyboard open
14
-
15
12
  useEffect(() => {
16
- const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => {
13
+ const showEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';
14
+ const hideEvent = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
15
+
16
+ const showListener = Keyboard.addListener(showEvent, () => {
17
17
  setKeyboardOpen(true);
18
18
  });
19
- const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
19
+
20
+ const hideListener = Keyboard.addListener(hideEvent, () => {
20
21
  setKeyboardOpen(false);
21
22
  });
22
23
 
23
24
  return () => {
24
- keyboardDidHideListener.remove();
25
- keyboardDidShowListener.remove();
25
+ showListener.remove();
26
+ hideListener.remove();
26
27
  };
27
28
  }, []);
28
29
 
@@ -21,6 +21,7 @@ export function usePaginatedSection<T>(
21
21
  });
22
22
  const [loading, setLoading] = useState(false);
23
23
 
24
+ // Sync initial data on mount or loading complete
24
25
  React.useEffect(() => {
25
26
  if (!isLoading && initialData.length) {
26
27
  setData(initialData);
@@ -46,6 +47,8 @@ export function usePaginatedSection<T>(
46
47
  return;
47
48
  }
48
49
 
50
+ const { hasNextPage, nextPage } = res.meta.pagination;
51
+
49
52
  setData((prev) => {
50
53
  const existingIds = new Set((prev as any[]).map((item: any) => item._id));
51
54
  const newItems = res.data.filter((item: any) => !existingIds.has(item._id));
@@ -53,8 +56,8 @@ export function usePaginatedSection<T>(
53
56
  });
54
57
 
55
58
  setPagination({
56
- hasNextPage: res.meta.pagination.hasNextPage,
57
- nextPage: res.meta.pagination.nextPage
59
+ hasNextPage,
60
+ nextPage
58
61
  });
59
62
  } catch (err) {
60
63
  console.error(`❌ Error loading section [${sectionId}]:`, err);
@@ -62,13 +65,14 @@ export function usePaginatedSection<T>(
62
65
  setLoading(false);
63
66
  }
64
67
  },
65
- [loading, pagination, fetchFn, sectionId]
68
+ [loading, pagination.hasNextPage, fetchFn, sectionId]
66
69
  );
67
70
 
68
71
  return {
69
72
  data,
70
73
  pagination,
71
74
  loading,
75
+ hasMore: pagination.hasNextPage,
72
76
  loadMoreData
73
77
  };
74
78
  }
@@ -1,19 +1,26 @@
1
1
  /**
2
2
  * @author Naresh Dhamu
3
- * @lastModified Sat 14 Jun 2025 at 11:11 AM
3
+ * @lastModified Sat 26 Jul 2025 at 02:11 PM
4
4
  */
5
- import React, { createContext, useContext, useMemo, useState, useCallback, useEffect, type ReactNode } from 'react';
5
+ import React, { createContext, useMemo, useState, useCallback, useEffect, useContext, type ReactNode } from 'react';
6
6
  import { View, useColorScheme, StatusBar } from 'react-native';
7
+ import { SafeAreaProvider, initialWindowMetrics } from 'react-native-safe-area-context';
7
8
  import { LightTheme, DarkTheme, type ITheme, type AppTheme } from './themes';
8
- import { SafeAreaProvider } from 'react-native-safe-area-context';
9
+
9
10
  type ThemeContextType = {
10
11
  theme: ITheme;
11
12
  isDarkMode: boolean;
12
13
  toggleTheme: () => void;
14
+ setThemeOverride: (override?: Partial<AppTheme>) => void;
13
15
  };
14
16
 
15
17
  const ThemeContext = createContext<ThemeContextType | null>(null);
16
- ThemeContext.displayName = 'AppThemeContext';
18
+
19
+ export const useThemeContext = () => {
20
+ const ctx = useContext(ThemeContext);
21
+ if (!ctx) throw new Error('useTheme must be used within ZezoUIProvider');
22
+ return ctx;
23
+ };
17
24
 
18
25
  type ZezoUIProviderProps = {
19
26
  children: ReactNode;
@@ -21,83 +28,80 @@ type ZezoUIProviderProps = {
21
28
  autoSwitchTheme?: boolean;
22
29
  };
23
30
 
24
- // ✅ Cleanly handles auto switch and manual dark mode
25
31
  const getIsDarkMode = (
26
- autoSwitchTheme: boolean,
32
+ autoSwitchTheme: boolean | undefined,
27
33
  systemScheme: 'dark' | 'light' | null,
28
34
  userDark?: boolean
29
35
  ): boolean => {
30
- if (autoSwitchTheme) {
31
- return systemScheme === 'dark';
32
- }
33
- return userDark === true;
36
+ if (autoSwitchTheme) return systemScheme === 'dark';
37
+ return userDark ?? false;
34
38
  };
35
39
 
36
- export const ZezoUIProvider: React.FC<ZezoUIProviderProps> = ({ children, theme, autoSwitchTheme = false }) => {
40
+ export const ZezoUIProvider: React.FC<ZezoUIProviderProps> = ({ children, theme, autoSwitchTheme }) => {
37
41
  const systemScheme = useColorScheme() ?? null;
38
42
 
39
- const [isDarkMode, setIsDarkMode] = useState<boolean>(() =>
40
- getIsDarkMode(autoSwitchTheme, systemScheme, theme?.dark)
41
- );
43
+ const [overrideTheme, setOverrideTheme] = useState<Partial<AppTheme> | undefined>(theme);
42
44
 
45
+ // ✅ Sync prop to state if changed externally
43
46
  useEffect(() => {
44
- setIsDarkMode(getIsDarkMode(autoSwitchTheme, systemScheme, theme?.dark));
45
- }, [autoSwitchTheme, systemScheme, theme?.dark]);
47
+ if (theme) {
48
+ setOverrideTheme(theme);
49
+ }
50
+ }, [theme]);
51
+
52
+ // ✅ This prioritizes externally passed theme.dark
53
+ const isDarkMode = useMemo(() => {
54
+ if (theme?.dark !== undefined) return theme.dark;
55
+ return getIsDarkMode(autoSwitchTheme, systemScheme, overrideTheme?.dark);
56
+ }, [theme?.dark, autoSwitchTheme, systemScheme, overrideTheme?.dark]);
46
57
 
47
58
  const baseTheme = useMemo<ITheme>(() => (isDarkMode ? DarkTheme : LightTheme), [isDarkMode]);
48
59
 
49
60
  const mergedTheme = useMemo<ITheme>(() => {
50
61
  return {
51
62
  ...baseTheme,
52
- ...theme,
63
+ ...overrideTheme,
64
+ dark: isDarkMode,
53
65
  colors: {
54
66
  ...baseTheme.colors,
55
- ...(theme?.colors || {})
67
+ ...(overrideTheme?.colors ?? {})
56
68
  }
57
69
  };
58
- }, [baseTheme, theme]);
70
+ }, [baseTheme, overrideTheme, isDarkMode]);
59
71
 
60
72
  const toggleTheme = useCallback(() => {
61
- if (autoSwitchTheme) return; // skip toggle in auto mode
62
- setIsDarkMode((prev) => !prev);
63
- }, [autoSwitchTheme]);
73
+ if (autoSwitchTheme || theme?.dark !== undefined) return;
74
+ setOverrideTheme((prev) => ({
75
+ ...prev,
76
+ dark: !getIsDarkMode(false, null, prev?.dark)
77
+ }));
78
+ }, [autoSwitchTheme, theme?.dark]);
79
+
80
+ const setThemeOverride = useCallback((override?: Partial<AppTheme>) => {
81
+ setOverrideTheme(override);
82
+ }, []);
83
+
84
+ // ✅ Update StatusBar only when required
85
+ useEffect(() => {
86
+ StatusBar.setBarStyle(isDarkMode ? 'light-content' : 'dark-content', true);
87
+ StatusBar.setBackgroundColor(mergedTheme.colors.background, true);
88
+ }, [isDarkMode, mergedTheme.colors.background]);
89
+
90
+ const contextValue = useMemo(
91
+ () => ({
92
+ theme: mergedTheme,
93
+ isDarkMode,
94
+ toggleTheme,
95
+ setThemeOverride
96
+ }),
97
+ [mergedTheme, isDarkMode, toggleTheme, setThemeOverride]
98
+ );
64
99
 
65
100
  return (
66
- <SafeAreaProvider>
67
- <ThemeContext.Provider
68
- value={{
69
- theme: mergedTheme,
70
- isDarkMode,
71
- toggleTheme
72
- }}
73
- >
74
- <StatusBar
75
- barStyle={isDarkMode ? 'light-content' : 'dark-content'}
76
- backgroundColor={mergedTheme.colors.background}
77
- />
101
+ <SafeAreaProvider initialMetrics={initialWindowMetrics}>
102
+ <ThemeContext.Provider value={contextValue}>
78
103
  <View style={{ flex: 1, backgroundColor: mergedTheme.colors.background }}>{children}</View>
79
104
  </ThemeContext.Provider>
80
105
  </SafeAreaProvider>
81
106
  );
82
107
  };
83
-
84
- // ✅ useTheme hook with optional override support
85
- export const useTheme = (overrideTheme?: Partial<AppTheme>): { theme: ITheme } => {
86
- const context = useContext(ThemeContext);
87
- if (!context) {
88
- throw new Error('useTheme must be used within a ZezoUIProvider');
89
- }
90
-
91
- const finalTheme = useMemo<ITheme>(() => {
92
- return {
93
- ...context.theme,
94
- ...overrideTheme,
95
- colors: {
96
- ...context.theme.colors,
97
- ...(overrideTheme?.colors || {})
98
- }
99
- };
100
- }, [context.theme, overrideTheme]);
101
-
102
- return { theme: finalTheme };
103
- };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @author Naresh Dhamu
3
+ * @lastModified Sat 26 Jul 2025 at 02:11 PM
4
+ */
5
+
6
+ import React, { useMemo } from 'react';
7
+ import { useThemeContext } from '../ThemeProvider';
8
+ import { DarkTheme, LightTheme, type AppTheme, type ITheme } from '../themes';
9
+
10
+ export const useTheme = (override?: Partial<AppTheme>): { theme: ITheme } => {
11
+ const { theme: contextTheme, isDarkMode, setThemeOverride } = useThemeContext();
12
+
13
+ const isOverrideDark = override?.dark ?? contextTheme.dark ?? isDarkMode;
14
+
15
+ const baseTheme = useMemo(() => {
16
+ return isOverrideDark ? DarkTheme : LightTheme;
17
+ }, [isOverrideDark]);
18
+
19
+ const finalTheme = useMemo<ITheme>(() => {
20
+ return {
21
+ ...baseTheme,
22
+ ...override,
23
+ dark: isOverrideDark,
24
+ colors: {
25
+ ...baseTheme.colors,
26
+ ...(override?.colors ?? {})
27
+ }
28
+ };
29
+ }, [baseTheme, override, isOverrideDark]);
30
+
31
+ // 🔄 Push override only once (optional)
32
+ React.useEffect(() => {
33
+ if (override) {
34
+ setThemeOverride(override);
35
+ } else {
36
+ setThemeOverride(undefined);
37
+ }
38
+ }, [override, setThemeOverride]);
39
+
40
+ return useMemo(() => ({ theme: finalTheme }), [finalTheme]);
41
+ };