@zezosoft/zezo-ott-react-native-ui-kit 1.1.1 → 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/Button/BackBtn.js +24 -20
- 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/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 +0 -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 +17 -11
- 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/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/Button/BackBtn.d.ts +2 -2
- 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 +2 -2
- 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/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 +0 -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/Button/BackBtn.tsx +64 -34
- 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/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 +0 -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 +25 -9
- package/src/theme/hook/useInternalTheme.ts +19 -13
- package/src/theme/hook/useThemeStatusBar.ts +14 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo, useCallback } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
ScrollView,
|
|
4
4
|
StyleSheet,
|
|
@@ -53,7 +53,44 @@ export const BlogView: React.FC<BlogViewProps> = ({
|
|
|
53
53
|
}) => {
|
|
54
54
|
const { theme: appliedTheme, isDarkMode } = useInternalTheme(theme);
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
// Memoize markdown styles
|
|
57
|
+
const markdownStyles = useMemo(
|
|
58
|
+
() => getMarkdownStyles(appliedTheme, isDarkMode),
|
|
59
|
+
[appliedTheme, isDarkMode]
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
// Memoize header title style
|
|
63
|
+
const headerTitleStyle = useMemo(
|
|
64
|
+
() => ({
|
|
65
|
+
...styles.headerTitle,
|
|
66
|
+
color: appliedTheme.colors.onBackground,
|
|
67
|
+
}),
|
|
68
|
+
[appliedTheme.colors.onBackground]
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
// Memoize empty text style
|
|
72
|
+
const emptyTextStyle = useMemo(
|
|
73
|
+
() => [styles.emptyText, { color: appliedTheme.colors.onSurfaceVariant }],
|
|
74
|
+
[appliedTheme.colors.onSurfaceVariant]
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
// Memoize container style
|
|
78
|
+
const containerStyleMemo = useMemo(
|
|
79
|
+
() => [styles.flex, { backgroundColor: appliedTheme.colors.background }],
|
|
80
|
+
[appliedTheme.colors.background]
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
// Memoize scroll content style
|
|
84
|
+
const scrollContentStyle = useMemo(
|
|
85
|
+
() => [
|
|
86
|
+
styles.container,
|
|
87
|
+
containerStyle,
|
|
88
|
+
{ paddingBottom: scale(40), flexGrow: 1 },
|
|
89
|
+
],
|
|
90
|
+
[containerStyle]
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
const renderFinalHeader = useCallback(() => {
|
|
57
94
|
if (renderHeader) return renderHeader();
|
|
58
95
|
if (headerComponent) return headerComponent;
|
|
59
96
|
return (
|
|
@@ -63,15 +100,20 @@ export const BlogView: React.FC<BlogViewProps> = ({
|
|
|
63
100
|
title={headerTitle}
|
|
64
101
|
titleAlign="left"
|
|
65
102
|
theme={theme}
|
|
66
|
-
titleStyle={
|
|
67
|
-
...styles.headerTitle,
|
|
68
|
-
color: appliedTheme.colors.onBackground,
|
|
69
|
-
}}
|
|
103
|
+
titleStyle={headerTitleStyle}
|
|
70
104
|
/>
|
|
71
105
|
);
|
|
72
|
-
}
|
|
106
|
+
}, [
|
|
107
|
+
renderHeader,
|
|
108
|
+
headerComponent,
|
|
109
|
+
onBackPress,
|
|
110
|
+
onRightPress,
|
|
111
|
+
headerTitle,
|
|
112
|
+
theme,
|
|
113
|
+
headerTitleStyle,
|
|
114
|
+
]);
|
|
73
115
|
|
|
74
|
-
const renderFinalContent = () => {
|
|
116
|
+
const renderFinalContent = useCallback(() => {
|
|
75
117
|
if (isLoading) {
|
|
76
118
|
return (
|
|
77
119
|
<View style={styles.fullCenter}>
|
|
@@ -82,42 +124,34 @@ export const BlogView: React.FC<BlogViewProps> = ({
|
|
|
82
124
|
|
|
83
125
|
if (renderContent) return renderContent();
|
|
84
126
|
if (content) {
|
|
85
|
-
return
|
|
86
|
-
<Markdown style={getMarkdownStyles(appliedTheme, isDarkMode)}>
|
|
87
|
-
{content}
|
|
88
|
-
</Markdown>
|
|
89
|
-
);
|
|
127
|
+
return <Markdown style={markdownStyles}>{content}</Markdown>;
|
|
90
128
|
}
|
|
91
129
|
|
|
92
130
|
if (renderEmpty) return renderEmpty();
|
|
93
131
|
|
|
94
132
|
return (
|
|
95
133
|
<View style={styles.center}>
|
|
96
|
-
<Text
|
|
97
|
-
style={[
|
|
98
|
-
styles.emptyText,
|
|
99
|
-
{ color: appliedTheme.colors.onSurfaceVariant },
|
|
100
|
-
]}
|
|
101
|
-
>
|
|
102
|
-
{emptyText}
|
|
103
|
-
</Text>
|
|
134
|
+
<Text style={emptyTextStyle}>{emptyText}</Text>
|
|
104
135
|
</View>
|
|
105
136
|
);
|
|
106
|
-
}
|
|
137
|
+
}, [
|
|
138
|
+
isLoading,
|
|
139
|
+
renderContent,
|
|
140
|
+
content,
|
|
141
|
+
markdownStyles,
|
|
142
|
+
renderEmpty,
|
|
143
|
+
emptyText,
|
|
144
|
+
emptyTextStyle,
|
|
145
|
+
appliedTheme.colors.primary,
|
|
146
|
+
]);
|
|
107
147
|
|
|
108
148
|
return (
|
|
109
|
-
<View
|
|
110
|
-
style={[styles.flex, { backgroundColor: appliedTheme.colors.background }]}
|
|
111
|
-
>
|
|
149
|
+
<View style={containerStyleMemo}>
|
|
112
150
|
{renderFinalHeader()}
|
|
113
151
|
{scrollable ? (
|
|
114
152
|
<ScrollView
|
|
115
153
|
style={styles.flex}
|
|
116
|
-
contentContainerStyle={
|
|
117
|
-
styles.container,
|
|
118
|
-
containerStyle,
|
|
119
|
-
{ paddingBottom: scale(40), flexGrow: 1 },
|
|
120
|
-
]}
|
|
154
|
+
contentContainerStyle={scrollContentStyle}
|
|
121
155
|
showsVerticalScrollIndicator={false}
|
|
122
156
|
keyboardShouldPersistTaps="handled"
|
|
123
157
|
>
|
|
@@ -132,6 +166,8 @@ export const BlogView: React.FC<BlogViewProps> = ({
|
|
|
132
166
|
);
|
|
133
167
|
};
|
|
134
168
|
|
|
169
|
+
export default React.memo(BlogView);
|
|
170
|
+
|
|
135
171
|
const getMarkdownStyles = (
|
|
136
172
|
theme: ITheme,
|
|
137
173
|
isDarkMode: boolean
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @author Naresh Dhamu
|
|
3
3
|
* @lastModified Wed 02 Jul 2025 at 09:30 AM
|
|
4
4
|
*/
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useMemo, useCallback } from 'react';
|
|
6
6
|
import {
|
|
7
7
|
TouchableOpacity,
|
|
8
8
|
StyleSheet,
|
|
@@ -44,7 +44,7 @@ const BackBtn: React.FC<BackBtnProps> = ({
|
|
|
44
44
|
const insets = useSafeAreaInsets();
|
|
45
45
|
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
46
46
|
|
|
47
|
-
const handlePress = () => {
|
|
47
|
+
const handlePress = useCallback(() => {
|
|
48
48
|
if (onPress) {
|
|
49
49
|
onPress();
|
|
50
50
|
} else {
|
|
@@ -53,31 +53,72 @@ const BackBtn: React.FC<BackBtnProps> = ({
|
|
|
53
53
|
'Please define the back action using onPress prop.'
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
};
|
|
56
|
+
}, [onPress]);
|
|
57
57
|
|
|
58
|
-
const
|
|
58
|
+
const flattenedStyle = useMemo(
|
|
59
|
+
() => StyleSheet.flatten(style) || {},
|
|
60
|
+
[style]
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const hasTopInStyle = useMemo(
|
|
64
|
+
() => style && flattenedStyle.top !== undefined,
|
|
65
|
+
[style, flattenedStyle.top]
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const calculatedTop = useMemo(
|
|
69
|
+
() =>
|
|
70
|
+
Platform.select({
|
|
71
|
+
ios: insets.top > 20 ? insets.top - verticalScale(5) : insets.top,
|
|
72
|
+
android: insets.top + verticalScale(5),
|
|
73
|
+
default: insets.top,
|
|
74
|
+
}),
|
|
75
|
+
[insets.top]
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const hasBackground = useMemo(
|
|
79
|
+
() => !!flattenedStyle.backgroundColor,
|
|
80
|
+
[flattenedStyle.backgroundColor]
|
|
81
|
+
);
|
|
59
82
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
83
|
+
const shouldRenderBlur = useMemo(
|
|
84
|
+
() => enableBlur && hasBackground,
|
|
85
|
+
[enableBlur, hasBackground]
|
|
86
|
+
);
|
|
65
87
|
|
|
66
|
-
const
|
|
67
|
-
const hasBackground = !!flattenedStyle.backgroundColor;
|
|
88
|
+
const hasLabel = useMemo(() => !!label, [label]);
|
|
68
89
|
|
|
69
|
-
const
|
|
70
|
-
|
|
90
|
+
const iconColor = useMemo(
|
|
91
|
+
() => color || appliedTheme.colors.textPrimary,
|
|
92
|
+
[color, appliedTheme.colors.textPrimary]
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const containerStyle = useMemo(
|
|
96
|
+
() => [
|
|
97
|
+
styles.container,
|
|
98
|
+
hasLabel && styles.containerWithText,
|
|
99
|
+
!hasTopInStyle && { top: calculatedTop },
|
|
100
|
+
style,
|
|
101
|
+
],
|
|
102
|
+
[hasLabel, hasTopInStyle, calculatedTop, style]
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const textStyleMemo = useMemo(
|
|
106
|
+
() => [styles.text, { color: iconColor }, textStyle],
|
|
107
|
+
[iconColor, textStyle]
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const blurFallbackColor = useMemo(
|
|
111
|
+
() =>
|
|
112
|
+
(typeof flattenedStyle.backgroundColor === 'string'
|
|
113
|
+
? flattenedStyle.backgroundColor
|
|
114
|
+
: undefined) || String(appliedTheme.colors.backdrop),
|
|
115
|
+
[flattenedStyle.backgroundColor, appliedTheme.colors.backdrop]
|
|
116
|
+
);
|
|
71
117
|
|
|
72
118
|
return (
|
|
73
119
|
<TouchableOpacity
|
|
74
120
|
activeOpacity={0.8}
|
|
75
|
-
style={
|
|
76
|
-
styles.container,
|
|
77
|
-
hasLabel && styles.containerWithText,
|
|
78
|
-
!hasTopInStyle && { top: calculatedTop },
|
|
79
|
-
style,
|
|
80
|
-
]}
|
|
121
|
+
style={containerStyle}
|
|
81
122
|
onPress={handlePress}
|
|
82
123
|
>
|
|
83
124
|
{shouldRenderBlur && (
|
|
@@ -85,24 +126,13 @@ const BackBtn: React.FC<BackBtnProps> = ({
|
|
|
85
126
|
style={StyleSheet.absoluteFill}
|
|
86
127
|
blurType="light"
|
|
87
128
|
blurAmount={10}
|
|
88
|
-
reducedTransparencyFallbackColor={
|
|
89
|
-
(typeof flattenedStyle.backgroundColor === 'string'
|
|
90
|
-
? flattenedStyle.backgroundColor
|
|
91
|
-
: undefined) || String(appliedTheme.colors.backdrop)
|
|
92
|
-
}
|
|
129
|
+
reducedTransparencyFallbackColor={blurFallbackColor}
|
|
93
130
|
/>
|
|
94
131
|
)}
|
|
95
132
|
|
|
96
|
-
<ArrowLeft size={size} color={
|
|
133
|
+
<ArrowLeft size={size} color={iconColor} />
|
|
97
134
|
{hasLabel && (
|
|
98
|
-
<Text
|
|
99
|
-
style={[
|
|
100
|
-
styles.text,
|
|
101
|
-
{ color: color || appliedTheme.colors.textPrimary },
|
|
102
|
-
textStyle,
|
|
103
|
-
]}
|
|
104
|
-
color={color || appliedTheme.colors.textPrimary}
|
|
105
|
-
>
|
|
135
|
+
<Text style={textStyleMemo} color={iconColor}>
|
|
106
136
|
{label}
|
|
107
137
|
</Text>
|
|
108
138
|
)}
|
|
@@ -110,7 +140,7 @@ const BackBtn: React.FC<BackBtnProps> = ({
|
|
|
110
140
|
);
|
|
111
141
|
};
|
|
112
142
|
|
|
113
|
-
export default BackBtn;
|
|
143
|
+
export default React.memo(BackBtn);
|
|
114
144
|
|
|
115
145
|
const styles = StyleSheet.create({
|
|
116
146
|
container: {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @lastModified Tue 17 Jun 2025 at 10:45 AM
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React from 'react';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
import { useSafePressHandler } from '../../hooks/useSafeCallback';
|
|
7
8
|
import {
|
|
8
9
|
TouchableOpacity,
|
|
9
10
|
ActivityIndicator,
|
|
@@ -41,17 +42,47 @@ export const PrimaryBtn: React.FC<PrimaryBtnProps> = ({
|
|
|
41
42
|
theme,
|
|
42
43
|
}) => {
|
|
43
44
|
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
|
|
46
|
+
const backgroundColor = useMemo(
|
|
47
|
+
() =>
|
|
48
|
+
disabled || loading
|
|
49
|
+
? appliedTheme.colors?.buttonDisabled
|
|
50
|
+
: appliedTheme.colors?.button,
|
|
51
|
+
[
|
|
52
|
+
disabled,
|
|
53
|
+
loading,
|
|
54
|
+
appliedTheme.colors?.buttonDisabled,
|
|
55
|
+
appliedTheme.colors?.button,
|
|
56
|
+
]
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const buttonStyle = useMemo(
|
|
60
|
+
() => [styles.button, { backgroundColor }, containerStyle],
|
|
61
|
+
[backgroundColor, containerStyle]
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const textStyle = useMemo(
|
|
65
|
+
() => [styles.text, { color: appliedTheme.colors.buttonText }, titleStyle],
|
|
66
|
+
[appliedTheme.colors.buttonText, titleStyle]
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const loadingTextStyle = useMemo(
|
|
70
|
+
() => [
|
|
71
|
+
styles.text,
|
|
72
|
+
{ color: appliedTheme.colors.buttonText, opacity: 0.75 },
|
|
73
|
+
titleStyle,
|
|
74
|
+
],
|
|
75
|
+
[appliedTheme.colors.buttonText, titleStyle]
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const handlePress = useSafePressHandler(onPress, disabled || loading);
|
|
48
79
|
|
|
49
80
|
return (
|
|
50
81
|
<TouchableOpacity
|
|
51
|
-
onPress={
|
|
82
|
+
onPress={handlePress}
|
|
52
83
|
disabled={disabled || loading}
|
|
53
84
|
activeOpacity={0.8}
|
|
54
|
-
style={
|
|
85
|
+
style={buttonStyle}
|
|
55
86
|
accessibilityRole="button"
|
|
56
87
|
accessibilityState={{ disabled: disabled || loading }}
|
|
57
88
|
>
|
|
@@ -61,31 +92,17 @@ export const PrimaryBtn: React.FC<PrimaryBtnProps> = ({
|
|
|
61
92
|
color={appliedTheme.colors.buttonText}
|
|
62
93
|
style={{ marginRight: scale(8) }}
|
|
63
94
|
/>
|
|
64
|
-
<Text
|
|
65
|
-
style={[
|
|
66
|
-
styles.text,
|
|
67
|
-
{ color: appliedTheme.colors.buttonText, opacity: 0.75 },
|
|
68
|
-
titleStyle,
|
|
69
|
-
]}
|
|
70
|
-
>
|
|
71
|
-
{loadingText}
|
|
72
|
-
</Text>
|
|
95
|
+
<Text style={loadingTextStyle}>{loadingText}</Text>
|
|
73
96
|
</View>
|
|
74
97
|
) : (
|
|
75
|
-
<Text
|
|
76
|
-
style={[
|
|
77
|
-
styles.text,
|
|
78
|
-
{ color: appliedTheme.colors.buttonText },
|
|
79
|
-
titleStyle,
|
|
80
|
-
]}
|
|
81
|
-
>
|
|
82
|
-
{title}
|
|
83
|
-
</Text>
|
|
98
|
+
<Text style={textStyle}>{title}</Text>
|
|
84
99
|
)}
|
|
85
100
|
</TouchableOpacity>
|
|
86
101
|
);
|
|
87
102
|
};
|
|
88
103
|
|
|
104
|
+
export default React.memo(PrimaryBtn);
|
|
105
|
+
|
|
89
106
|
const styles = StyleSheet.create({
|
|
90
107
|
button: {
|
|
91
108
|
width: '100%',
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @lastModified Mon 06 Oct 2025 at 03:45 PM
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import React from 'react';
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
import { useSafePressHandler } from '../../hooks/useSafeCallback';
|
|
7
8
|
import {
|
|
8
9
|
TouchableOpacity,
|
|
9
10
|
ActivityIndicator,
|
|
@@ -44,17 +45,46 @@ export const SecondaryBtn: React.FC<SecondaryBtnProps> = ({
|
|
|
44
45
|
}) => {
|
|
45
46
|
const { theme: appliedTheme } = useInternalTheme(theme);
|
|
46
47
|
|
|
47
|
-
const backgroundColor =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
const backgroundColor = useMemo(
|
|
49
|
+
() =>
|
|
50
|
+
disabled || loading
|
|
51
|
+
? appliedTheme.colors?.buttonDisabled
|
|
52
|
+
: appliedTheme.colors?.button,
|
|
53
|
+
[
|
|
54
|
+
disabled,
|
|
55
|
+
loading,
|
|
56
|
+
appliedTheme.colors?.buttonDisabled,
|
|
57
|
+
appliedTheme.colors?.button,
|
|
58
|
+
]
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const buttonStyle = useMemo(
|
|
62
|
+
() => [styles.button, { backgroundColor }, containerStyle],
|
|
63
|
+
[backgroundColor, containerStyle]
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const textStyle = useMemo(
|
|
67
|
+
() => [styles.text, { color: appliedTheme.colors.buttonText }, titleStyle],
|
|
68
|
+
[appliedTheme.colors.buttonText, titleStyle]
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const loadingTextStyle = useMemo(
|
|
72
|
+
() => [
|
|
73
|
+
styles.text,
|
|
74
|
+
{ color: appliedTheme.colors.buttonText, opacity: 0.75 },
|
|
75
|
+
titleStyle,
|
|
76
|
+
],
|
|
77
|
+
[appliedTheme.colors.buttonText, titleStyle]
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const handlePress = useSafePressHandler(onPress, disabled || loading);
|
|
51
81
|
|
|
52
82
|
return (
|
|
53
83
|
<TouchableOpacity
|
|
54
|
-
onPress={
|
|
84
|
+
onPress={handlePress}
|
|
55
85
|
disabled={disabled || loading}
|
|
56
86
|
activeOpacity={0.8}
|
|
57
|
-
style={
|
|
87
|
+
style={buttonStyle}
|
|
58
88
|
accessibilityRole="button"
|
|
59
89
|
accessibilityState={{ disabled: disabled || loading }}
|
|
60
90
|
>
|
|
@@ -67,32 +97,18 @@ export const SecondaryBtn: React.FC<SecondaryBtnProps> = ({
|
|
|
67
97
|
color={appliedTheme.colors.buttonText}
|
|
68
98
|
style={{ marginRight: scale(6) }}
|
|
69
99
|
/>
|
|
70
|
-
<Text
|
|
71
|
-
style={[
|
|
72
|
-
styles.text,
|
|
73
|
-
{ color: appliedTheme.colors.buttonText, opacity: 0.75 },
|
|
74
|
-
titleStyle,
|
|
75
|
-
]}
|
|
76
|
-
>
|
|
77
|
-
{loadingText}
|
|
78
|
-
</Text>
|
|
100
|
+
<Text style={loadingTextStyle}>{loadingText}</Text>
|
|
79
101
|
</>
|
|
80
102
|
) : (
|
|
81
|
-
<Text
|
|
82
|
-
style={[
|
|
83
|
-
styles.text,
|
|
84
|
-
{ color: appliedTheme.colors.buttonText },
|
|
85
|
-
titleStyle,
|
|
86
|
-
]}
|
|
87
|
-
>
|
|
88
|
-
{title}
|
|
89
|
-
</Text>
|
|
103
|
+
<Text style={textStyle}>{title}</Text>
|
|
90
104
|
)}
|
|
91
105
|
</View>
|
|
92
106
|
</TouchableOpacity>
|
|
93
107
|
);
|
|
94
108
|
};
|
|
95
109
|
|
|
110
|
+
export default React.memo(SecondaryBtn);
|
|
111
|
+
|
|
96
112
|
const styles = StyleSheet.create({
|
|
97
113
|
button: {
|
|
98
114
|
width: '100%',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { useSafePressHandler } from '../../hooks/useSafeCallback';
|
|
2
3
|
import {
|
|
3
4
|
StyleSheet,
|
|
4
5
|
Pressable,
|
|
@@ -39,25 +40,58 @@ const TextButton: React.FC<TextButtonProps> = ({
|
|
|
39
40
|
}) => {
|
|
40
41
|
const { theme } = useInternalTheme();
|
|
41
42
|
|
|
42
|
-
const alignSelfMap
|
|
43
|
-
'left' | 'center' | 'right',
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const alignSelfMap = useMemo<
|
|
44
|
+
Record<'left' | 'center' | 'right', ViewStyle['alignSelf']>
|
|
45
|
+
>(
|
|
46
|
+
() => ({
|
|
47
|
+
left: 'flex-start',
|
|
48
|
+
center: 'center',
|
|
49
|
+
right: 'flex-end',
|
|
50
|
+
}),
|
|
51
|
+
[]
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const alignSelf = useMemo(() => alignSelfMap[align], [alignSelfMap, align]);
|
|
55
|
+
|
|
56
|
+
const textStyle = useMemo<TextStyle>(
|
|
57
|
+
() => ({
|
|
58
|
+
textAlign: align,
|
|
59
|
+
textDecorationLine: underline ? 'underline' : 'none',
|
|
60
|
+
fontWeight: bold ? '700' : '400',
|
|
61
|
+
}),
|
|
62
|
+
[align, underline, bold]
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const textColor = useMemo(
|
|
66
|
+
() => color || theme.colors.textPrimary,
|
|
67
|
+
[color, theme.colors.textPrimary]
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const justifyContent = useMemo<ViewStyle['justifyContent']>(
|
|
71
|
+
() =>
|
|
72
|
+
align === 'left'
|
|
73
|
+
? 'flex-start'
|
|
74
|
+
: align === 'right'
|
|
75
|
+
? 'flex-end'
|
|
76
|
+
: 'center',
|
|
77
|
+
[align]
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const rowStyle = useMemo<ViewStyle[]>(
|
|
81
|
+
() => [styles.row, { justifyContent }],
|
|
82
|
+
[justifyContent]
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
const finalTextStyle = useMemo(
|
|
86
|
+
() => [styles.text, textStyle, style],
|
|
87
|
+
[textStyle, style]
|
|
88
|
+
);
|
|
51
89
|
|
|
52
|
-
const
|
|
53
|
-
textAlign: align,
|
|
54
|
-
textDecorationLine: underline ? 'underline' : 'none',
|
|
55
|
-
fontWeight: bold ? '700' : '400',
|
|
56
|
-
};
|
|
90
|
+
const handlePress = useSafePressHandler(onPress, disabled);
|
|
57
91
|
|
|
58
92
|
return (
|
|
59
93
|
<Pressable
|
|
60
|
-
onPress={
|
|
94
|
+
onPress={handlePress}
|
|
61
95
|
disabled={disabled}
|
|
62
96
|
accessibilityRole="button"
|
|
63
97
|
accessibilityState={{ disabled }}
|
|
@@ -69,23 +103,11 @@ const TextButton: React.FC<TextButtonProps> = ({
|
|
|
69
103
|
disabled && styles.disabled,
|
|
70
104
|
]}
|
|
71
105
|
>
|
|
72
|
-
<View
|
|
73
|
-
style={[
|
|
74
|
-
styles.row,
|
|
75
|
-
{
|
|
76
|
-
justifyContent:
|
|
77
|
-
align === 'left'
|
|
78
|
-
? 'flex-start'
|
|
79
|
-
: align === 'right'
|
|
80
|
-
? 'flex-end'
|
|
81
|
-
: 'center',
|
|
82
|
-
},
|
|
83
|
-
]}
|
|
84
|
-
>
|
|
106
|
+
<View style={rowStyle}>
|
|
85
107
|
{leftIcon && <View style={styles.iconSpacing}>{leftIcon}</View>}
|
|
86
108
|
<Text
|
|
87
|
-
color={
|
|
88
|
-
style={
|
|
109
|
+
color={textColor}
|
|
110
|
+
style={finalTextStyle}
|
|
89
111
|
size={12}
|
|
90
112
|
numberOfLines={1}
|
|
91
113
|
allowFontScaling={false}
|
|
@@ -97,7 +119,7 @@ const TextButton: React.FC<TextButtonProps> = ({
|
|
|
97
119
|
);
|
|
98
120
|
};
|
|
99
121
|
|
|
100
|
-
export default TextButton;
|
|
122
|
+
export default React.memo(TextButton);
|
|
101
123
|
|
|
102
124
|
const styles = StyleSheet.create({
|
|
103
125
|
defaultContainer: {
|