@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.
- package/README.md +1 -1
- package/lib/module/components/Account/Account.js +7 -6
- package/lib/module/components/Account/Account.js.map +1 -1
- package/lib/module/components/Auth/ForgotPassword/ForgotPassword.js +39 -27
- package/lib/module/components/Auth/ForgotPassword/ForgotPassword.js.map +1 -1
- package/lib/module/components/Auth/Login/LoginWithEmail.js +39 -25
- package/lib/module/components/Auth/Login/LoginWithEmail.js.map +1 -1
- package/lib/module/components/Auth/Login/LoginWithPhone.js +34 -25
- package/lib/module/components/Auth/Login/LoginWithPhone.js.map +1 -1
- package/lib/module/components/Auth/OTP/OTP.js +61 -42
- package/lib/module/components/Auth/OTP/OTP.js.map +1 -1
- package/lib/module/components/Auth/SignUp/SignUp.js +41 -26
- package/lib/module/components/Auth/SignUp/SignUp.js.map +1 -1
- package/lib/module/components/Auth/SplashScreen/SplashScreen.js +132 -0
- package/lib/module/components/Auth/SplashScreen/SplashScreen.js.map +1 -0
- package/lib/module/components/Auth/SplashScreen/components/SplashImage/SplashImage.js +61 -0
- package/lib/module/components/Auth/SplashScreen/components/SplashImage/SplashImage.js.map +1 -0
- package/lib/module/components/{SplashScreen → Auth/SplashScreen}/components/SplashLottie/SplashLottie.js +8 -17
- package/lib/module/components/Auth/SplashScreen/components/SplashLottie/SplashLottie.js.map +1 -0
- package/lib/module/components/{SplashScreen → Auth/SplashScreen}/components/SplashVideo/SplashVideo.js +25 -11
- package/lib/module/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.js.map +1 -0
- package/lib/module/components/Auth/index.js +3 -1
- package/lib/module/components/Auth/index.js.map +1 -1
- package/lib/module/components/BackgroundLayout/BackgroundLayout.js +77 -57
- package/lib/module/components/BackgroundLayout/BackgroundLayout.js.map +1 -1
- package/lib/module/components/BlogView/BlogView.js +28 -9
- package/lib/module/components/BlogView/BlogView.js.map +1 -1
- package/lib/module/components/Button/BackBtn.js +1 -1
- package/lib/module/components/Button/BackBtn.js.map +1 -1
- package/lib/module/components/Button/MenuBtn.js +5 -3
- package/lib/module/components/Button/MenuBtn.js.map +1 -1
- package/lib/module/components/Button/PrimaryBtn.js +3 -2
- package/lib/module/components/Button/PrimaryBtn.js.map +1 -1
- package/lib/module/components/Button/TextButton.js +3 -2
- package/lib/module/components/Button/TextButton.js.map +1 -1
- package/lib/module/components/Content/Card/Category/Category.js +3 -2
- package/lib/module/components/Content/Card/Category/Category.js.map +1 -1
- package/lib/module/components/Content/Card/NowWatching/NowWatching.js +10 -7
- package/lib/module/components/Content/Card/NowWatching/NowWatching.js.map +1 -1
- package/lib/module/components/Content/Card/Sliders/Styles/One.js +6 -4
- package/lib/module/components/Content/Card/Sliders/Styles/One.js.map +1 -1
- package/lib/module/components/Content/Card/Sliders/Styles/Two.js +3 -2
- package/lib/module/components/Content/Card/Sliders/Styles/Two.js.map +1 -1
- package/lib/module/components/Content/Card/Sliders/index.js +1 -1
- package/lib/module/components/Content/Card/Sliders/index.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/Five.js +7 -6
- package/lib/module/components/Content/Card/Styles/Five.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/Four.js +9 -7
- package/lib/module/components/Content/Card/Styles/Four.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/One.js +33 -70
- package/lib/module/components/Content/Card/Styles/One.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/RotateInOut.js +6 -5
- package/lib/module/components/Content/Card/Styles/RotateInOut.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/Six.js +7 -5
- package/lib/module/components/Content/Card/Styles/Six.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/Three.js +6 -5
- package/lib/module/components/Content/Card/Styles/Three.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/TopTen.js +10 -12
- package/lib/module/components/Content/Card/Styles/TopTen.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/Two.js +8 -6
- package/lib/module/components/Content/Card/Styles/Two.js.map +1 -1
- package/lib/module/components/Content/Card/components/CardPoster.js +17 -9
- package/lib/module/components/Content/Card/components/CardPoster.js.map +1 -1
- package/lib/module/components/Content/Card/components/NavigateToMore.js +4 -3
- package/lib/module/components/Content/Card/components/NavigateToMore.js.map +1 -1
- package/lib/module/components/Content/Card/components/NoContentFallback.js +5 -4
- package/lib/module/components/Content/Card/components/NoContentFallback.js.map +1 -1
- package/lib/module/components/Content/Card/components/ThumbnailCard.js +2 -1
- package/lib/module/components/Content/Card/components/ThumbnailCard.js.map +1 -1
- package/lib/module/components/Content/Content.js +21 -7
- package/lib/module/components/Content/Content.js.map +1 -1
- package/lib/module/components/Content/Sections.js +1 -1
- package/lib/module/components/Content/Sections.js.map +1 -1
- package/lib/module/components/ContentView/ContentView.js +8 -6
- package/lib/module/components/ContentView/ContentView.js.map +1 -1
- package/lib/module/components/ContentView/MoreContentList.js +211 -0
- package/lib/module/components/ContentView/MoreContentList.js.map +1 -0
- package/lib/module/components/ContentView/components/AboutSection.js +5 -4
- package/lib/module/components/ContentView/components/AboutSection.js.map +1 -1
- package/lib/module/components/ContentView/components/CastCard.js +5 -4
- package/lib/module/components/ContentView/components/CastCard.js.map +1 -1
- package/lib/module/components/ContentView/components/EpisodeCard.js +23 -3
- package/lib/module/components/ContentView/components/EpisodeCard.js.map +1 -1
- package/lib/module/components/ContentView/components/GenreTags.js +2 -1
- package/lib/module/components/ContentView/components/GenreTags.js.map +1 -1
- package/lib/module/components/ContentView/components/HeroBanner.js +14 -5
- package/lib/module/components/ContentView/components/HeroBanner.js.map +1 -1
- package/lib/module/components/ContentView/components/Title.js +4 -3
- package/lib/module/components/ContentView/components/Title.js.map +1 -1
- package/lib/module/components/ContentView/index.js +1 -0
- package/lib/module/components/ContentView/index.js.map +1 -1
- package/lib/module/components/Headers/AppHeader.js +20 -25
- package/lib/module/components/Headers/AppHeader.js.map +1 -1
- package/lib/module/components/Headers/One.js +1 -1
- package/lib/module/components/Headers/Three.js +5 -3
- package/lib/module/components/Headers/Three.js.map +1 -1
- package/lib/module/components/Headers/Two.js +5 -3
- package/lib/module/components/Headers/Two.js.map +1 -1
- package/lib/module/components/Input/InputOne.js +6 -4
- package/lib/module/components/Input/InputOne.js.map +1 -1
- package/lib/module/components/Input/InputTwo.js +5 -4
- package/lib/module/components/Input/InputTwo.js.map +1 -1
- package/lib/module/components/Input/PhoneNumberInput.js +12 -11
- package/lib/module/components/Input/PhoneNumberInput.js.map +1 -1
- package/lib/module/components/Keyboard/HideKeyboard.js +40 -12
- package/lib/module/components/Keyboard/HideKeyboard.js.map +1 -1
- package/lib/module/components/Logo/Logo.js +2 -1
- package/lib/module/components/Logo/Logo.js.map +1 -1
- package/lib/module/components/Search/One.js +6 -4
- package/lib/module/components/Search/One.js.map +1 -1
- package/lib/module/components/Search/components/RecentSearchesSection.js +10 -9
- package/lib/module/components/Search/components/RecentSearchesSection.js.map +1 -1
- package/lib/module/components/Search/components/SearchCard.js +6 -5
- package/lib/module/components/Search/components/SearchCard.js.map +1 -1
- package/lib/module/components/Settings/AppSettings.js +5 -4
- package/lib/module/components/Settings/AppSettings.js.map +1 -1
- package/lib/module/components/Subscription/SubOne.js +16 -15
- package/lib/module/components/Subscription/SubOne.js.map +1 -1
- package/lib/module/components/TabBar/One.js +5 -3
- package/lib/module/components/TabBar/One.js.map +1 -1
- package/lib/module/components/TabBar/Three.js +18 -14
- package/lib/module/components/TabBar/Three.js.map +1 -1
- package/lib/module/components/TabBar/Two.js +4 -2
- package/lib/module/components/TabBar/Two.js.map +1 -1
- package/lib/module/components/Text/Text.js +4 -4
- package/lib/module/components/Text/Text.js.map +1 -1
- package/lib/module/components/User/DeviceSessions/DeviceSessions.js +7 -6
- package/lib/module/components/User/DeviceSessions/DeviceSessions.js.map +1 -1
- package/lib/module/components/User/WatchHistory/WatchHistory.js +6 -7
- package/lib/module/components/User/WatchHistory/WatchHistory.js.map +1 -1
- package/lib/module/components/User/WatchLater/WatchLater.js +12 -9
- package/lib/module/components/User/WatchLater/WatchLater.js.map +1 -1
- package/lib/module/components/User/components/UserAvatar.js +1 -1
- package/lib/module/components/User/components/UserAvatar.js.map +1 -1
- package/lib/module/components/User/components/UserSection.js +5 -4
- package/lib/module/components/User/components/UserSection.js.map +1 -1
- package/lib/module/components/index.js +0 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/layout/SafeAreaWrapper.js +12 -11
- package/lib/module/components/layout/SafeAreaWrapper.js.map +1 -1
- package/lib/module/hooks/useInitSplashCacheSync.js +67 -63
- package/lib/module/hooks/useInitSplashCacheSync.js.map +1 -1
- package/lib/module/hooks/useKeyboard.js +7 -9
- package/lib/module/hooks/useKeyboard.js.map +1 -1
- package/lib/module/hooks/usePaginatedSection.js +10 -3
- package/lib/module/hooks/usePaginatedSection.js.map +1 -1
- package/lib/module/theme/ThemeProvider.js +55 -52
- package/lib/module/theme/ThemeProvider.js.map +1 -1
- package/lib/module/theme/hook/useTheme.js +45 -0
- package/lib/module/theme/hook/useTheme.js.map +1 -0
- package/lib/module/theme/index.js +1 -0
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/themes.js +1 -1
- package/lib/typescript/src/components/Account/Account.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/ForgotPassword/ForgotPassword.d.ts +9 -6
- package/lib/typescript/src/components/Auth/ForgotPassword/ForgotPassword.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/Login/LoginWithEmail.d.ts +6 -2
- package/lib/typescript/src/components/Auth/Login/LoginWithEmail.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/Login/LoginWithPhone.d.ts +6 -2
- package/lib/typescript/src/components/Auth/Login/LoginWithPhone.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/OTP/OTP.d.ts +7 -3
- package/lib/typescript/src/components/Auth/OTP/OTP.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/SignUp/SignUp.d.ts +6 -2
- package/lib/typescript/src/components/Auth/SignUp/SignUp.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/SplashScreen/SplashScreen.d.ts +34 -0
- package/lib/typescript/src/components/Auth/SplashScreen/SplashScreen.d.ts.map +1 -0
- package/lib/typescript/src/components/{SplashScreen → Auth/SplashScreen}/components/SplashImage/SplashImage.d.ts +2 -3
- package/lib/typescript/src/components/Auth/SplashScreen/components/SplashImage/SplashImage.d.ts.map +1 -0
- package/lib/typescript/src/components/{SplashScreen → Auth/SplashScreen}/components/SplashLottie/SplashLottie.d.ts +1 -1
- package/lib/typescript/src/components/Auth/SplashScreen/components/SplashLottie/SplashLottie.d.ts.map +1 -0
- package/lib/typescript/src/components/{SplashScreen → Auth/SplashScreen}/components/SplashVideo/SplashVideo.d.ts +1 -1
- package/lib/typescript/src/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.d.ts.map +1 -0
- package/lib/typescript/src/components/Auth/index.d.ts +49 -11
- package/lib/typescript/src/components/Auth/index.d.ts.map +1 -1
- package/lib/typescript/src/components/BackgroundLayout/BackgroundLayout.d.ts +5 -4
- package/lib/typescript/src/components/BackgroundLayout/BackgroundLayout.d.ts.map +1 -1
- package/lib/typescript/src/components/BlogView/BlogView.d.ts +1 -0
- package/lib/typescript/src/components/BlogView/BlogView.d.ts.map +1 -1
- package/lib/typescript/src/components/Button/MenuBtn.d.ts +1 -8
- package/lib/typescript/src/components/Button/MenuBtn.d.ts.map +1 -1
- package/lib/typescript/src/components/Button/PrimaryBtn.d.ts.map +1 -1
- package/lib/typescript/src/components/Button/TextButton.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Category/Category.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/NowWatching/NowWatching.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Sliders/Styles/One.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Sliders/Styles/Two.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Sliders/index.d.ts +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/Five.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/Four.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/One.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/RotateInOut.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/Six.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/Three.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/TopTen.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/Styles/Two.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/components/CardPoster.d.ts +4 -0
- package/lib/typescript/src/components/Content/Card/components/CardPoster.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/components/NavigateToMore.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/components/NoContentFallback.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/components/ThumbnailCard.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Content.d.ts +1 -0
- package/lib/typescript/src/components/Content/Content.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/MoreContentList.d.ts +27 -0
- package/lib/typescript/src/components/ContentView/MoreContentList.d.ts.map +1 -0
- package/lib/typescript/src/components/ContentView/components/AboutSection.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/CastCard.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/EpisodeCard.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/GenreTags.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/HeroBanner.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/Title.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/index.d.ts +1 -0
- package/lib/typescript/src/components/ContentView/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Headers/AppHeader.d.ts.map +1 -1
- package/lib/typescript/src/components/Headers/Three.d.ts +1 -0
- package/lib/typescript/src/components/Headers/Three.d.ts.map +1 -1
- package/lib/typescript/src/components/Headers/Two.d.ts +1 -0
- package/lib/typescript/src/components/Headers/Two.d.ts.map +1 -1
- package/lib/typescript/src/components/Input/InputOne.d.ts.map +1 -1
- package/lib/typescript/src/components/Input/InputTwo.d.ts.map +1 -1
- package/lib/typescript/src/components/Input/PhoneNumberInput.d.ts.map +1 -1
- package/lib/typescript/src/components/Keyboard/HideKeyboard.d.ts +1 -1
- package/lib/typescript/src/components/Keyboard/HideKeyboard.d.ts.map +1 -1
- package/lib/typescript/src/components/Logo/Logo.d.ts.map +1 -1
- package/lib/typescript/src/components/Search/One.d.ts.map +1 -1
- package/lib/typescript/src/components/Search/components/RecentSearchesSection.d.ts.map +1 -1
- package/lib/typescript/src/components/Search/components/SearchCard.d.ts.map +1 -1
- package/lib/typescript/src/components/Settings/AppSettings.d.ts.map +1 -1
- package/lib/typescript/src/components/Subscription/SubOne.d.ts.map +1 -1
- package/lib/typescript/src/components/Subscription/index.d.ts.map +1 -1
- package/lib/typescript/src/components/TabBar/One.d.ts.map +1 -1
- package/lib/typescript/src/components/TabBar/Three.d.ts +2 -2
- package/lib/typescript/src/components/TabBar/Three.d.ts.map +1 -1
- package/lib/typescript/src/components/TabBar/Two.d.ts.map +1 -1
- package/lib/typescript/src/components/User/DeviceSessions/DeviceSessions.d.ts.map +1 -1
- package/lib/typescript/src/components/User/WatchHistory/WatchHistory.d.ts.map +1 -1
- package/lib/typescript/src/components/User/WatchLater/WatchLater.d.ts.map +1 -1
- package/lib/typescript/src/components/User/components/UserSection.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +0 -1
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/components/layout/SafeAreaWrapper.d.ts +2 -4
- package/lib/typescript/src/components/layout/SafeAreaWrapper.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useInitSplashCacheSync.d.ts +1 -1
- package/lib/typescript/src/hooks/useInitSplashCacheSync.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useKeyboard.d.ts.map +1 -1
- package/lib/typescript/src/hooks/usePaginatedSection.d.ts +1 -0
- package/lib/typescript/src/hooks/usePaginatedSection.d.ts.map +1 -1
- package/lib/typescript/src/theme/ThemeProvider.d.ts +8 -4
- package/lib/typescript/src/theme/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/theme/hook/useTheme.d.ts +9 -0
- package/lib/typescript/src/theme/hook/useTheme.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +1 -0
- package/lib/typescript/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/src/types/content/content-view.types.d.ts +7 -3
- package/lib/typescript/src/types/content/content-view.types.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/components/Account/Account.tsx +7 -6
- package/src/components/Auth/ForgotPassword/ForgotPassword.tsx +51 -32
- package/src/components/Auth/Login/LoginWithEmail.tsx +45 -26
- package/src/components/Auth/Login/LoginWithPhone.tsx +38 -24
- package/src/components/Auth/OTP/OTP.tsx +96 -61
- package/src/components/Auth/SignUp/SignUp.tsx +49 -31
- package/src/components/Auth/SplashScreen/SplashScreen.tsx +166 -0
- package/src/components/Auth/SplashScreen/components/SplashImage/SplashImage.tsx +66 -0
- package/src/components/{SplashScreen → Auth/SplashScreen}/components/SplashLottie/SplashLottie.tsx +7 -19
- package/src/components/{SplashScreen → Auth/SplashScreen}/components/SplashVideo/SplashVideo.tsx +23 -14
- package/src/components/Auth/index.ts +3 -1
- package/src/components/BackgroundLayout/BackgroundLayout.tsx +72 -50
- package/src/components/BlogView/BlogView.tsx +29 -9
- package/src/components/Button/BackBtn.tsx +1 -1
- package/src/components/Button/MenuBtn.tsx +6 -9
- package/src/components/Button/PrimaryBtn.tsx +3 -2
- package/src/components/Button/TextButton.tsx +3 -2
- package/src/components/Content/Card/Category/Category.tsx +3 -2
- package/src/components/Content/Card/NowWatching/NowWatching.tsx +15 -8
- package/src/components/Content/Card/Sliders/Styles/One.tsx +4 -3
- package/src/components/Content/Card/Sliders/Styles/Two.tsx +3 -2
- package/src/components/Content/Card/Sliders/index.ts +1 -1
- package/src/components/Content/Card/Styles/Five.tsx +7 -6
- package/src/components/Content/Card/Styles/Four.tsx +7 -6
- package/src/components/Content/Card/Styles/One.tsx +44 -111
- package/src/components/Content/Card/Styles/RotateInOut.tsx +5 -5
- package/src/components/Content/Card/Styles/Six.tsx +7 -5
- package/src/components/Content/Card/Styles/Three.tsx +5 -5
- package/src/components/Content/Card/Styles/TopTen.tsx +10 -14
- package/src/components/Content/Card/Styles/Two.tsx +9 -7
- package/src/components/Content/Card/components/CardPoster.tsx +24 -11
- package/src/components/Content/Card/components/NavigateToMore.tsx +4 -3
- package/src/components/Content/Card/components/NoContentFallback.tsx +5 -4
- package/src/components/Content/Card/components/ThumbnailCard.tsx +2 -1
- package/src/components/Content/Content.tsx +38 -7
- package/src/components/Content/Sections.tsx +1 -1
- package/src/components/ContentView/ContentView.tsx +6 -6
- package/src/components/ContentView/MoreContentList.tsx +238 -0
- package/src/components/ContentView/components/AboutSection.tsx +5 -4
- package/src/components/ContentView/components/CastCard.tsx +5 -4
- package/src/components/ContentView/components/EpisodeCard.tsx +30 -4
- package/src/components/ContentView/components/GenreTags.tsx +2 -1
- package/src/components/ContentView/components/HeroBanner.tsx +10 -6
- package/src/components/ContentView/components/Title.tsx +4 -3
- package/src/components/ContentView/index.ts +1 -0
- package/src/components/Headers/AppHeader.tsx +20 -34
- package/src/components/Headers/One.tsx +1 -1
- package/src/components/Headers/Three.tsx +4 -3
- package/src/components/Headers/Two.tsx +4 -3
- package/src/components/Input/InputOne.tsx +6 -4
- package/src/components/Input/InputTwo.tsx +5 -4
- package/src/components/Input/PhoneNumberInput.tsx +12 -11
- package/src/components/Keyboard/HideKeyboard.tsx +41 -15
- package/src/components/Logo/Logo.tsx +2 -1
- package/src/components/Search/One.tsx +6 -5
- package/src/components/Search/components/RecentSearchesSection.tsx +10 -9
- package/src/components/Search/components/SearchCard.tsx +6 -5
- package/src/components/Settings/AppSettings.tsx +14 -13
- package/src/components/Subscription/SubOne.tsx +16 -15
- package/src/components/TabBar/One.tsx +6 -3
- package/src/components/TabBar/Three.tsx +28 -14
- package/src/components/TabBar/Two.tsx +4 -2
- package/src/components/Text/Text.tsx +4 -4
- package/src/components/User/DeviceSessions/DeviceSessions.tsx +7 -6
- package/src/components/User/WatchHistory/WatchHistory.tsx +5 -7
- package/src/components/User/WatchLater/WatchLater.tsx +12 -9
- package/src/components/User/components/UserAvatar.tsx +1 -1
- package/src/components/User/components/UserSection.tsx +5 -4
- package/src/components/index.ts +0 -1
- package/src/components/layout/SafeAreaWrapper.tsx +16 -9
- package/src/hooks/useInitSplashCacheSync.ts +74 -87
- package/src/hooks/useKeyboard.ts +9 -8
- package/src/hooks/usePaginatedSection.ts +7 -3
- package/src/theme/ThemeProvider.tsx +59 -55
- package/src/theme/hook/useTheme.ts +41 -0
- package/src/theme/index.ts +1 -0
- package/src/theme/themes.ts +1 -1
- package/src/types/content/content-view.types.ts +4 -2
- package/lib/module/components/SplashScreen/SplashScreen.js +0 -109
- package/lib/module/components/SplashScreen/SplashScreen.js.map +0 -1
- package/lib/module/components/SplashScreen/components/SplashImage/SplashImage.js +0 -68
- package/lib/module/components/SplashScreen/components/SplashImage/SplashImage.js.map +0 -1
- package/lib/module/components/SplashScreen/components/SplashLottie/SplashLottie.js.map +0 -1
- package/lib/module/components/SplashScreen/components/SplashVideo/SplashVideo.js.map +0 -1
- package/lib/module/components/SplashScreen/index.js +0 -9
- package/lib/module/components/SplashScreen/index.js.map +0 -1
- package/lib/typescript/src/components/SplashScreen/SplashScreen.d.ts +0 -32
- package/lib/typescript/src/components/SplashScreen/SplashScreen.d.ts.map +0 -1
- package/lib/typescript/src/components/SplashScreen/components/SplashImage/SplashImage.d.ts.map +0 -1
- package/lib/typescript/src/components/SplashScreen/components/SplashLottie/SplashLottie.d.ts.map +0 -1
- package/lib/typescript/src/components/SplashScreen/components/SplashVideo/SplashVideo.d.ts.map +0 -1
- package/lib/typescript/src/components/SplashScreen/index.d.ts +0 -6
- package/lib/typescript/src/components/SplashScreen/index.d.ts.map +0 -1
- package/src/components/SplashScreen/SplashScreen.tsx +0 -131
- package/src/components/SplashScreen/components/SplashImage/SplashImage.tsx +0 -84
- package/src/components/SplashScreen/index.ts +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Pressable","Edit3","SkeletonPlaceholder","moderateScale","scale","verticalScale","UserAvatar","Text","useTheme","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","UserSection","userInfo","isLoading","renderUserInfo","theme","avatarComponent","skeletonProps","userInfoTextStyle","appliedTheme","style","styles","userInfoContainer","children","backgroundColor","colors","skeletonBaseColor","highlightColor","skeletonHighlightColor","borderRadius","skeletonWrapper","skeletonAvatar","skeletonName","skeletonEmail","avatarWrapper","avatarUri","onEditPress","onPress","editButton","borderColor","primary","white","shadowColor","surface","android_ripple","color","surfaceDisabled","editContent","size","name","userName","onBackground","nameStyle","emailOrPhone","userEmail","emailStyle","alignItems","justifyContent","paddingVertical","height","position","bottom","right","width","borderWidth","elevation","shadowOffset","shadowOpacity","shadowRadius","editLabel","fontSize","marginTop","fontWeight","lineHeight","marginBottom","opacity"],"sourceRoot":"../../../../../src","sources":["components/User/components/UserSection.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,SAAS,QAAwC,cAAc;AAC9E,SAASC,KAAK,QAAQ,qBAAqB;AAC3C,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,SAASC,aAAa,EAAEC,KAAK,EAAEC,aAAa,QAAQ,2BAA2B;AAC/E,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,QAAQ,QAAQ,
|
|
1
|
+
{"version":3,"names":["React","View","Pressable","Edit3","SkeletonPlaceholder","moderateScale","scale","verticalScale","UserAvatar","Text","useTheme","RFValue","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","UserSection","userInfo","isLoading","renderUserInfo","theme","avatarComponent","skeletonProps","userInfoTextStyle","appliedTheme","style","styles","userInfoContainer","children","backgroundColor","colors","skeletonBaseColor","highlightColor","skeletonHighlightColor","borderRadius","skeletonWrapper","skeletonAvatar","skeletonName","skeletonEmail","avatarWrapper","avatarUri","onEditPress","onPress","editButton","borderColor","primary","white","shadowColor","surface","android_ripple","color","surfaceDisabled","editContent","size","name","userName","onBackground","nameStyle","emailOrPhone","userEmail","emailStyle","alignItems","justifyContent","paddingVertical","height","position","bottom","right","width","borderWidth","elevation","shadowOffset","shadowOpacity","shadowRadius","editLabel","fontSize","marginTop","fontWeight","lineHeight","marginBottom","opacity"],"sourceRoot":"../../../../../src","sources":["components/User/components/UserSection.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,SAAS,QAAwC,cAAc;AAC9E,SAASC,KAAK,QAAQ,qBAAqB;AAC3C,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,SAASC,aAAa,EAAEC,KAAK,EAAEC,aAAa,QAAQ,2BAA2B;AAC/E,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,QAAQ,QAAQ,8BAA8B;AAEvD,SAASC,OAAO,QAAQ,kCAAkC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAwB3D,MAAMC,WAAuC,GAAGA,CAAC;EAC/CC,QAAQ;EACRC,SAAS;EACTC,cAAc;EACdC,KAAK;EACLC,eAAe;EACfC,aAAa,GAAG,CAAC,CAAC;EAClBC,iBAAiB,GAAG,CAAC;AACvB,CAAC,KAAK;EACJ,MAAM;IAAEH,KAAK,EAAEI;EAAa,CAAC,GAAGhB,QAAQ,CAACY,KAAK,CAAC;EAC/C,IAAI,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AAe,EAAE;IACf0B,UAAU,EAAE;EACd,CAAc;EACdzB,cAAc,EAAE;IACdgC,KAAK,EAAEhE,KAAK,CAAC,EAAE,CAAC;IAChB4D,MAAM,EAAE5D,KAAK,CAAC,EAAE,CAAC;IACjB8B,YAAY,EAAE9B,KAAK,CAAC,EAAE,CAAC;IACvB2E,YAAY,EAAE1E,aAAa,CAAC,EAAE;EAChC,CAAc;EACdgC,YAAY,EAAE;IACZ+B,KAAK,EAAEhE,KAAK,CAAC,GAAG,CAAC;IACjB4D,MAAM,EAAE3D,aAAa,CAAC,EAAE,CAAC;IACzB6B,YAAY,EAAE/B,aAAa,CAAC,CAAC,CAAC;IAC9B4E,YAAY,EAAE1E,aAAa,CAAC,CAAC;EAC/B,CAAc;EACdiC,aAAa,EAAE;IACb8B,KAAK,EAAEhE,KAAK,CAAC,GAAG,CAAC;IACjB4D,MAAM,EAAE3D,aAAa,CAAC,EAAE,CAAC;IACzB6B,YAAY,EAAE/B,aAAa,CAAC,CAAC;EAC/B;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,cAAc,qBAAqB;AACnC,cAAc,iBAAiB;AAC/B,cAAc,WAAW;AACzB,cAAc,mBAAmB;AACjC,cAAc,aAAa;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,cAAc,qBAAqB;AACnC,cAAc,iBAAiB;AAC/B,cAAc,WAAW;AACzB,cAAc,mBAAmB;AACjC,cAAc,aAAa;AAC3B,cAAc,QAAQ;AACtB,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,gBAAgB","ignoreList":[]}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* @author Naresh Dhamu
|
|
5
|
-
* @lastModified Wed 25 Jun 2025 at 02:34 PM
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React from 'react';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
9
4
|
import { StyleSheet } from 'react-native';
|
|
10
5
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
11
|
-
import { useTheme } from '../../theme';
|
|
6
|
+
import { useTheme } from '../../theme/hook/useTheme';
|
|
12
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
8
|
export const SafeAreaWrapper = ({
|
|
14
9
|
children,
|
|
15
10
|
style,
|
|
16
|
-
theme
|
|
11
|
+
theme,
|
|
12
|
+
edges = ['top'],
|
|
13
|
+
fallbackBackground = '#fff'
|
|
17
14
|
}) => {
|
|
18
15
|
const {
|
|
19
16
|
theme: appliedTheme
|
|
20
17
|
} = useTheme(theme);
|
|
18
|
+
const containerStyle = useMemo(() => {
|
|
19
|
+
return [styles.container, {
|
|
20
|
+
backgroundColor: appliedTheme?.colors?.background || fallbackBackground
|
|
21
|
+
}, style];
|
|
22
|
+
}, [appliedTheme.colors.background, fallbackBackground, style]);
|
|
21
23
|
return /*#__PURE__*/_jsx(SafeAreaView, {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}, style],
|
|
24
|
+
edges: edges,
|
|
25
|
+
style: containerStyle,
|
|
25
26
|
children: children
|
|
26
27
|
});
|
|
27
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","SafeAreaView","useTheme","jsx","_jsx","SafeAreaWrapper","children","style","theme","appliedTheme","styles","container","backgroundColor","colors","background","create","flex"],"sourceRoot":"../../../../src","sources":["components/layout/SafeAreaWrapper.tsx"],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"names":["React","useMemo","StyleSheet","SafeAreaView","useTheme","jsx","_jsx","SafeAreaWrapper","children","style","theme","edges","fallbackBackground","appliedTheme","containerStyle","styles","container","backgroundColor","colors","background","create","flex"],"sourceRoot":"../../../../src","sources":["components/layout/SafeAreaWrapper.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,UAAU,QAAwB,cAAc;AACzD,SAASC,YAAY,QAAQ,gCAAgC;AAE7D,SAASC,QAAQ,QAAQ,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAUrD,OAAO,MAAMC,eAA+C,GAAGA,CAAC;EAC9DC,QAAQ;EACRC,KAAK;EACLC,KAAK;EACLC,KAAK,GAAG,CAAC,KAAK,CAAC;EACfC,kBAAkB,GAAG;AACvB,CAAC,KAAK;EACJ,MAAM;IAAEF,KAAK,EAAEG;EAAa,CAAC,GAAGT,QAAQ,CAACM,KAAK,CAAC;EAE/C,MAAMI,cAAc,GAAGb,OAAO,CAAC,MAAM;IACnC,OAAO,CAACc,MAAM,CAACC,SAAS,EAAE;MAAEC,eAAe,EAAEJ,YAAY,EAAEK,MAAM,EAAEC,UAAU,IAAIP;IAAmB,CAAC,EAAEH,KAAK,CAAC;EAC/G,CAAC,EAAE,CAACI,YAAY,CAACK,MAAM,CAACC,UAAU,EAAEP,kBAAkB,EAAEH,KAAK,CAAC,CAAC;EAE/D,oBACEH,IAAA,CAACH,YAAY;IAACQ,KAAK,EAAEA,KAAM;IAACF,KAAK,EAAEK,cAAe;IAAAN,QAAA,EAC/CA;EAAQ,CACG,CAAC;AAEnB,CAAC;AAED,MAAMO,MAAM,GAAGb,UAAU,CAACkB,MAAM,CAAC;EAC/BJ,SAAS,EAAE;IACTK,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @author Naresh Dhamu
|
|
5
|
-
* @lastModified
|
|
5
|
+
* @lastModified Tue 29 Jul 2025 at 05:37 PM
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { useEffect, useState } from 'react';
|
|
@@ -10,102 +10,106 @@ import RNFS from 'react-native-fs';
|
|
|
10
10
|
import CryptoJS from 'crypto-js';
|
|
11
11
|
import { MMKV } from 'react-native-mmkv';
|
|
12
12
|
import { useSplashStore } from '../store/splashStore';
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const sanitizedExtension = extension.replace(/^\./, '').trim() || 'mp4';
|
|
18
|
-
const currentHash = CryptoJS.MD5(`${url}|${LAST_HASH_KEY}|${sanitizedExtension}`).toString();
|
|
19
|
-
const filePath = `${RNFS.CachesDirectoryPath}/splash_${currentHash}.${sanitizedExtension}`;
|
|
20
|
-
if (downloadPromises.has(currentHash)) {
|
|
21
|
-
return downloadPromises.get(currentHash);
|
|
22
|
-
}
|
|
23
|
-
const downloadOperation = (async () => {
|
|
24
|
-
const lastUsedHash = mmkv.getString(LAST_HASH_KEY); // Updated to use MMKV getString
|
|
25
|
-
|
|
26
|
-
if (lastUsedHash && lastUsedHash !== currentHash) {
|
|
27
|
-
const oldFilePath = `${RNFS.CachesDirectoryPath}/splash_${lastUsedHash}.${sanitizedExtension}`;
|
|
28
|
-
const existsOld = await RNFS.exists(oldFilePath);
|
|
29
|
-
if (existsOld) await RNFS.unlink(oldFilePath).catch(() => {});
|
|
30
|
-
}
|
|
31
|
-
if (!forceDownload) {
|
|
32
|
-
const exists = await RNFS.exists(filePath);
|
|
33
|
-
if (exists && lastUsedHash === currentHash) {
|
|
34
|
-
return filePath;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
const result = await RNFS.downloadFile({
|
|
38
|
-
fromUrl: url,
|
|
39
|
-
toFile: filePath,
|
|
40
|
-
cacheable: true,
|
|
41
|
-
readTimeout: 15000,
|
|
42
|
-
connectionTimeout: 10000
|
|
43
|
-
}).promise;
|
|
44
|
-
if (result.statusCode === 200) {
|
|
45
|
-
mmkv.set(LAST_HASH_KEY, currentHash); // Updated to use MMKV set
|
|
46
|
-
return filePath;
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
})();
|
|
50
|
-
downloadPromises.set(currentHash, downloadOperation);
|
|
51
|
-
return downloadOperation;
|
|
52
|
-
};
|
|
53
|
-
// Helper to extract extension from URL
|
|
54
|
-
const SUPPORTED_EXTENSIONS = ['json', 'mp4', 'jpg', 'jpeg', 'png', 'webp'];
|
|
55
|
-
const extractExtensionFromUrl = url => {
|
|
13
|
+
const mmkvStorage = new MMKV();
|
|
14
|
+
const inFlightDownloadsMap = new Map();
|
|
15
|
+
const SUPPORTED_FILE_TYPES = ['json', 'mp4', 'jpg', 'jpeg', 'png', 'webp'];
|
|
16
|
+
const extractFileExtension = url => {
|
|
56
17
|
try {
|
|
57
18
|
const cleanUrl = url.split('?')[0];
|
|
58
|
-
const ext = cleanUrl?.substring(cleanUrl.lastIndexOf('.') + 1).
|
|
59
|
-
return
|
|
19
|
+
const ext = cleanUrl?.substring(cleanUrl.lastIndexOf('.') + 1).toLowerCase() || '';
|
|
20
|
+
return SUPPORTED_FILE_TYPES.includes(ext) ? ext : 'png';
|
|
60
21
|
} catch {
|
|
61
22
|
return 'png';
|
|
62
23
|
}
|
|
63
24
|
};
|
|
25
|
+
const cacheSplashAsset = async (url, extension, mmkvKey, forceDownload) => {
|
|
26
|
+
if (!url?.trim()) return null;
|
|
27
|
+
const ext = extension.replace(/^\./, '').trim() || 'mp4';
|
|
28
|
+
const hash = CryptoJS.MD5(`${url}|${mmkvKey}|${ext}`).toString();
|
|
29
|
+
const localPath = `${RNFS.CachesDirectoryPath}/splash_${hash}.${ext}`;
|
|
30
|
+
if (inFlightDownloadsMap.has(hash)) {
|
|
31
|
+
return inFlightDownloadsMap.get(hash);
|
|
32
|
+
}
|
|
33
|
+
const downloadTask = (async () => {
|
|
34
|
+
try {
|
|
35
|
+
const previousHash = mmkvStorage.getString(mmkvKey);
|
|
36
|
+
if (previousHash && previousHash !== hash) {
|
|
37
|
+
const oldPath = `${RNFS.CachesDirectoryPath}/splash_${previousHash}.${ext}`;
|
|
38
|
+
const exists = await RNFS.exists(oldPath);
|
|
39
|
+
if (exists) {
|
|
40
|
+
await RNFS.unlink(oldPath).catch(() => {});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (!forceDownload) {
|
|
44
|
+
const exists = await RNFS.exists(localPath);
|
|
45
|
+
if (exists && previousHash === hash) {
|
|
46
|
+
return localPath;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const {
|
|
50
|
+
statusCode
|
|
51
|
+
} = await RNFS.downloadFile({
|
|
52
|
+
fromUrl: url,
|
|
53
|
+
toFile: localPath,
|
|
54
|
+
cacheable: true,
|
|
55
|
+
readTimeout: 15000,
|
|
56
|
+
connectionTimeout: 10000
|
|
57
|
+
}).promise;
|
|
58
|
+
if (statusCode === 200) {
|
|
59
|
+
mmkvStorage.set(mmkvKey, hash);
|
|
60
|
+
return localPath;
|
|
61
|
+
}
|
|
62
|
+
} catch {}
|
|
63
|
+
return null;
|
|
64
|
+
})();
|
|
65
|
+
inFlightDownloadsMap.set(hash, downloadTask);
|
|
66
|
+
return downloadTask;
|
|
67
|
+
};
|
|
64
68
|
export const useInitSplashCacheSync = ({
|
|
65
69
|
logoUrl,
|
|
66
70
|
backgroundUrl,
|
|
67
71
|
forceDownload = false
|
|
68
72
|
}) => {
|
|
69
|
-
const [
|
|
73
|
+
const [splashSyncState, setSplashSyncState] = useState({
|
|
70
74
|
isReady: false,
|
|
71
75
|
error: null
|
|
72
76
|
});
|
|
73
|
-
const
|
|
74
|
-
const
|
|
77
|
+
const setSplashLogoPath = useSplashStore(s => s.setLogoPath);
|
|
78
|
+
const setSplashBackgroundPath = useSplashStore(s => s.setBackdropPath);
|
|
75
79
|
useEffect(() => {
|
|
76
80
|
let isMounted = true;
|
|
77
|
-
const
|
|
81
|
+
const syncSplashAssets = async () => {
|
|
78
82
|
try {
|
|
79
|
-
const [logoPath,
|
|
83
|
+
const [logoPath, backgroundPath] = await Promise.all([logoUrl ? cacheSplashAsset(logoUrl, extractFileExtension(logoUrl), 'splash_logo', forceDownload) : Promise.resolve(null), backgroundUrl ? cacheSplashAsset(backgroundUrl, extractFileExtension(backgroundUrl), 'splash_background', forceDownload) : Promise.resolve(null)]);
|
|
80
84
|
if (!isMounted) return;
|
|
81
|
-
if (logoPath)
|
|
82
|
-
if (
|
|
83
|
-
|
|
85
|
+
if (logoPath) setSplashLogoPath?.(logoPath);
|
|
86
|
+
if (backgroundPath) setSplashBackgroundPath?.(backgroundPath);
|
|
87
|
+
setSplashSyncState({
|
|
84
88
|
isReady: true,
|
|
85
89
|
error: null
|
|
86
90
|
});
|
|
87
91
|
} catch (err) {
|
|
88
92
|
if (isMounted) {
|
|
89
|
-
|
|
93
|
+
setSplashSyncState({
|
|
90
94
|
isReady: true,
|
|
91
95
|
error: err
|
|
92
96
|
});
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
99
|
};
|
|
96
|
-
|
|
100
|
+
syncSplashAssets();
|
|
97
101
|
return () => {
|
|
98
102
|
isMounted = false;
|
|
99
103
|
};
|
|
100
|
-
}, [logoUrl, backgroundUrl, forceDownload,
|
|
101
|
-
const
|
|
102
|
-
const
|
|
104
|
+
}, [logoUrl, backgroundUrl, forceDownload, setSplashLogoPath, setSplashBackgroundPath]);
|
|
105
|
+
const splashLogoLocalPath = useSplashStore(s => s.logo.localPath);
|
|
106
|
+
const splashBackgroundLocalPath = useSplashStore(s => s.backdrop.localPath);
|
|
103
107
|
return {
|
|
104
|
-
state,
|
|
105
|
-
isLoading: !
|
|
108
|
+
state: splashSyncState,
|
|
109
|
+
isLoading: !splashSyncState.isReady && !splashSyncState.error,
|
|
106
110
|
data: {
|
|
107
|
-
localPathLogo,
|
|
108
|
-
localPathBackground
|
|
111
|
+
localPathLogo: splashLogoLocalPath,
|
|
112
|
+
localPathBackground: splashBackgroundLocalPath
|
|
109
113
|
}
|
|
110
114
|
};
|
|
111
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useState","RNFS","CryptoJS","MMKV","useSplashStore","
|
|
1
|
+
{"version":3,"names":["useEffect","useState","RNFS","CryptoJS","MMKV","useSplashStore","mmkvStorage","inFlightDownloadsMap","Map","SUPPORTED_FILE_TYPES","extractFileExtension","url","cleanUrl","split","ext","substring","lastIndexOf","toLowerCase","includes","cacheSplashAsset","extension","mmkvKey","forceDownload","trim","replace","hash","MD5","toString","localPath","CachesDirectoryPath","has","get","downloadTask","previousHash","getString","oldPath","exists","unlink","catch","statusCode","downloadFile","fromUrl","toFile","cacheable","readTimeout","connectionTimeout","promise","set","useInitSplashCacheSync","logoUrl","backgroundUrl","splashSyncState","setSplashSyncState","isReady","error","setSplashLogoPath","s","setLogoPath","setSplashBackgroundPath","setBackdropPath","isMounted","syncSplashAssets","logoPath","backgroundPath","Promise","all","resolve","err","splashLogoLocalPath","logo","splashBackgroundLocalPath","backdrop","state","isLoading","data","localPathLogo","localPathBackground"],"sourceRoot":"../../../src","sources":["hooks/useInitSplashCacheSync.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,QAAQ,MAAM,WAAW;AAChC,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,cAAc,QAAQ,sBAAsB;AAErD,MAAMC,WAAW,GAAG,IAAIF,IAAI,CAAC,CAAC;AAC9B,MAAMG,oBAAoB,GAAG,IAAIC,GAAG,CAAiC,CAAC;AAEtE,MAAMC,oBAAoB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAU;AAEnF,MAAMC,oBAA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mBAAmB,GAAG/D,cAAc,CAAEmD,CAAC,IAAKA,CAAC,CAACa,IAAI,CAACzC,SAAS,CAAC;EACnE,MAAM0C,yBAAyB,GAAGjE,cAAc,CAAEmD,CAAC,IAAKA,CAAC,CAACe,QAAQ,CAAC3C,SAAS,CAAC;EAE7E,OAAO;IACL4C,KAAK,EAAErB,eAAe;IACtBsB,SAAS,EAAE,CAACtB,eAAe,CAACE,OAAO,IAAI,CAACF,eAAe,CAACG,KAAK;IAC7DoB,IAAI,EAAE;MACJC,aAAa,EAAEP,mBAAmB;MAClCQ,mBAAmB,EAAEN;IACvB;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -5,24 +5,22 @@
|
|
|
5
5
|
* @lastModified Sat 14 Jun 2025 at 03:01 PM
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
// use keyboard hook check keyboard open or not
|
|
9
8
|
import { useEffect, useState } from 'react';
|
|
10
|
-
import { Keyboard } from 'react-native';
|
|
9
|
+
import { Keyboard, Platform } from 'react-native';
|
|
11
10
|
export const useKeyboard = () => {
|
|
12
11
|
const [isKeyboardOpen, setKeyboardOpen] = useState(false);
|
|
13
|
-
|
|
14
|
-
// hide keyboard when keyboard open
|
|
15
|
-
|
|
16
12
|
useEffect(() => {
|
|
17
|
-
const
|
|
13
|
+
const showEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';
|
|
14
|
+
const hideEvent = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
|
|
15
|
+
const showListener = Keyboard.addListener(showEvent, () => {
|
|
18
16
|
setKeyboardOpen(true);
|
|
19
17
|
});
|
|
20
|
-
const
|
|
18
|
+
const hideListener = Keyboard.addListener(hideEvent, () => {
|
|
21
19
|
setKeyboardOpen(false);
|
|
22
20
|
});
|
|
23
21
|
return () => {
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
showListener.remove();
|
|
23
|
+
hideListener.remove();
|
|
26
24
|
};
|
|
27
25
|
}, []);
|
|
28
26
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useState","Keyboard","useKeyboard","isKeyboardOpen","setKeyboardOpen","
|
|
1
|
+
{"version":3,"names":["useEffect","useState","Keyboard","Platform","useKeyboard","isKeyboardOpen","setKeyboardOpen","showEvent","OS","hideEvent","showListener","addListener","hideListener","remove","hideKeyboard","dismiss"],"sourceRoot":"../../../src","sources":["hooks/useKeyboard.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAEjD,OAAO,MAAMC,WAAW,GAAGA,CAAA,KAAM;EAC/B,MAAM,CAACC,cAAc,EAAEC,eAAe,CAAC,GAAGL,QAAQ,CAAC,KAAK,CAAC;EAEzDD,SAAS,CAAC,MAAM;IACd,MAAMO,SAAS,GAAGJ,QAAQ,CAACK,EAAE,KAAK,KAAK,GAAG,kBAAkB,GAAG,iBAAiB;IAChF,MAAMC,SAAS,GAAGN,QAAQ,CAACK,EAAE,KAAK,KAAK,GAAG,kBAAkB,GAAG,iBAAiB;IAEhF,MAAME,YAAY,GAAGR,QAAQ,CAACS,WAAW,CAACJ,SAAS,EAAE,MAAM;MACzDD,eAAe,CAAC,IAAI,CAAC;IACvB,CAAC,CAAC;IAEF,MAAMM,YAAY,GAAGV,QAAQ,CAACS,WAAW,CAACF,SAAS,EAAE,MAAM;MACzDH,eAAe,CAAC,KAAK,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,MAAM;MACXI,YAAY,CAACG,MAAM,CAAC,CAAC;MACrBD,YAAY,CAACC,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLR,cAAc;IACdS,YAAY,EAAEA,CAAA,KAAMZ,QAAQ,CAACa,OAAO,CAAC;EACvC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -12,6 +12,8 @@ export function usePaginatedSection(sectionId, fetchFn, initialData = [], isLoad
|
|
|
12
12
|
nextPage: 2
|
|
13
13
|
});
|
|
14
14
|
const [loading, setLoading] = useState(false);
|
|
15
|
+
|
|
16
|
+
// Sync initial data on mount or loading complete
|
|
15
17
|
React.useEffect(() => {
|
|
16
18
|
if (!isLoading && initialData.length) {
|
|
17
19
|
setData(initialData);
|
|
@@ -32,25 +34,30 @@ export function usePaginatedSection(sectionId, fetchFn, initialData = [], isLoad
|
|
|
32
34
|
console.warn(`⚠️ Invalid response for section: ${sectionId}`, res);
|
|
33
35
|
return;
|
|
34
36
|
}
|
|
37
|
+
const {
|
|
38
|
+
hasNextPage,
|
|
39
|
+
nextPage
|
|
40
|
+
} = res.meta.pagination;
|
|
35
41
|
setData(prev => {
|
|
36
42
|
const existingIds = new Set(prev.map(item => item._id));
|
|
37
43
|
const newItems = res.data.filter(item => !existingIds.has(item._id));
|
|
38
44
|
return [...prev, ...newItems];
|
|
39
45
|
});
|
|
40
46
|
setPagination({
|
|
41
|
-
hasNextPage
|
|
42
|
-
nextPage
|
|
47
|
+
hasNextPage,
|
|
48
|
+
nextPage
|
|
43
49
|
});
|
|
44
50
|
} catch (err) {
|
|
45
51
|
console.error(`❌ Error loading section [${sectionId}]:`, err);
|
|
46
52
|
} finally {
|
|
47
53
|
setLoading(false);
|
|
48
54
|
}
|
|
49
|
-
}, [loading, pagination, fetchFn, sectionId]);
|
|
55
|
+
}, [loading, pagination.hasNextPage, fetchFn, sectionId]);
|
|
50
56
|
return {
|
|
51
57
|
data,
|
|
52
58
|
pagination,
|
|
53
59
|
loading,
|
|
60
|
+
hasMore: pagination.hasNextPage,
|
|
54
61
|
loadMoreData
|
|
55
62
|
};
|
|
56
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useState","usePaginatedSection","sectionId","fetchFn","initialData","isLoading","data","setData","pagination","setPagination","hasNextPage","nextPage","loading","setLoading","useEffect","length","loadMoreData","page","res","meta","console","warn","prev","existingIds","Set","map","item","_id","newItems","filter","has","err","error"],"sourceRoot":"../../../src","sources":["hooks/usePaginatedSection.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAGpD,OAAO,SAASC,mBAAmBA,CACjCC,SAAiB,EACjBC,OAA0B,EAC1BC,WAAgB,GAAG,EAAE,EACrBC,SAAmB,EACnB;EACA,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGP,QAAQ,CAAMI,WAAW,CAAC;EAClD,MAAM,CAACI,UAAU,EAAEC,aAAa,CAAC,GAAGT,QAAQ,CAGzC;IACDU,WAAW,EAAE,IAAI;IACjBC,QAAQ,EAAE;EACZ,CAAC,CAAC;EACF,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGb,QAAQ,CAAC,KAAK,CAAC;
|
|
1
|
+
{"version":3,"names":["React","useCallback","useState","usePaginatedSection","sectionId","fetchFn","initialData","isLoading","data","setData","pagination","setPagination","hasNextPage","nextPage","loading","setLoading","useEffect","length","loadMoreData","page","res","meta","console","warn","prev","existingIds","Set","map","item","_id","newItems","filter","has","err","error","hasMore"],"sourceRoot":"../../../src","sources":["hooks/usePaginatedSection.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AAGpD,OAAO,SAASC,mBAAmBA,CACjCC,SAAiB,EACjBC,OAA0B,EAC1BC,WAAgB,GAAG,EAAE,EACrBC,SAAmB,EACnB;EACA,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGP,QAAQ,CAAMI,WAAW,CAAC;EAClD,MAAM,CAACI,UAAU,EAAEC,aAAa,CAAC,GAAGT,QAAQ,CAGzC;IACDU,WAAW,EAAE,IAAI;IACjBC,QAAQ,EAAE;EACZ,CAAC,CAAC;EACF,MAAM,CAACC,OAAO,EAAE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AC;MAEFnB,aAAa,CAAC;QACZC,WAAW;QACXC;MACF,CAAC,CAAC;IACJ,CAAC,CAAC,OAAOoB,GAAG,EAAE;MACZX,OAAO,CAACY,KAAK,CAAC,4BAA4B9B,SAAS,IAAI,EAAE6B,GAAG,CAAC;IAC/D,CAAC,SAAS;MACRlB,UAAU,CAAC,KAAK,CAAC;IACnB;EACF,CAAC,EACD,CAACD,OAAO,EAAEJ,UAAU,CAACE,WAAW,EAAEP,OAAO,EAAED,SAAS,CACtD,CAAC;EAED,OAAO;IACLI,IAAI;IACJE,UAAU;IACVI,OAAO;IACPqB,OAAO,EAAEzB,UAAU,CAACE,WAAW;IAC/BM;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -2,86 +2,89 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @author Naresh Dhamu
|
|
5
|
-
* @lastModified Sat
|
|
5
|
+
* @lastModified Sat 26 Jul 2025 at 02:11 PM
|
|
6
6
|
*/
|
|
7
|
-
import React, { createContext,
|
|
7
|
+
import React, { createContext, useMemo, useState, useCallback, useEffect, useContext } from 'react';
|
|
8
8
|
import { View, useColorScheme, StatusBar } from 'react-native';
|
|
9
|
+
import { SafeAreaProvider, initialWindowMetrics } from 'react-native-safe-area-context';
|
|
9
10
|
import { LightTheme, DarkTheme } from './themes';
|
|
10
|
-
import {
|
|
11
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const ThemeContext = /*#__PURE__*/createContext(null);
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
export const useThemeContext = () => {
|
|
14
|
+
const ctx = useContext(ThemeContext);
|
|
15
|
+
if (!ctx) throw new Error('useTheme must be used within ZezoUIProvider');
|
|
16
|
+
return ctx;
|
|
17
|
+
};
|
|
15
18
|
const getIsDarkMode = (autoSwitchTheme, systemScheme, userDark) => {
|
|
16
|
-
if (autoSwitchTheme)
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
return userDark === true;
|
|
19
|
+
if (autoSwitchTheme) return systemScheme === 'dark';
|
|
20
|
+
return userDark ?? false;
|
|
20
21
|
};
|
|
21
22
|
export const ZezoUIProvider = ({
|
|
22
23
|
children,
|
|
23
24
|
theme,
|
|
24
|
-
autoSwitchTheme
|
|
25
|
+
autoSwitchTheme
|
|
25
26
|
}) => {
|
|
26
27
|
const systemScheme = useColorScheme() ?? null;
|
|
27
|
-
const [
|
|
28
|
+
const [overrideTheme, setOverrideTheme] = useState(theme);
|
|
29
|
+
|
|
30
|
+
// ✅ Sync prop to state if changed externally
|
|
28
31
|
useEffect(() => {
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
if (theme) {
|
|
33
|
+
setOverrideTheme(theme);
|
|
34
|
+
}
|
|
35
|
+
}, [theme]);
|
|
36
|
+
|
|
37
|
+
// ✅ This prioritizes externally passed theme.dark
|
|
38
|
+
const isDarkMode = useMemo(() => {
|
|
39
|
+
if (theme?.dark !== undefined) return theme.dark;
|
|
40
|
+
return getIsDarkMode(autoSwitchTheme, systemScheme, overrideTheme?.dark);
|
|
41
|
+
}, [theme?.dark, autoSwitchTheme, systemScheme, overrideTheme?.dark]);
|
|
31
42
|
const baseTheme = useMemo(() => isDarkMode ? DarkTheme : LightTheme, [isDarkMode]);
|
|
32
43
|
const mergedTheme = useMemo(() => {
|
|
33
44
|
return {
|
|
34
45
|
...baseTheme,
|
|
35
|
-
...
|
|
46
|
+
...overrideTheme,
|
|
47
|
+
dark: isDarkMode,
|
|
36
48
|
colors: {
|
|
37
49
|
...baseTheme.colors,
|
|
38
|
-
...(
|
|
50
|
+
...(overrideTheme?.colors ?? {})
|
|
39
51
|
}
|
|
40
52
|
};
|
|
41
|
-
}, [baseTheme,
|
|
53
|
+
}, [baseTheme, overrideTheme, isDarkMode]);
|
|
42
54
|
const toggleTheme = useCallback(() => {
|
|
43
|
-
if (autoSwitchTheme
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
if (autoSwitchTheme || theme?.dark !== undefined) return;
|
|
56
|
+
setOverrideTheme(prev => ({
|
|
57
|
+
...prev,
|
|
58
|
+
dark: !getIsDarkMode(false, null, prev?.dark)
|
|
59
|
+
}));
|
|
60
|
+
}, [autoSwitchTheme, theme?.dark]);
|
|
61
|
+
const setThemeOverride = useCallback(override => {
|
|
62
|
+
setOverrideTheme(override);
|
|
63
|
+
}, []);
|
|
64
|
+
|
|
65
|
+
// ✅ Update StatusBar only when required
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
StatusBar.setBarStyle(isDarkMode ? 'light-content' : 'dark-content', true);
|
|
68
|
+
StatusBar.setBackgroundColor(mergedTheme.colors.background, true);
|
|
69
|
+
}, [isDarkMode, mergedTheme.colors.background]);
|
|
70
|
+
const contextValue = useMemo(() => ({
|
|
71
|
+
theme: mergedTheme,
|
|
72
|
+
isDarkMode,
|
|
73
|
+
toggleTheme,
|
|
74
|
+
setThemeOverride
|
|
75
|
+
}), [mergedTheme, isDarkMode, toggleTheme, setThemeOverride]);
|
|
46
76
|
return /*#__PURE__*/_jsx(SafeAreaProvider, {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
toggleTheme
|
|
52
|
-
},
|
|
53
|
-
children: [/*#__PURE__*/_jsx(StatusBar, {
|
|
54
|
-
barStyle: isDarkMode ? 'light-content' : 'dark-content',
|
|
55
|
-
backgroundColor: mergedTheme.colors.background
|
|
56
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
77
|
+
initialMetrics: initialWindowMetrics,
|
|
78
|
+
children: /*#__PURE__*/_jsx(ThemeContext.Provider, {
|
|
79
|
+
value: contextValue,
|
|
80
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
57
81
|
style: {
|
|
58
82
|
flex: 1,
|
|
59
83
|
backgroundColor: mergedTheme.colors.background
|
|
60
84
|
},
|
|
61
85
|
children: children
|
|
62
|
-
})
|
|
86
|
+
})
|
|
63
87
|
})
|
|
64
88
|
});
|
|
65
89
|
};
|
|
66
|
-
|
|
67
|
-
// ✅ useTheme hook with optional override support
|
|
68
|
-
export const useTheme = overrideTheme => {
|
|
69
|
-
const context = useContext(ThemeContext);
|
|
70
|
-
if (!context) {
|
|
71
|
-
throw new Error('useTheme must be used within a ZezoUIProvider');
|
|
72
|
-
}
|
|
73
|
-
const finalTheme = useMemo(() => {
|
|
74
|
-
return {
|
|
75
|
-
...context.theme,
|
|
76
|
-
...overrideTheme,
|
|
77
|
-
colors: {
|
|
78
|
-
...context.theme.colors,
|
|
79
|
-
...(overrideTheme?.colors || {})
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
}, [context.theme, overrideTheme]);
|
|
83
|
-
return {
|
|
84
|
-
theme: finalTheme
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
90
|
//# sourceMappingURL=ThemeProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","
|
|
1
|
+
{"version":3,"names":["React","createContext","useMemo","useState","useCallback","useEffect","useContext","View","useColorScheme","StatusBar","SafeAreaProvider","initialWindowMetrics","LightTheme","DarkTheme","jsx","_jsx","ThemeContext","useThemeContext","ctx","Error","getIsDarkMode","autoSwitchTheme","systemScheme","userDark","ZezoUIProvider","children","theme","overrideTheme","setOverrideTheme","isDarkMode","dark","undefined","baseTheme","mergedTheme","colors","toggleTheme","prev","setThemeOverride","override","setBarStyle","setBackgroundColor","background","contextValue","initialMetrics","Provider","value","style","flex","backgroundColor"],"sourceRoot":"../../../src","sources":["theme/ThemeProvider.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,EAAEC,UAAU,QAAwB,OAAO;AACnH,SAASC,IAAI,EAAEC,cAAc,EAAEC,SAAS,QAAQ,cAAc;AAC9D,SAASC,gBAAgB,EAAEC,oBAAoB,QAAQ,gCAAgC;A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F,CAAC,CAAC,EACF,CAACJ,WAAW,EAAEJ,UAAU,EAAEM,WAAW,EAAEE,gBAAgB,CACzD,CAAC;EAED,oBACEtB,IAAA,CAACL,gBAAgB;IAACiC,cAAc,EAAEhC,oBAAqB;IAAAc,QAAA,eACrDV,IAAA,CAACC,YAAY,CAAC4B,QAAQ;MAACC,KAAK,EAAEH,YAAa;MAAAjB,QAAA,eACzCV,IAAA,CAACR,IAAI;QAACuC,KAAK,EAAE;UAAEC,IAAI,EAAE,CAAC;UAAEC,eAAe,EAAEf,WAAW,CAACC,MAAM,CAACO;QAAW,CAAE;QAAAhB,QAAA,EAAEA;MAAQ,CAAO;IAAC,CACtE;EAAC,CACR,CAAC;AAEvB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @author Naresh Dhamu
|
|
5
|
+
* @lastModified Sat 26 Jul 2025 at 02:11 PM
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React, { useMemo } from 'react';
|
|
9
|
+
import { useThemeContext } from '../ThemeProvider';
|
|
10
|
+
import { DarkTheme, LightTheme } from '../themes';
|
|
11
|
+
export const useTheme = override => {
|
|
12
|
+
const {
|
|
13
|
+
theme: contextTheme,
|
|
14
|
+
isDarkMode,
|
|
15
|
+
setThemeOverride
|
|
16
|
+
} = useThemeContext();
|
|
17
|
+
const isOverrideDark = override?.dark ?? contextTheme.dark ?? isDarkMode;
|
|
18
|
+
const baseTheme = useMemo(() => {
|
|
19
|
+
return isOverrideDark ? DarkTheme : LightTheme;
|
|
20
|
+
}, [isOverrideDark]);
|
|
21
|
+
const finalTheme = useMemo(() => {
|
|
22
|
+
return {
|
|
23
|
+
...baseTheme,
|
|
24
|
+
...override,
|
|
25
|
+
dark: isOverrideDark,
|
|
26
|
+
colors: {
|
|
27
|
+
...baseTheme.colors,
|
|
28
|
+
...(override?.colors ?? {})
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}, [baseTheme, override, isOverrideDark]);
|
|
32
|
+
|
|
33
|
+
// 🔄 Push override only once (optional)
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
if (override) {
|
|
36
|
+
setThemeOverride(override);
|
|
37
|
+
} else {
|
|
38
|
+
setThemeOverride(undefined);
|
|
39
|
+
}
|
|
40
|
+
}, [override, setThemeOverride]);
|
|
41
|
+
return useMemo(() => ({
|
|
42
|
+
theme: finalTheme
|
|
43
|
+
}), [finalTheme]);
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=useTheme.js.map
|