@zezosoft/zezo-ott-react-native-ui-kit 1.1.0 → 1.1.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/lib/module/Styles/globalStyles.js +0 -5
- package/lib/module/Styles/globalStyles.js.map +1 -1
- package/lib/module/components/Auth/AuthProvider/AuthProvider.js +64 -40
- package/lib/module/components/Auth/AuthProvider/AuthProvider.js.map +1 -1
- package/lib/module/components/Auth/ForgotPassword/ForgotPassword.js +5 -2
- package/lib/module/components/Auth/ForgotPassword/ForgotPassword.js.map +1 -1
- package/lib/module/components/Auth/Login/LoginWithEmail.js +17 -11
- package/lib/module/components/Auth/Login/LoginWithEmail.js.map +1 -1
- package/lib/module/components/Auth/Login/LoginWithPhone.js +12 -6
- package/lib/module/components/Auth/Login/LoginWithPhone.js.map +1 -1
- package/lib/module/components/Auth/OTP/OTP.js +7 -4
- package/lib/module/components/Auth/OTP/OTP.js.map +1 -1
- package/lib/module/components/Auth/QrLogin/QrLogin.js +133 -86
- package/lib/module/components/Auth/QrLogin/QrLogin.js.map +1 -1
- package/lib/module/components/Auth/QrLogin/components/QrViewArea.js +174 -109
- package/lib/module/components/Auth/QrLogin/components/QrViewArea.js.map +1 -1
- package/lib/module/components/Auth/SignUp/SignUp.js +19 -13
- package/lib/module/components/Auth/SignUp/SignUp.js.map +1 -1
- package/lib/module/components/Auth/SplashScreen/SplashScreen.js +54 -36
- package/lib/module/components/Auth/SplashScreen/SplashScreen.js.map +1 -1
- package/lib/module/components/Auth/SplashScreen/components/SplashImage/SplashImage.js +29 -11
- package/lib/module/components/Auth/SplashScreen/components/SplashImage/SplashImage.js.map +1 -1
- package/lib/module/components/Auth/SplashScreen/components/SplashLottie/SplashLottie.js +13 -7
- package/lib/module/components/Auth/SplashScreen/components/SplashLottie/SplashLottie.js.map +1 -1
- package/lib/module/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.js +33 -21
- package/lib/module/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.js.map +1 -1
- package/lib/module/components/BackgroundLayout/BackgroundLayout.js +26 -20
- package/lib/module/components/BackgroundLayout/BackgroundLayout.js.map +1 -1
- package/lib/module/components/BlogView/BlogView.js +36 -20
- package/lib/module/components/BlogView/BlogView.js.map +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +152 -0
- package/lib/module/components/BottomSheet/BottomSheet.js.map +1 -0
- package/lib/module/components/BottomSheet/index.js +4 -0
- package/lib/module/components/BottomSheet/index.js.map +1 -0
- package/lib/module/components/Button/BackBtn.js +46 -16
- package/lib/module/components/Button/BackBtn.js.map +1 -1
- package/lib/module/components/Button/PrimaryBtn.js +19 -13
- package/lib/module/components/Button/PrimaryBtn.js.map +1 -1
- package/lib/module/components/Button/SecondaryBtn.js +19 -13
- package/lib/module/components/Button/SecondaryBtn.js.map +1 -1
- package/lib/module/components/Button/TextButton.js +19 -13
- package/lib/module/components/Button/TextButton.js.map +1 -1
- package/lib/module/components/Content/Card/Category/Category.js +70 -37
- package/lib/module/components/Content/Card/Category/Category.js.map +1 -1
- package/lib/module/components/Content/Card/Sliders/Styles/One.js +40 -32
- package/lib/module/components/Content/Card/Sliders/Styles/One.js.map +1 -1
- package/lib/module/components/Content/Card/Sliders/Styles/Two.js +109 -48
- package/lib/module/components/Content/Card/Sliders/Styles/Two.js.map +1 -1
- package/lib/module/components/Content/Card/Styles/RotateInOut.js +4 -11
- package/lib/module/components/Content/Card/Styles/RotateInOut.js.map +1 -1
- package/lib/module/components/Content/Card/components/CardPoster.js +105 -43
- package/lib/module/components/Content/Card/components/CardPoster.js.map +1 -1
- package/lib/module/components/Content/Card/components/RentOrBuyIcon.js +18 -17
- package/lib/module/components/Content/Card/components/RentOrBuyIcon.js.map +1 -1
- package/lib/module/components/Content/Card/components/ThumbnailCard.js +78 -28
- package/lib/module/components/Content/Card/components/ThumbnailCard.js.map +1 -1
- package/lib/module/components/Content/Content.js +44 -25
- package/lib/module/components/Content/Content.js.map +1 -1
- package/lib/module/components/Content/Sections.js +37 -29
- package/lib/module/components/Content/Sections.js.map +1 -1
- package/lib/module/components/ContentView/ContentView.js +70 -41
- package/lib/module/components/ContentView/ContentView.js.map +1 -1
- package/lib/module/components/ContentView/MoreContentList.js +74 -40
- package/lib/module/components/ContentView/MoreContentList.js.map +1 -1
- package/lib/module/components/ContentView/components/AboutSection.js +40 -19
- package/lib/module/components/ContentView/components/AboutSection.js.map +1 -1
- package/lib/module/components/ContentView/components/CastCard.js +6 -7
- package/lib/module/components/ContentView/components/CastCard.js.map +1 -1
- package/lib/module/components/ContentView/components/EpisodeCard.js +2 -2
- package/lib/module/components/ContentView/components/EpisodeCard.js.map +1 -1
- package/lib/module/components/ContentView/components/GenreTags.js +25 -13
- package/lib/module/components/ContentView/components/GenreTags.js.map +1 -1
- package/lib/module/components/ContentView/components/HeroBanner.js +39 -11
- package/lib/module/components/ContentView/components/HeroBanner.js.map +1 -1
- package/lib/module/components/ContentView/components/MiniInfo.js +84 -77
- package/lib/module/components/ContentView/components/MiniInfo.js.map +1 -1
- package/lib/module/components/ContentView/components/PlayButton.js +11 -7
- package/lib/module/components/ContentView/components/PlayButton.js.map +1 -1
- package/lib/module/components/ContentView/components/Title.js +12 -12
- package/lib/module/components/ContentView/components/Title.js.map +1 -1
- package/lib/module/components/ContentView/components/TrailerButton.js +12 -7
- package/lib/module/components/ContentView/components/TrailerButton.js.map +1 -1
- package/lib/module/components/Fallbacks/NoContentFallback.js +27 -22
- package/lib/module/components/Fallbacks/NoContentFallback.js.map +1 -1
- package/lib/module/components/Fallbacks/NotFoundFallback.js +6 -4
- package/lib/module/components/Fallbacks/NotFoundFallback.js.map +1 -1
- package/lib/module/components/Headers/AppHeader.js +22 -13
- package/lib/module/components/Headers/AppHeader.js.map +1 -1
- package/lib/module/components/Headers/Three.js +6 -5
- package/lib/module/components/Headers/Three.js.map +1 -1
- package/lib/module/components/Headers/Two.js +19 -14
- package/lib/module/components/Headers/Two.js.map +1 -1
- package/lib/module/components/Input/InputOne.js +46 -31
- package/lib/module/components/Input/InputOne.js.map +1 -1
- package/lib/module/components/Loader/Loader.js +2 -2
- package/lib/module/components/Loader/Loader.js.map +1 -1
- package/lib/module/components/Logo/Logo.js +17 -14
- package/lib/module/components/Logo/Logo.js.map +1 -1
- package/lib/module/components/Reels/ReelsSeries/MediaControls/BottomControls.js +134 -0
- package/lib/module/components/Reels/ReelsSeries/MediaControls/BottomControls.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.js +154 -0
- package/lib/module/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/MediaControls/MiddleControls.js +173 -0
- package/lib/module/components/Reels/ReelsSeries/MediaControls/MiddleControls.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/MediaControls/RightControls.js +77 -0
- package/lib/module/components/Reels/ReelsSeries/MediaControls/RightControls.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/MediaControls/TopControls.js +132 -0
- package/lib/module/components/Reels/ReelsSeries/MediaControls/TopControls.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/Model/DetailsModal.js +165 -0
- package/lib/module/components/Reels/ReelsSeries/Model/DetailsModal.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/Model/SettingModal.js +106 -0
- package/lib/module/components/Reels/ReelsSeries/Model/SettingModal.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/Model/UnlockModal.js +124 -0
- package/lib/module/components/Reels/ReelsSeries/Model/UnlockModal.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/ReelsSeries.js +102 -64
- package/lib/module/components/Reels/ReelsSeries/ReelsSeries.js.map +1 -1
- package/lib/module/components/Reels/ReelsSeries/ReelsSeriesItem.js +241 -232
- package/lib/module/components/Reels/ReelsSeries/ReelsSeriesItem.js.map +1 -1
- package/lib/module/components/Reels/ReelsSeries/components/AnimatedThreeLines.js +153 -0
- package/lib/module/components/Reels/ReelsSeries/components/AnimatedThreeLines.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/{Model → components}/Episodes.js +46 -36
- package/lib/module/components/Reels/ReelsSeries/components/Episodes.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/components/GradientOverlay.js +35 -0
- package/lib/module/components/Reels/ReelsSeries/components/GradientOverlay.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/components/Like.js +37 -0
- package/lib/module/components/Reels/ReelsSeries/components/Like.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/components/RotatingLoader.js +55 -0
- package/lib/module/components/Reels/ReelsSeries/components/RotatingLoader.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/components/Synopsis.js +268 -0
- package/lib/module/components/Reels/ReelsSeries/components/Synopsis.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/components/VideoControls/QualityControl.js +143 -0
- package/lib/module/components/Reels/ReelsSeries/components/VideoControls/QualityControl.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.js +56 -0
- package/lib/module/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.js.map +1 -0
- package/lib/module/components/Reels/ReelsSeries/components/VideoControls/index.js +5 -0
- package/lib/module/components/Reels/ReelsSeries/components/VideoControls/index.js.map +1 -0
- package/lib/module/components/Reels/utils/Controls/gestureUtils.js +30 -0
- package/lib/module/components/Reels/utils/Controls/gestureUtils.js.map +1 -0
- package/lib/module/components/Reels/utils/Controls/index.js +7 -0
- package/lib/module/components/Reels/utils/Controls/index.js.map +1 -0
- package/lib/module/components/Reels/utils/Controls/overlayUtils.js +28 -0
- package/lib/module/components/Reels/utils/Controls/overlayUtils.js.map +1 -0
- package/lib/module/components/Reels/utils/Controls/videoControlsConstants.js +27 -0
- package/lib/module/components/Reels/utils/Controls/videoControlsConstants.js.map +1 -0
- package/lib/module/components/Reels/utils/Controls/videoRef.js +5 -0
- package/lib/module/components/Reels/utils/Controls/videoRef.js.map +1 -0
- package/lib/module/components/Reels/utils/index.js +4 -0
- package/lib/module/components/Reels/utils/index.js.map +1 -0
- package/lib/module/components/Reels/utils/timeoutUtils.js +24 -0
- package/lib/module/components/Reels/utils/timeoutUtils.js.map +1 -0
- package/lib/module/components/Search/One.js +2 -1
- package/lib/module/components/Search/One.js.map +1 -1
- package/lib/module/components/Search/components/SearchCard.js +15 -19
- package/lib/module/components/Search/components/SearchCard.js.map +1 -1
- package/lib/module/components/Settings/AppSettings.js +97 -62
- package/lib/module/components/Settings/AppSettings.js.map +1 -1
- package/lib/module/components/Subscription/SubOne.js +313 -254
- package/lib/module/components/Subscription/SubOne.js.map +1 -1
- package/lib/module/components/Text/Text.js +15 -12
- package/lib/module/components/Text/Text.js.map +1 -1
- package/lib/module/components/User/DeviceSessions/DeviceSessions.js +25 -23
- package/lib/module/components/User/DeviceSessions/DeviceSessions.js.map +1 -1
- package/lib/module/components/User/ProfileUpdate/ProfileUpdate.js +23 -18
- package/lib/module/components/User/ProfileUpdate/ProfileUpdate.js.map +1 -1
- package/lib/module/components/User/PurchaseHistory/PurchaseHistory.js +38 -24
- package/lib/module/components/User/PurchaseHistory/PurchaseHistory.js.map +1 -1
- package/lib/module/components/User/WatchHistory/WatchHistory.js +21 -14
- package/lib/module/components/User/WatchHistory/WatchHistory.js.map +1 -1
- package/lib/module/components/User/WatchLater/WatchLater.js +30 -21
- package/lib/module/components/User/WatchLater/WatchLater.js.map +1 -1
- package/lib/module/components/User/components/UserAvatar.js +38 -19
- package/lib/module/components/User/components/UserAvatar.js.map +1 -1
- package/lib/module/components/User/components/UserSection.js +37 -17
- package/lib/module/components/User/components/UserSection.js.map +1 -1
- package/lib/module/components/View/View.js +7 -4
- package/lib/module/components/View/View.js.map +1 -1
- package/lib/module/components/index.js +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/hooks/index.js +17 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useDebounce.js +25 -6
- package/lib/module/hooks/useDebounce.js.map +1 -1
- package/lib/module/hooks/useKeyboard.js +7 -4
- package/lib/module/hooks/useKeyboard.js.map +1 -1
- package/lib/module/hooks/useNavigationMode.js +10 -4
- package/lib/module/hooks/useNavigationMode.js.map +1 -1
- package/lib/module/hooks/usePaginatedSection.js +1 -1
- package/lib/module/hooks/usePaginatedSection.js.map +1 -1
- package/lib/module/hooks/usePrevious.js +30 -0
- package/lib/module/hooks/usePrevious.js.map +1 -0
- package/lib/module/hooks/useSafeCallback.js +33 -0
- package/lib/module/hooks/useSafeCallback.js.map +1 -0
- package/lib/module/hooks/useSkeletonItems.js +33 -0
- package/lib/module/hooks/useSkeletonItems.js.map +1 -0
- package/lib/module/hooks/useSplashCache.js +2 -1
- package/lib/module/hooks/useSplashCache.js.map +1 -1
- package/lib/module/hooks/useThemeColors.js +33 -0
- package/lib/module/hooks/useThemeColors.js.map +1 -0
- package/lib/module/theme/ThemeProvider.js +24 -15
- package/lib/module/theme/ThemeProvider.js.map +1 -1
- package/lib/module/theme/hook/useInternalTheme.js +18 -11
- package/lib/module/theme/hook/useInternalTheme.js.map +1 -1
- package/lib/module/theme/hook/useThemeStatusBar.js +10 -4
- package/lib/module/theme/hook/useThemeStatusBar.js.map +1 -1
- package/lib/module/theme/themes.js +3 -3
- package/lib/typescript/src/Styles/globalStyles.d.ts +0 -5
- package/lib/typescript/src/Styles/globalStyles.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/AuthProvider/AuthProvider.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/ForgotPassword/ForgotPassword.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/Login/LoginWithEmail.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/Login/LoginWithPhone.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/OTP/OTP.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/QrLogin/QrLogin.d.ts +0 -15
- package/lib/typescript/src/components/Auth/QrLogin/QrLogin.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/QrLogin/components/QrViewArea.d.ts +0 -1
- package/lib/typescript/src/components/Auth/QrLogin/components/QrViewArea.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/SignUp/SignUp.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/SplashScreen/SplashScreen.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/SplashScreen/components/SplashImage/SplashImage.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/SplashScreen/components/SplashLottie/SplashLottie.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.d.ts.map +1 -1
- package/lib/typescript/src/components/Auth/index.d.ts.map +1 -1
- package/lib/typescript/src/components/BackgroundLayout/BackgroundLayout.d.ts +1 -1
- package/lib/typescript/src/components/BackgroundLayout/BackgroundLayout.d.ts.map +1 -1
- package/lib/typescript/src/components/BlogView/BlogView.d.ts +2 -1
- package/lib/typescript/src/components/BlogView/BlogView.d.ts.map +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +18 -0
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts +3 -0
- package/lib/typescript/src/components/BottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Button/BackBtn.d.ts +5 -3
- package/lib/typescript/src/components/Button/BackBtn.d.ts.map +1 -1
- package/lib/typescript/src/components/Button/PrimaryBtn.d.ts +2 -1
- package/lib/typescript/src/components/Button/PrimaryBtn.d.ts.map +1 -1
- package/lib/typescript/src/components/Button/SecondaryBtn.d.ts +2 -1
- package/lib/typescript/src/components/Button/SecondaryBtn.d.ts.map +1 -1
- package/lib/typescript/src/components/Button/TextButton.d.ts +2 -2
- package/lib/typescript/src/components/Button/TextButton.d.ts.map +1 -1
- package/lib/typescript/src/components/Button/index.d.ts +4 -2
- package/lib/typescript/src/components/Button/index.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/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/Styles/RotateInOut.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/components/CardPoster.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/components/RentOrBuyIcon.d.ts +2 -2
- package/lib/typescript/src/components/Content/Card/components/RentOrBuyIcon.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Card/components/ThumbnailCard.d.ts +2 -0
- package/lib/typescript/src/components/Content/Card/components/ThumbnailCard.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Content.d.ts +2 -0
- package/lib/typescript/src/components/Content/Content.d.ts.map +1 -1
- package/lib/typescript/src/components/Content/Sections.d.ts +2 -2
- package/lib/typescript/src/components/Content/Sections.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/ContentView.d.ts +6 -1
- package/lib/typescript/src/components/ContentView/ContentView.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/MoreContentList.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/AboutSection.d.ts +2 -1
- package/lib/typescript/src/components/ContentView/components/AboutSection.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/CastCard.d.ts +6 -1
- package/lib/typescript/src/components/ContentView/components/CastCard.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/EpisodeCard.d.ts +2 -1
- package/lib/typescript/src/components/ContentView/components/EpisodeCard.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/GenreTags.d.ts +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 +2 -1
- package/lib/typescript/src/components/ContentView/components/HeroBanner.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/MiniInfo.d.ts +1 -1
- package/lib/typescript/src/components/ContentView/components/MiniInfo.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/PlayButton.d.ts +2 -1
- package/lib/typescript/src/components/ContentView/components/PlayButton.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/Title.d.ts +1 -1
- package/lib/typescript/src/components/ContentView/components/Title.d.ts.map +1 -1
- package/lib/typescript/src/components/ContentView/components/TrailerButton.d.ts +2 -1
- package/lib/typescript/src/components/ContentView/components/TrailerButton.d.ts.map +1 -1
- package/lib/typescript/src/components/Fallbacks/NoContentFallback.d.ts +2 -1
- package/lib/typescript/src/components/Fallbacks/NoContentFallback.d.ts.map +1 -1
- package/lib/typescript/src/components/Fallbacks/NotFoundFallback.d.ts +1 -1
- package/lib/typescript/src/components/Fallbacks/NotFoundFallback.d.ts.map +1 -1
- package/lib/typescript/src/components/Headers/AppHeader.d.ts +2 -2
- package/lib/typescript/src/components/Headers/AppHeader.d.ts.map +1 -1
- package/lib/typescript/src/components/Headers/Three.d.ts +2 -2
- package/lib/typescript/src/components/Headers/Three.d.ts.map +1 -1
- package/lib/typescript/src/components/Headers/Two.d.ts +2 -2
- package/lib/typescript/src/components/Headers/Two.d.ts.map +1 -1
- package/lib/typescript/src/components/Headers/index.d.ts +2 -2
- package/lib/typescript/src/components/Input/Input.d.ts +1 -1
- package/lib/typescript/src/components/Input/InputOne.d.ts +2 -2
- package/lib/typescript/src/components/Input/InputOne.d.ts.map +1 -1
- package/lib/typescript/src/components/Loader/Loader.d.ts.map +1 -1
- package/lib/typescript/src/components/Logo/Logo.d.ts +2 -1
- package/lib/typescript/src/components/Logo/Logo.d.ts.map +1 -1
- package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/BottomControls.d.ts +14 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/BottomControls.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.d.ts +60 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.d.ts +14 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/RightControls.d.ts +14 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/RightControls.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/TopControls.d.ts +12 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/MediaControls/TopControls.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/DetailsModal.d.ts +16 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/DetailsModal.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/SettingModal.d.ts +15 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/SettingModal.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/UnlockModal.d.ts +14 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/UnlockModal.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeries.d.ts +8 -2
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeries.d.ts.map +1 -1
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeriesItem.d.ts +8 -2
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelsSeriesItem.d.ts.map +1 -1
- package/lib/typescript/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.d.ts +13 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/{Model → components}/Episodes.d.ts +3 -2
- package/lib/typescript/src/components/Reels/ReelsSeries/components/Episodes.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/GradientOverlay.d.ts +7 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/GradientOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/Like.d.ts +7 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/Like.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/RotatingLoader.d.ts +12 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/RotatingLoader.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/Synopsis.d.ts +12 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/Synopsis.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.d.ts +11 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.d.ts +10 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/index.d.ts +3 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/components/VideoControls/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/types.d.ts +13 -0
- package/lib/typescript/src/components/Reels/ReelsSeries/types.d.ts.map +1 -1
- package/lib/typescript/src/components/Reels/utils/Controls/gestureUtils.d.ts +10 -0
- package/lib/typescript/src/components/Reels/utils/Controls/gestureUtils.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/utils/Controls/index.d.ts +5 -0
- package/lib/typescript/src/components/Reels/utils/Controls/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/utils/Controls/overlayUtils.d.ts +12 -0
- package/lib/typescript/src/components/Reels/utils/Controls/overlayUtils.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/utils/Controls/videoControlsConstants.d.ts +24 -0
- package/lib/typescript/src/components/Reels/utils/Controls/videoControlsConstants.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/utils/Controls/videoRef.d.ts +3 -0
- package/lib/typescript/src/components/Reels/utils/Controls/videoRef.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/utils/index.d.ts +2 -0
- package/lib/typescript/src/components/Reels/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Reels/utils/timeoutUtils.d.ts +14 -0
- package/lib/typescript/src/components/Reels/utils/timeoutUtils.d.ts.map +1 -0
- package/lib/typescript/src/components/Search/One.d.ts.map +1 -1
- package/lib/typescript/src/components/Search/components/SearchCard.d.ts +2 -5
- package/lib/typescript/src/components/Search/components/SearchCard.d.ts.map +1 -1
- package/lib/typescript/src/components/Search/index.d.ts +1 -1
- package/lib/typescript/src/components/Settings/AppSettings.d.ts +2 -2
- 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/Text/Text.d.ts +2 -2
- package/lib/typescript/src/components/Text/Text.d.ts.map +1 -1
- package/lib/typescript/src/components/User/DeviceSessions/DeviceSessions.d.ts +1 -1
- package/lib/typescript/src/components/User/DeviceSessions/DeviceSessions.d.ts.map +1 -1
- package/lib/typescript/src/components/User/ProfileUpdate/ProfileUpdate.d.ts +1 -1
- package/lib/typescript/src/components/User/ProfileUpdate/ProfileUpdate.d.ts.map +1 -1
- package/lib/typescript/src/components/User/PurchaseHistory/PurchaseHistory.d.ts +1 -1
- package/lib/typescript/src/components/User/PurchaseHistory/PurchaseHistory.d.ts.map +1 -1
- package/lib/typescript/src/components/User/WatchHistory/WatchHistory.d.ts +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 +1 -1
- package/lib/typescript/src/components/User/WatchLater/WatchLater.d.ts.map +1 -1
- package/lib/typescript/src/components/User/components/UserAvatar.d.ts +1 -1
- package/lib/typescript/src/components/User/components/UserAvatar.d.ts.map +1 -1
- package/lib/typescript/src/components/User/components/UserSection.d.ts +1 -1
- package/lib/typescript/src/components/User/components/UserSection.d.ts.map +1 -1
- package/lib/typescript/src/components/View/View.d.ts +2 -0
- package/lib/typescript/src/components/View/View.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +1 -1
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +14 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useDebounce.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useKeyboard.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useNavigationMode.d.ts.map +1 -1
- package/lib/typescript/src/hooks/usePrevious.d.ts +12 -0
- package/lib/typescript/src/hooks/usePrevious.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useSafeCallback.d.ts +15 -0
- package/lib/typescript/src/hooks/useSafeCallback.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useSkeletonItems.d.ts +11 -0
- package/lib/typescript/src/hooks/useSkeletonItems.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useSplashCache.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useThemeColors.d.ts +27 -0
- package/lib/typescript/src/hooks/useThemeColors.d.ts.map +1 -0
- package/lib/typescript/src/theme/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/theme/hook/useInternalTheme.d.ts.map +1 -1
- package/lib/typescript/src/theme/hook/useThemeStatusBar.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/Styles/globalStyles.ts +0 -5
- package/src/components/Auth/AuthProvider/AuthProvider.tsx +288 -212
- package/src/components/Auth/ForgotPassword/ForgotPassword.tsx +11 -4
- package/src/components/Auth/Login/LoginWithEmail.tsx +266 -238
- package/src/components/Auth/Login/LoginWithPhone.tsx +18 -6
- package/src/components/Auth/OTP/OTP.tsx +21 -5
- package/src/components/Auth/QrLogin/QrLogin.tsx +225 -185
- package/src/components/Auth/QrLogin/components/QrViewArea.tsx +282 -166
- package/src/components/Auth/SignUp/SignUp.tsx +312 -293
- package/src/components/Auth/SplashScreen/SplashScreen.tsx +186 -131
- package/src/components/Auth/SplashScreen/components/SplashImage/SplashImage.tsx +32 -15
- package/src/components/Auth/SplashScreen/components/SplashLottie/SplashLottie.tsx +11 -5
- package/src/components/Auth/SplashScreen/components/SplashVideo/SplashVideo.tsx +34 -18
- package/src/components/BackgroundLayout/BackgroundLayout.tsx +43 -37
- package/src/components/BlogView/BlogView.tsx +66 -30
- package/src/components/BottomSheet/BottomSheet.tsx +195 -0
- package/src/components/BottomSheet/index.ts +2 -0
- package/src/components/Button/BackBtn.tsx +87 -24
- package/src/components/Button/PrimaryBtn.tsx +42 -25
- package/src/components/Button/SecondaryBtn.tsx +41 -25
- package/src/components/Button/TextButton.tsx +54 -32
- package/src/components/Content/Card/Category/Category.tsx +94 -56
- package/src/components/Content/Card/Sliders/Styles/One.tsx +63 -47
- package/src/components/Content/Card/Sliders/Styles/Two.tsx +131 -51
- package/src/components/Content/Card/Styles/RotateInOut.tsx +7 -9
- package/src/components/Content/Card/components/CardPoster.tsx +136 -55
- package/src/components/Content/Card/components/RentOrBuyIcon.tsx +58 -38
- package/src/components/Content/Card/components/ThumbnailCard.tsx +122 -47
- package/src/components/Content/Content.tsx +164 -97
- package/src/components/Content/Sections.tsx +99 -43
- package/src/components/ContentView/ContentView.tsx +194 -128
- package/src/components/ContentView/MoreContentList.tsx +215 -151
- package/src/components/ContentView/components/AboutSection.tsx +132 -93
- package/src/components/ContentView/components/CastCard.tsx +148 -138
- package/src/components/ContentView/components/EpisodeCard.tsx +160 -155
- package/src/components/ContentView/components/GenreTags.tsx +68 -53
- package/src/components/ContentView/components/HeroBanner.tsx +326 -284
- package/src/components/ContentView/components/MiniInfo.tsx +181 -159
- package/src/components/ContentView/components/PlayButton.tsx +27 -16
- package/src/components/ContentView/components/Title.tsx +89 -72
- package/src/components/ContentView/components/TrailerButton.tsx +35 -22
- package/src/components/Fallbacks/NoContentFallback.tsx +107 -103
- package/src/components/Fallbacks/NotFoundFallback.tsx +12 -4
- package/src/components/Headers/AppHeader.tsx +42 -26
- package/src/components/Headers/Three.tsx +12 -8
- package/src/components/Headers/Two.tsx +31 -10
- package/src/components/Input/InputOne.tsx +136 -108
- package/src/components/Loader/Loader.tsx +2 -2
- package/src/components/Logo/Logo.tsx +43 -27
- package/src/components/Reels/ReelsSeries/MediaControls/BottomControls.tsx +156 -0
- package/src/components/Reels/ReelsSeries/MediaControls/MediaControlsProvider.tsx +234 -0
- package/src/components/Reels/ReelsSeries/MediaControls/MiddleControls.tsx +196 -0
- package/src/components/Reels/ReelsSeries/MediaControls/RightControls.tsx +92 -0
- package/src/components/Reels/ReelsSeries/MediaControls/TopControls.tsx +163 -0
- package/src/components/Reels/ReelsSeries/Model/DetailsModal.tsx +210 -0
- package/src/components/Reels/ReelsSeries/Model/SettingModal.tsx +143 -0
- package/src/components/Reels/ReelsSeries/Model/UnlockModal.tsx +154 -0
- package/src/components/Reels/ReelsSeries/ReelsSeries.tsx +142 -74
- package/src/components/Reels/ReelsSeries/ReelsSeriesItem.tsx +349 -250
- package/src/components/Reels/ReelsSeries/components/AnimatedThreeLines.tsx +184 -0
- package/src/components/Reels/ReelsSeries/{Model → components}/Episodes.tsx +54 -33
- package/src/components/Reels/ReelsSeries/components/GradientOverlay.tsx +41 -0
- package/src/components/Reels/ReelsSeries/components/Like.tsx +40 -0
- package/src/components/Reels/ReelsSeries/components/RotatingLoader.tsx +79 -0
- package/src/components/Reels/ReelsSeries/components/Synopsis.tsx +332 -0
- package/src/components/Reels/ReelsSeries/components/VideoControls/QualityControl.tsx +190 -0
- package/src/components/Reels/ReelsSeries/components/VideoControls/SpeedControl.tsx +80 -0
- package/src/components/Reels/ReelsSeries/components/VideoControls/index.ts +2 -0
- package/src/components/Reels/ReelsSeries/types.ts +13 -2
- package/src/components/Reels/utils/Controls/gestureUtils.ts +42 -0
- package/src/components/Reels/utils/Controls/index.ts +4 -0
- package/src/components/Reels/utils/Controls/overlayUtils.ts +35 -0
- package/src/components/Reels/utils/Controls/videoControlsConstants.ts +25 -0
- package/src/components/Reels/utils/Controls/videoRef.ts +4 -0
- package/src/components/Reels/utils/index.ts +1 -0
- package/src/components/Reels/utils/timeoutUtils.ts +29 -0
- package/src/components/Search/One.tsx +2 -4
- package/src/components/Search/components/SearchCard.tsx +19 -13
- package/src/components/Settings/AppSettings.tsx +217 -128
- package/src/components/Subscription/SubOne.tsx +394 -317
- package/src/components/Text/Text.tsx +33 -22
- package/src/components/User/DeviceSessions/DeviceSessions.tsx +129 -102
- package/src/components/User/ProfileUpdate/ProfileUpdate.tsx +36 -17
- package/src/components/User/PurchaseHistory/PurchaseHistory.tsx +194 -140
- package/src/components/User/WatchHistory/WatchHistory.tsx +63 -36
- package/src/components/User/WatchLater/WatchLater.tsx +119 -81
- package/src/components/User/components/UserAvatar.tsx +49 -15
- package/src/components/User/components/UserSection.tsx +71 -37
- package/src/components/View/View.tsx +10 -2
- package/src/components/index.ts +1 -1
- package/src/hooks/index.ts +14 -0
- package/src/hooks/useDebounce.ts +25 -6
- package/src/hooks/useKeyboard.ts +12 -5
- package/src/hooks/useNavigationMode.ts +16 -5
- package/src/hooks/usePaginatedSection.ts +1 -1
- package/src/hooks/usePrevious.ts +28 -0
- package/src/hooks/useSafeCallback.ts +43 -0
- package/src/hooks/useSkeletonItems.ts +30 -0
- package/src/hooks/useSplashCache.ts +2 -1
- package/src/hooks/useThemeColors.ts +51 -0
- package/src/theme/ThemeProvider.tsx +33 -11
- package/src/theme/hook/useInternalTheme.ts +19 -13
- package/src/theme/hook/useThemeStatusBar.ts +14 -5
- package/src/theme/themes.ts +3 -3
- package/lib/module/components/Reels/ReelsSeries/Model/Episodes.js.map +0 -1
- package/lib/module/components/Reels/ReelsSeries/Model/Synopsis.js +0 -212
- package/lib/module/components/Reels/ReelsSeries/Model/Synopsis.js.map +0 -1
- package/lib/module/components/Reels/ReelsSeries/ReelSeriesDetailsModal.js +0 -182
- package/lib/module/components/Reels/ReelsSeries/ReelSeriesDetailsModal.js.map +0 -1
- package/lib/module/components/Reels/ReelsSeries/ReelSeriesOverlay.js +0 -203
- package/lib/module/components/Reels/ReelsSeries/ReelSeriesOverlay.js.map +0 -1
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/Episodes.d.ts.map +0 -1
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/Synopsis.d.ts +0 -9
- package/lib/typescript/src/components/Reels/ReelsSeries/Model/Synopsis.d.ts.map +0 -1
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.d.ts +0 -13
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.d.ts.map +0 -1
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesOverlay.d.ts +0 -18
- package/lib/typescript/src/components/Reels/ReelsSeries/ReelSeriesOverlay.d.ts.map +0 -1
- package/src/components/Reels/ReelsSeries/Model/Synopsis.tsx +0 -242
- package/src/components/Reels/ReelsSeries/ReelSeriesDetailsModal.tsx +0 -209
- package/src/components/Reels/ReelsSeries/ReelSeriesOverlay.tsx +0 -185
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
4
|
import { View, StyleSheet } from 'react-native';
|
|
5
5
|
import Svg, { Path } from 'react-native-svg';
|
|
6
6
|
import { scale } from 'react-native-size-matters';
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
const PremiumIcon = ({
|
|
8
|
+
const PremiumIcon = /*#__PURE__*/React.memo(({
|
|
9
9
|
fillColor
|
|
10
10
|
}) => /*#__PURE__*/_jsxs(Svg, {
|
|
11
11
|
viewBox: "0 0 1024 1024",
|
|
@@ -20,8 +20,8 @@ const PremiumIcon = ({
|
|
|
20
20
|
d: "M0 0l64 1 15 4 13 8 9 8 9 13 5 13 2 15-2 16-5 12-6 10-9 10-11 7-12 5-10 2h-672l-15-4-12-7-10-9-9-13-5-13-2-11v-9l3-15 8-16 11-12 10-7 11-5 10-2z",
|
|
21
21
|
fill: fillColor
|
|
22
22
|
})]
|
|
23
|
-
});
|
|
24
|
-
const BuyOrRentIcon = ({
|
|
23
|
+
}));
|
|
24
|
+
const BuyOrRentIcon = /*#__PURE__*/React.memo(({
|
|
25
25
|
fillColor
|
|
26
26
|
}) => /*#__PURE__*/_jsx(Svg, {
|
|
27
27
|
fill: "none",
|
|
@@ -34,7 +34,7 @@ const BuyOrRentIcon = ({
|
|
|
34
34
|
clipRule: "evenodd",
|
|
35
35
|
d: "M9.834 9.835H11.2c0-.108-.002-.215-.003-.319-.014-1.424-.024-2.412 2.734-2.412 2.504 0 2.732.453 2.732 2.73l1.365.001c0-3.871-.91-4.099-4.097-4.099h-.21c-3.225-.002-3.709-.002-3.887 4.1zm-.153-.001H7.712a1.976 1.976 0 00-1.976 1.976v6.064a4.252 4.252 0 004.252 4.252h7.886a4.252 4.252 0 004.252-4.252V11.81a1.976 1.976 0 00-1.976-1.976H18.18a.153.153 0 00-.153.153v3.716a.683.683 0 01-1.365 0V9.987a.153.153 0 00-.153-.153h-5.158a.153.153 0 00-.152.153v3.716a.683.683 0 01-1.366 0V9.987a.153.153 0 00-.153-.153z"
|
|
36
36
|
})
|
|
37
|
-
});
|
|
37
|
+
}));
|
|
38
38
|
const RentOrBuyIcon = ({
|
|
39
39
|
theme,
|
|
40
40
|
content_offering_type,
|
|
@@ -42,11 +42,10 @@ const RentOrBuyIcon = ({
|
|
|
42
42
|
position = 'topLeft',
|
|
43
43
|
size = 22
|
|
44
44
|
}) => {
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
const positionStyle = (() => {
|
|
45
|
+
const typeUpper = useMemo(() => content_offering_type?.toUpperCase(), [content_offering_type]);
|
|
46
|
+
const isValidType = useMemo(() => typeUpper && ['PREMIUM', 'BUY_OR_RENT'].includes(typeUpper), [typeUpper]);
|
|
47
|
+
const fillColor = useMemo(() => theme?.colors.premiumIcon || '#CA091E', [theme?.colors.premiumIcon]);
|
|
48
|
+
const positionStyle = useMemo(() => {
|
|
50
49
|
switch (position) {
|
|
51
50
|
case 'topLeft':
|
|
52
51
|
return {
|
|
@@ -74,13 +73,15 @@ const RentOrBuyIcon = ({
|
|
|
74
73
|
left: 6
|
|
75
74
|
};
|
|
76
75
|
}
|
|
77
|
-
})
|
|
78
|
-
const IconComponent = typeUpper === 'PREMIUM' ? PremiumIcon : BuyOrRentIcon;
|
|
76
|
+
}, [position]);
|
|
77
|
+
const IconComponent = useMemo(() => typeUpper === 'PREMIUM' ? PremiumIcon : BuyOrRentIcon, [typeUpper]);
|
|
78
|
+
const containerStyle = useMemo(() => [styles.container, {
|
|
79
|
+
width: size,
|
|
80
|
+
height: size
|
|
81
|
+
}, style || positionStyle], [size, style, positionStyle]);
|
|
82
|
+
if (!content_offering_type || !isValidType) return null;
|
|
79
83
|
return /*#__PURE__*/_jsx(View, {
|
|
80
|
-
style:
|
|
81
|
-
width: size,
|
|
82
|
-
height: size
|
|
83
|
-
}, style || positionStyle],
|
|
84
|
+
style: containerStyle,
|
|
84
85
|
children: /*#__PURE__*/_jsx(View, {
|
|
85
86
|
style: styles.iconWrapper,
|
|
86
87
|
children: /*#__PURE__*/_jsx(IconComponent, {
|
|
@@ -89,7 +90,7 @@ const RentOrBuyIcon = ({
|
|
|
89
90
|
})
|
|
90
91
|
});
|
|
91
92
|
};
|
|
92
|
-
export default RentOrBuyIcon;
|
|
93
|
+
export default /*#__PURE__*/React.memo(RentOrBuyIcon);
|
|
93
94
|
const styles = StyleSheet.create({
|
|
94
95
|
container: {
|
|
95
96
|
position: 'absolute',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","StyleSheet","Svg","Path","scale","jsx","_jsx","jsxs","_jsxs","PremiumIcon","fillColor","viewBox","width","height","children","transform","d","fill","BuyOrRentIcon","fillRule","clipRule","RentOrBuyIcon","theme","content_offering_type","style","position","size","typeUpper","toUpperCase","includes","colors","premiumIcon","positionStyle","top","left","right","bottom","IconComponent","styles","container","iconWrapper","create","zIndex","flex","justifyContent","alignItems","backgroundColor","padding","borderRadius","shadowColor","shadowOffset","shadowOpacity","shadowRadius","overflow","elevation"],"sourceRoot":"../../../../../../src","sources":["components/Content/Card/components/RentOrBuyIcon.tsx"],"mappings":";;AAAA,OAAOA,KAAK,
|
|
1
|
+
{"version":3,"names":["React","useMemo","View","StyleSheet","Svg","Path","scale","jsx","_jsx","jsxs","_jsxs","PremiumIcon","memo","fillColor","viewBox","width","height","children","transform","d","fill","BuyOrRentIcon","fillRule","clipRule","RentOrBuyIcon","theme","content_offering_type","style","position","size","typeUpper","toUpperCase","isValidType","includes","colors","premiumIcon","positionStyle","top","left","right","bottom","IconComponent","containerStyle","styles","container","iconWrapper","create","zIndex","flex","justifyContent","alignItems","backgroundColor","padding","borderRadius","shadowColor","shadowOffset","shadowOpacity","shadowRadius","overflow","elevation"],"sourceRoot":"../../../../../../src","sources":["components/Content/Card/components/RentOrBuyIcon.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,IAAI,EAAEC,UAAU,QAAwC,cAAc;AAC/E,OAAOC,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAC5C,SAASC,KAAK,QAAQ,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAYlD,MAAMC,WAA4C,gBAAGX,KAAK,CAACY,IAAI,CAC7D,CAAC;EAAEC;AAAU,CAAC,kBACZH,KAAA,CAACN,GAAG;EAACU,OAAO,EAAC,eAAe;EAACC,KAAK,EAAC,MAAM;EAACC,MAAM,EAAC,MAAM;EAAAC,QAAA,gBACrDT,IAAA,CAACH,IAAI;IACHa,SAAS,EAAC,mBAAmB;IAC7BC,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B,QAAQ,EAAE,UAAU;IACpBmB,MAAM,EAAE;EACV,CAAC;EACDF,WAAW,EAAE;IACXG,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,eAAe,EAAE,OAAO;IACxBC,OAAO,EAAE9C,KAAK,CAAC,CAAC,CAAC;IACjB+C,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAExC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCwC,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,CAAC;IACfC,QAAQ,EAAE,QAAQ;IAClBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @lastModified Wed 25 Jun 2025 at 05:40 PM
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React, { useState } from 'react';
|
|
8
|
+
import React, { useState, useEffect, useMemo, useCallback } from 'react';
|
|
9
9
|
import { View, StyleSheet } from 'react-native';
|
|
10
10
|
import FastImage from 'react-native-fast-image';
|
|
11
11
|
import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
|
|
@@ -13,7 +13,10 @@ import { scale } from 'react-native-size-matters';
|
|
|
13
13
|
import { Text } from "../../../Text/index.js";
|
|
14
14
|
import { ImageOff } from 'lucide-react-native';
|
|
15
15
|
import { RFValue } from 'react-native-responsive-fontsize';
|
|
16
|
+
|
|
17
|
+
// Module-level cache to track successfully loaded images
|
|
16
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
const loadedImageCache = new Set();
|
|
17
20
|
export const ThumbnailCard = ({
|
|
18
21
|
thumbnailUri = '',
|
|
19
22
|
theme,
|
|
@@ -25,26 +28,82 @@ export const ThumbnailCard = ({
|
|
|
25
28
|
}) => {
|
|
26
29
|
const [imageLoading, setImageLoading] = useState(true);
|
|
27
30
|
const [imageError, setImageError] = useState(false);
|
|
28
|
-
const hasValidThumbnail = !!thumbnailUri && thumbnailUri.startsWith('http');
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
const hasValidThumbnail = useMemo(() => !!thumbnailUri && thumbnailUri.startsWith('http'), [thumbnailUri]);
|
|
32
|
+
|
|
33
|
+
// Reset image loading state when isLoading prop changes
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (isLoading) {
|
|
36
|
+
setImageLoading(true);
|
|
37
|
+
setImageError(false);
|
|
38
|
+
}
|
|
39
|
+
}, [isLoading]);
|
|
40
|
+
|
|
41
|
+
// Reset when thumbnailUri changes
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (hasValidThumbnail) {
|
|
44
|
+
// Check if this image was already loaded successfully before
|
|
45
|
+
const isAlreadyLoaded = loadedImageCache.has(thumbnailUri);
|
|
46
|
+
if (isAlreadyLoaded) {
|
|
47
|
+
// Image was loaded before, skip loading state
|
|
48
|
+
setImageLoading(false);
|
|
49
|
+
setImageError(false);
|
|
50
|
+
} else {
|
|
51
|
+
// Image not loaded before, show loading
|
|
52
|
+
setImageLoading(true);
|
|
53
|
+
setImageError(false);
|
|
54
|
+
FastImage.preload([{
|
|
55
|
+
uri: thumbnailUri
|
|
56
|
+
}]);
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
setImageLoading(false);
|
|
60
|
+
setImageError(true);
|
|
61
|
+
}
|
|
62
|
+
}, [thumbnailUri, hasValidThumbnail]);
|
|
63
|
+
const showSkeleton = useMemo(() => isLoading || imageLoading && !imageError && hasValidThumbnail, [isLoading, imageLoading, imageError, hasValidThumbnail]);
|
|
64
|
+
const fallbackImageStyle = useMemo(() => ({
|
|
31
65
|
width: '100%',
|
|
32
66
|
aspectRatio: 16 / 9,
|
|
33
67
|
borderRadius,
|
|
34
68
|
position: 'absolute',
|
|
35
69
|
top: 0,
|
|
36
70
|
left: 0
|
|
37
|
-
};
|
|
71
|
+
}), [borderRadius]);
|
|
72
|
+
const wrapperStyleMemo = useMemo(() => [styles.thumbnailWrapper, {
|
|
73
|
+
borderRadius,
|
|
74
|
+
backgroundColor: theme.colors.background,
|
|
75
|
+
shadowColor: theme.colors.shadow
|
|
76
|
+
}, wrapperStyle], [borderRadius, theme.colors.background, theme.colors.shadow, wrapperStyle]);
|
|
77
|
+
const skeletonWrapperStyle = useMemo(() => [styles.skeletonWrapper, {
|
|
78
|
+
borderRadius
|
|
79
|
+
}], [borderRadius]);
|
|
80
|
+
const imageStyleMemo = useMemo(() => [fallbackImageStyle, showSkeleton ? styles.hidden : styles.visible, imageStyle], [fallbackImageStyle, showSkeleton, imageStyle]);
|
|
81
|
+
const fallbackStyle = useMemo(() => [styles.fallback, {
|
|
82
|
+
borderRadius,
|
|
83
|
+
backgroundColor: theme.colors.errorContainer,
|
|
84
|
+
borderColor: theme.colors.error
|
|
85
|
+
}], [borderRadius, theme.colors.errorContainer, theme.colors.error]);
|
|
86
|
+
const handleLoadStart = useCallback(() => {
|
|
87
|
+
// Only set loading if image is not already in cache
|
|
88
|
+
if (!loadedImageCache.has(thumbnailUri)) {
|
|
89
|
+
setImageLoading(true);
|
|
90
|
+
setImageError(false);
|
|
91
|
+
}
|
|
92
|
+
}, [thumbnailUri]);
|
|
93
|
+
const handleLoadEnd = useCallback(() => {
|
|
94
|
+
setImageLoading(false);
|
|
95
|
+
setImageError(false);
|
|
96
|
+
// Add to cache when successfully loaded
|
|
97
|
+
loadedImageCache.add(thumbnailUri);
|
|
98
|
+
}, [thumbnailUri]);
|
|
99
|
+
const handleError = useCallback(() => {
|
|
100
|
+
setImageLoading(false);
|
|
101
|
+
setImageError(true);
|
|
102
|
+
}, []);
|
|
38
103
|
return /*#__PURE__*/_jsxs(View, {
|
|
39
|
-
style:
|
|
40
|
-
borderRadius,
|
|
41
|
-
backgroundColor: theme.colors.background,
|
|
42
|
-
shadowColor: theme.colors.shadow
|
|
43
|
-
}, wrapperStyle],
|
|
104
|
+
style: wrapperStyleMemo,
|
|
44
105
|
children: [showSkeleton && /*#__PURE__*/_jsx(View, {
|
|
45
|
-
style:
|
|
46
|
-
borderRadius
|
|
47
|
-
}],
|
|
106
|
+
style: skeletonWrapperStyle,
|
|
48
107
|
children: /*#__PURE__*/_jsx(SkeletonPlaceholder, {
|
|
49
108
|
backgroundColor: theme.colors.skeletonBaseColor,
|
|
50
109
|
highlightColor: theme.colors.skeletonHighlightColor,
|
|
@@ -58,23 +117,13 @@ export const ThumbnailCard = ({
|
|
|
58
117
|
source: {
|
|
59
118
|
uri: thumbnailUri
|
|
60
119
|
},
|
|
61
|
-
style:
|
|
120
|
+
style: imageStyleMemo,
|
|
62
121
|
resizeMode: resizeMode,
|
|
63
|
-
onLoadStart:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
onLoadEnd: () => setImageLoading(false),
|
|
68
|
-
onError: () => {
|
|
69
|
-
setImageLoading(false);
|
|
70
|
-
setImageError(true);
|
|
71
|
-
}
|
|
122
|
+
onLoadStart: handleLoadStart,
|
|
123
|
+
onLoadEnd: handleLoadEnd,
|
|
124
|
+
onError: handleError
|
|
72
125
|
}), !showSkeleton && (!hasValidThumbnail || imageError) && /*#__PURE__*/_jsxs(View, {
|
|
73
|
-
style:
|
|
74
|
-
borderRadius,
|
|
75
|
-
backgroundColor: theme.colors.errorContainer,
|
|
76
|
-
borderColor: theme.colors.error
|
|
77
|
-
}],
|
|
126
|
+
style: fallbackStyle,
|
|
78
127
|
children: [/*#__PURE__*/_jsx(ImageOff, {
|
|
79
128
|
size: scale(18),
|
|
80
129
|
color: theme.colors.error
|
|
@@ -86,6 +135,7 @@ export const ThumbnailCard = ({
|
|
|
86
135
|
})]
|
|
87
136
|
});
|
|
88
137
|
};
|
|
138
|
+
export default /*#__PURE__*/React.memo(ThumbnailCard);
|
|
89
139
|
const styles = StyleSheet.create({
|
|
90
140
|
thumbnailWrapper: {
|
|
91
141
|
width: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","View","StyleSheet","FastImage","SkeletonPlaceholder","scale","Text","ImageOff","RFValue","jsx","_jsx","jsxs","_jsxs","ThumbnailCard","thumbnailUri","theme","isLoading","borderRadius","wrapperStyle","imageStyle","resizeMode","cover","imageLoading","setImageLoading","imageError","setImageError","hasValidThumbnail","startsWith","showSkeleton","fallbackImageStyle","width","aspectRatio","position","top","left","
|
|
1
|
+
{"version":3,"names":["React","useState","useEffect","useMemo","useCallback","View","StyleSheet","FastImage","SkeletonPlaceholder","scale","Text","ImageOff","RFValue","jsx","_jsx","jsxs","_jsxs","loadedImageCache","Set","ThumbnailCard","thumbnailUri","theme","isLoading","borderRadius","wrapperStyle","imageStyle","resizeMode","cover","imageLoading","setImageLoading","imageError","setImageError","hasValidThumbnail","startsWith","isAlreadyLoaded","has","preload","uri","showSkeleton","fallbackImageStyle","width","aspectRatio","position","top","left","wrapperStyleMemo","styles","thumbnailWrapper","backgroundColor","colors","background","shadowColor","shadow","skeletonWrapperStyle","skeletonWrapper","imageStyleMemo","hidden","visible","fallbackStyle","fallback","errorContainer","borderColor","error","handleLoadStart","handleLoadEnd","add","handleError","style","children","skeletonBaseColor","highlightColor","skeletonHighlightColor","Item","skeleton","source","onLoadStart","onLoadEnd","onError","size","color","fallbackText","memo","create","overflow","opacity","alignItems","justifyContent","marginTop","fontSize"],"sourceRoot":"../../../../../../src","sources":["components/Content/Card/components/ThumbnailCard.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AACxE,SAASC,IAAI,EAAEC,UAAU,QAAwC,cAAc;AAK/E,OAAOC,SAAS,MAAM,yBAAyB;AAC/C,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,SAASC,KAAK,QAAQ,2BAA2B;AACjD,SAASC,IAAI,QAAQ,wBAAe;AACpC,SAASC,QAAQ,QAAQ,qBAAqB;AAE9C,S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ACPJ,KAAK,EAAE,MAAM;IACbC,WAAW,EAAE,EAAE,GAAG,CAAC;IACnB0C,QAAQ,EAAE;EACZ,CAAC;EACDV,QAAQ,EAAE;IACRjC,KAAK,EAAE,MAAM;IACbC,WAAW,EAAE,EAAE,GAAG;EACpB,CAAC;EACDgB,OAAO,EAAE;IACP2B,OAAO,EAAE;EACX,CAAC;EACD5B,MAAM,EAAE;IACN4B,OAAO,EAAE;EACX,CAAC;EACDzB,QAAQ,EAAE;IACRjB,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPJ,KAAK,EAAE,MAAM;IACbC,WAAW,EAAE,EAAE,GAAG,CAAC;IACnB4C,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDN,YAAY,EAAE;IACZO,SAAS,EAAE9E,KAAK,CAAC,CAAC,CAAC;IACnB+E,QAAQ,EAAE5E,OAAO,CAAC,CAAC;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @author Naresh Dhamu
|
|
5
5
|
* @lastModified Sun 08 Jun 2025 at 03:50 PM
|
|
6
6
|
*/
|
|
7
|
-
import React, { useMemo } from 'react';
|
|
7
|
+
import React, { useMemo, useCallback } from 'react';
|
|
8
8
|
import { ActivityIndicator, FlatList } from 'react-native';
|
|
9
9
|
import { scale, verticalScale } from 'react-native-size-matters';
|
|
10
10
|
import Animated from 'react-native-reanimated';
|
|
@@ -16,7 +16,7 @@ import { useInternalTheme } from "../../theme/hook/index.js";
|
|
|
16
16
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
17
17
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
18
|
const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);
|
|
19
|
-
const ContentFooter = ({
|
|
19
|
+
const ContentFooter = /*#__PURE__*/React.memo(({
|
|
20
20
|
isEmpty,
|
|
21
21
|
ErrorComponent,
|
|
22
22
|
InfiniteScrollIsLoading,
|
|
@@ -27,14 +27,15 @@ const ContentFooter = ({
|
|
|
27
27
|
const {
|
|
28
28
|
theme: appliedTheme
|
|
29
29
|
} = useInternalTheme(theme);
|
|
30
|
+
const loaderStyle = useMemo(() => ({
|
|
31
|
+
paddingVertical: scale(30),
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
backgroundColor: 'transparent'
|
|
35
|
+
}), []);
|
|
30
36
|
if (InfiniteScrollIsLoading) {
|
|
31
37
|
return InfiniteScrollLoaderComponent ?? /*#__PURE__*/_jsx(Animated.View, {
|
|
32
|
-
style:
|
|
33
|
-
paddingVertical: scale(30),
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
justifyContent: 'center',
|
|
36
|
-
backgroundColor: 'transparent'
|
|
37
|
-
},
|
|
38
|
+
style: loaderStyle,
|
|
38
39
|
children: /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
39
40
|
size: "large",
|
|
40
41
|
color: appliedTheme.colors.primary
|
|
@@ -51,7 +52,7 @@ const ContentFooter = ({
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
return null;
|
|
54
|
-
};
|
|
55
|
+
});
|
|
55
56
|
export const Content = ({
|
|
56
57
|
customComponents,
|
|
57
58
|
InfiniteScrollLoaderComponent,
|
|
@@ -71,6 +72,19 @@ export const Content = ({
|
|
|
71
72
|
}) => {
|
|
72
73
|
const insets = useSafeAreaInsets();
|
|
73
74
|
const sectionData = useMemo(() => contentData?.sectionData ?? [], [contentData?.sectionData]);
|
|
75
|
+
|
|
76
|
+
// Memoize section data object to prevent unnecessary re-renders
|
|
77
|
+
const sectionDataMemo = useMemo(() => ({
|
|
78
|
+
historyData: contentData.historyData,
|
|
79
|
+
category: contentData.category
|
|
80
|
+
}), [contentData.historyData, contentData.category]);
|
|
81
|
+
|
|
82
|
+
// Memoize loading state object
|
|
83
|
+
const loadingStateMemo = useMemo(() => ({
|
|
84
|
+
section: isLoading?.section ?? false,
|
|
85
|
+
history: isLoading?.history ?? false,
|
|
86
|
+
category: isLoading?.category ?? false
|
|
87
|
+
}), [isLoading?.section, isLoading?.history, isLoading?.category]);
|
|
74
88
|
const headerComponent = useMemo(() => {
|
|
75
89
|
if (!contentData?.category || contentData.category.length === 0) return null;
|
|
76
90
|
return /*#__PURE__*/_jsx(CategoryCard, {
|
|
@@ -82,7 +96,7 @@ export const Content = ({
|
|
|
82
96
|
theme: theme
|
|
83
97
|
}, 'category');
|
|
84
98
|
}, [contentData?.category, events?.onPressCategory, events?.activeCategory, isLoading?.category, theme]);
|
|
85
|
-
const renderItem = ({
|
|
99
|
+
const renderItem = useCallback(({
|
|
86
100
|
item,
|
|
87
101
|
index
|
|
88
102
|
}) => {
|
|
@@ -97,8 +111,7 @@ export const Content = ({
|
|
|
97
111
|
type: item?.type || 'normal',
|
|
98
112
|
data: {
|
|
99
113
|
sectionData: item.content || null,
|
|
100
|
-
|
|
101
|
-
category: contentData.category
|
|
114
|
+
...sectionDataMemo
|
|
102
115
|
},
|
|
103
116
|
name: item?.name || `Section ${index}`,
|
|
104
117
|
theme: theme,
|
|
@@ -106,39 +119,45 @@ export const Content = ({
|
|
|
106
119
|
section_id: item?._id || index.toString(),
|
|
107
120
|
events: events,
|
|
108
121
|
isLoading: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
category: isLoading?.category
|
|
122
|
+
...loadingStateMemo,
|
|
123
|
+
section: isLoadingItem
|
|
112
124
|
},
|
|
113
125
|
sectionProps: sectionProps,
|
|
114
126
|
moreFetchDataHistory: moreFetchDataHistory,
|
|
115
127
|
moreFetchData: moreFetchData
|
|
116
128
|
}, index);
|
|
117
|
-
};
|
|
118
|
-
const isEmpty = !isLoading?.section && (!sectionData || sectionData.length === 0);
|
|
129
|
+
}, [isLoading, LoaderComponent, sectionDataMemo, loadingStateMemo, theme, customComponents, events, sectionProps, moreFetchDataHistory, moreFetchData]);
|
|
130
|
+
const isEmpty = useMemo(() => !isLoading?.section && (!sectionData || sectionData.length === 0), [isLoading?.section, sectionData]);
|
|
131
|
+
const keyExtractor = useCallback((_item, index) => index.toString(), []);
|
|
132
|
+
const handleEndReached = useCallback(() => {
|
|
133
|
+
onEndReached?.();
|
|
134
|
+
}, [onEndReached]);
|
|
135
|
+
const contentContainerStyleMemo = useMemo(() => [{
|
|
136
|
+
paddingBottom: verticalScale(100) + insets.bottom
|
|
137
|
+
}, contentContainerStyle], [insets.bottom, contentContainerStyle]);
|
|
138
|
+
const listData = useMemo(() => isLoading?.section ? dummySections : sectionData, [isLoading?.section, sectionData]);
|
|
119
139
|
return /*#__PURE__*/_jsx(AnimatedFlatList, {
|
|
120
140
|
initialNumToRender: 5,
|
|
121
141
|
showsVerticalScrollIndicator: false,
|
|
122
142
|
removeClippedSubviews: true,
|
|
123
143
|
onScroll: onScroll,
|
|
124
144
|
scrollEventThrottle: 16,
|
|
125
|
-
data:
|
|
145
|
+
data: listData,
|
|
126
146
|
renderItem: renderItem,
|
|
127
|
-
keyExtractor:
|
|
128
|
-
onEndReached:
|
|
147
|
+
keyExtractor: keyExtractor,
|
|
148
|
+
onEndReached: handleEndReached,
|
|
129
149
|
ListHeaderComponent: headerComponent,
|
|
130
|
-
ListFooterComponent: /*#__PURE__*/_jsx(ContentFooter, {
|
|
150
|
+
ListFooterComponent: useMemo(() => /*#__PURE__*/_jsx(ContentFooter, {
|
|
131
151
|
InfiniteScrollLoaderComponent: InfiniteScrollLoaderComponent,
|
|
132
152
|
InfiniteScrollIsLoading: isLoading?.InfiniteScrollIsLoading,
|
|
133
153
|
isEmpty: isEmpty,
|
|
134
154
|
ErrorComponent: ErrorComponent,
|
|
135
155
|
theme: theme,
|
|
136
156
|
noContentFallbackProps: noContentFallbackProps
|
|
137
|
-
}),
|
|
157
|
+
}), [InfiniteScrollLoaderComponent, isLoading?.InfiniteScrollIsLoading, isEmpty, ErrorComponent, theme, noContentFallbackProps]),
|
|
138
158
|
onEndReachedThreshold: 0.7,
|
|
139
|
-
contentContainerStyle:
|
|
140
|
-
paddingBottom: verticalScale(100) + insets.bottom
|
|
141
|
-
}, contentContainerStyle]
|
|
159
|
+
contentContainerStyle: contentContainerStyleMemo
|
|
142
160
|
});
|
|
143
161
|
};
|
|
162
|
+
export default /*#__PURE__*/React.memo(Content);
|
|
144
163
|
//# sourceMappingURL=Content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","ActivityIndicator","FlatList","scale","verticalScale","Animated","SectionType","dummySections","CategoryCard","NoContentFallback","useInternalTheme","useSafeAreaInsets","jsx","_jsx","Fragment","_Fragment","AnimatedFlatList","createAnimatedComponent","ContentFooter","isEmpty","ErrorComponent","InfiniteScrollIsLoading","InfiniteScrollLoaderComponent","theme","noContentFallbackProps","appliedTheme","
|
|
1
|
+
{"version":3,"names":["React","useMemo","useCallback","ActivityIndicator","FlatList","scale","verticalScale","Animated","SectionType","dummySections","CategoryCard","NoContentFallback","useInternalTheme","useSafeAreaInsets","jsx","_jsx","Fragment","_Fragment","AnimatedFlatList","createAnimatedComponent","ContentFooter","memo","isEmpty","ErrorComponent","InfiniteScrollIsLoading","InfiniteScrollLoaderComponent","theme","noContentFallbackProps","appliedTheme","loaderStyle","paddingVertical","alignItems","justifyContent","backgroundColor","View","style","children","size","color","colors","primary","isLoading","Content","customComponents","LoaderComponent","onScroll","contentContainerStyle","contentData","onEndReached","events","sectionProps","moreFetchData","moreFetchDataHistory","insets","sectionData","sectionDataMemo","historyData","category","loadingStateMemo","section","history","headerComponent","length","onPressCategory","activeCategory","mode","renderItem","item","index","isDummy","_id","startsWith","isLoadingItem","type","data","content","name","section_id","toString","keyExtractor","_item","handleEndReached","contentContainerStyleMemo","paddingBottom","bottom","listData","initialNumToRender","showsVerticalScrollIndicator","removeClippedSubviews","scrollEventThrottle","ListHeaderComponent","ListFooterComponent","onEndReachedThreshold"],"sourceRoot":"../../../../src","sources":["components/Content/Content.tsx"],"mappings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GAAGpF,OAAO,CACtB,MAAOwC,SAAS,EAAEkB,OAAO,GAAGlD,aAAa,GAAG6C,WAAY,EACxD,CAACb,SAAS,EAAEkB,OAAO,EAAEL,WAAW,CAClC,CAAC;EAED,oBACEvC,IAAA,CAACG,gBAAgB;IACfoE,kBAAkB,EAAE,CAAE;IACtBC,4BAA4B,EAAE,KAAM;IACpCC,qBAAqB;IACrB3C,QAAQ,EAAEA,QAAgB;IAC1B4C,mBAAmB,EAAE,EAAG;IACxBf,IAAI,EAAEW,QAAS;IACfnB,UAAU,EAAEA,UAAkB;IAC9Ba,YAAY,EAAEA,YAAa;IAC3B/B,YAAY,EAAEiC,gBAAiB;IAC/BS,mBAAmB,EAAE7B,eAAgB;IACrC8B,mBAAmB,EAAE1F,OAAO,CAC1B,mBACEc,IAAA,CAACK,aAAa;MACZK,6BAA6B,EAAEA,6BAA8B;MAC7DD,uBAAuB,EAAEiB,SAAS,EAAEjB,uBAAwB;MAC5DF,OAAO,EAAEA,OAAQ;MACjBC,cAAc,EAAEA,cAAe;MAC/BG,KAAK,EAAEA,KAAM;MACbC,sBAAsB,EAAEA;IAAuB,CAChD,CACF,EACD,CACEF,6BAA6B,EAC7BgB,SAAS,EAAEjB,uBAAuB,EAClCF,OAAO,EACPC,cAAc,EACdG,KAAK,EACLC,sBAAsB,CAE1B,CAAE;IACFiE,qBAAqB,EAAE,GAAI;IAC3B9C,qBAAqB,EAAEoC;EAA0B,CAClD,CAAC;AAEN,CAAC;AAED,4BAAelF,KAAK,CAACqB,IAAI,CAACqB,OAAO,CAAC","ignoreList":[]}
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
* @author Naresh Dhamu
|
|
5
5
|
* @lastModified Sun 08 Jun 2025 at 03:50 PM
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { useMemo } from 'react';
|
|
8
8
|
import Sliders from "./Card/Sliders/index.js";
|
|
9
9
|
import Cards from "./Card/index.js";
|
|
10
10
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// Memoized common props creator to prevent object recreation
|
|
12
|
+
const createCommonProps = (type, props) => {
|
|
12
13
|
const effectiveIsLoading = props.isLoading?.section || props.section_id === `dummy-${type}`;
|
|
13
|
-
|
|
14
|
+
return {
|
|
14
15
|
theme: props.theme,
|
|
15
16
|
title: props.name,
|
|
16
17
|
section_id: props.section_id,
|
|
@@ -23,6 +24,9 @@ const renderDefaultComponent = (type, props) => {
|
|
|
23
24
|
moreFetchDataHistory: props.moreFetchDataHistory,
|
|
24
25
|
moreFetchData: props.moreFetchData
|
|
25
26
|
};
|
|
27
|
+
};
|
|
28
|
+
const renderDefaultComponent = (type, props) => {
|
|
29
|
+
const commonProps = createCommonProps(type, props);
|
|
26
30
|
switch (type) {
|
|
27
31
|
case 'slider':
|
|
28
32
|
return /*#__PURE__*/_jsx(Sliders.Styles.One, {
|
|
@@ -93,18 +97,12 @@ const Sections = ({
|
|
|
93
97
|
moreFetchData,
|
|
94
98
|
moreFetchDataHistory
|
|
95
99
|
}) => {
|
|
96
|
-
const commonProps = {
|
|
100
|
+
const commonProps = useMemo(() => ({
|
|
97
101
|
data: data.sectionData,
|
|
98
102
|
title: name
|
|
99
|
-
};
|
|
100
|
-
const customComponent = customComponents.find(c => c.type === type);
|
|
101
|
-
|
|
102
|
-
return /*#__PURE__*/React.cloneElement(customComponent.component, {
|
|
103
|
-
...(customComponent.component?.props ?? {}),
|
|
104
|
-
...commonProps
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
const defaultRendered = renderDefaultComponent(type, {
|
|
103
|
+
}), [data.sectionData, name]);
|
|
104
|
+
const customComponent = useMemo(() => customComponents.find(c => c.type === type), [customComponents, type]);
|
|
105
|
+
const defaultRendered = useMemo(() => renderDefaultComponent(type, {
|
|
108
106
|
data,
|
|
109
107
|
name,
|
|
110
108
|
section_id,
|
|
@@ -115,23 +113,33 @@ const Sections = ({
|
|
|
115
113
|
isLoading,
|
|
116
114
|
moreFetchData,
|
|
117
115
|
moreFetchDataHistory
|
|
118
|
-
});
|
|
116
|
+
}), [type, data, name, section_id, index, theme, events, sectionProps, isLoading, moreFetchData, moreFetchDataHistory]);
|
|
117
|
+
|
|
118
|
+
// Memoize props object to avoid recreating in filter
|
|
119
|
+
const filterProps = useMemo(() => ({
|
|
120
|
+
data,
|
|
121
|
+
name,
|
|
122
|
+
section_id,
|
|
123
|
+
index,
|
|
124
|
+
theme,
|
|
125
|
+
events,
|
|
126
|
+
sectionProps,
|
|
127
|
+
isLoading,
|
|
128
|
+
moreFetchData,
|
|
129
|
+
moreFetchDataHistory
|
|
130
|
+
}), [data, name, section_id, index, theme, events, sectionProps, isLoading, moreFetchData, moreFetchDataHistory]);
|
|
131
|
+
const fallbackComponents = useMemo(() => customComponents.filter(({
|
|
132
|
+
type: customType
|
|
133
|
+
}) => renderDefaultComponent(customType, filterProps) === null), [customComponents, filterProps]);
|
|
134
|
+
if (customComponent) {
|
|
135
|
+
return /*#__PURE__*/React.cloneElement(customComponent.component, {
|
|
136
|
+
...(customComponent.component?.props ?? {}),
|
|
137
|
+
...commonProps
|
|
138
|
+
});
|
|
139
|
+
}
|
|
119
140
|
if (defaultRendered) return defaultRendered;
|
|
120
141
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
121
|
-
children:
|
|
122
|
-
type: customType
|
|
123
|
-
}) => renderDefaultComponent(customType, {
|
|
124
|
-
data,
|
|
125
|
-
name,
|
|
126
|
-
section_id,
|
|
127
|
-
index,
|
|
128
|
-
theme,
|
|
129
|
-
events,
|
|
130
|
-
sectionProps,
|
|
131
|
-
isLoading,
|
|
132
|
-
moreFetchData,
|
|
133
|
-
moreFetchDataHistory
|
|
134
|
-
}) === null).map(({
|
|
142
|
+
children: fallbackComponents.map(({
|
|
135
143
|
component,
|
|
136
144
|
type: key
|
|
137
145
|
}) => /*#__PURE__*/React.cloneElement(component, {
|
|
@@ -141,5 +149,5 @@ const Sections = ({
|
|
|
141
149
|
}))
|
|
142
150
|
});
|
|
143
151
|
};
|
|
144
|
-
export default Sections;
|
|
152
|
+
export default /*#__PURE__*/React.memo(Sections);
|
|
145
153
|
//# sourceMappingURL=Sections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Sliders","Cards","jsx","_jsx","Fragment","_Fragment","
|
|
1
|
+
{"version":3,"names":["React","useMemo","Sliders","Cards","jsx","_jsx","Fragment","_Fragment","createCommonProps","type","props","effectiveIsLoading","isLoading","section","section_id","theme","title","name","data","sectionData","index","onPressItem","events","onPressMore","moreFetchDataHistory","moreFetchData","renderDefaultComponent","commonProps","Styles","One","showPlayIcon","sectionProps","showPlayBtn","Two","Three","Four","Five","Six","NowWatching","historyData","isLoadingHistory","history","RotateCarousel","TopTen","Sections","customComponents","customComponent","find","c","defaultRendered","filterProps","fallbackComponents","filter","customType","cloneElement","component","children","map","key","memo"],"sourceRoot":"../../../../src","sources":["components/Content/Sections.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,OAAOC,OAAO,MAAM,yBAAgB;AACpC,OAAOC,KAAK,MAAM,iBAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AA0C3B;AACA,MAAMC,iBAAiB,GAAGA,CACxBC,IAA6B,EAC7BC,KAAgD,KAC7C;EACH,MAAMC,kBAAkB,GACtBD,KAAK,CAACE,SAAS,EAAEC,OAAO,IAAIH,KAAK,CAACI,UAAU,KAAK,SAASL,IAAI,EAAE;EAClE,OAAO;IACLM,KAAK,EAAEL,KAAK,CAACK,KAAK;IAClBC,KAAK,EAAEN,KAAK,CAACO,IAAI;IACjBH,UAAU,EAAEJ,KAAK,CAACI,UAAU;IAC5BL,IAAI;IACJS,IAAI,EAAER,KAAK,CAACQ,IAAI,EAAEC,WAAW,IAAI,IAAI;IACrCC,KAAK,EAAEV,KAAK,CAACU,KAA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